Skip to content

Commit af485cf

Browse files
committed
Initial commit
0 parents  commit af485cf

177 files changed

Lines changed: 12979 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main", "develop"]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Install Rust Toolchain
16+
uses: dtolnay/rust-toolchain@stable
17+
with:
18+
components: rustfmt, clippy
19+
20+
- name: Cache Dependencies
21+
uses: actions/cache@v3
22+
with:
23+
path: |
24+
~/.cargo/registry
25+
~/.cargo/git
26+
key: ${{ runner.os }}-cargo-deps
27+
28+
- name: Build All Crates
29+
run: cargo build --all --verbose
30+
31+
- name: Run Clippy
32+
run: cargo clippy --all -- -D warnings
33+
34+
- name: Format Check
35+
run: cargo fmt --all -- --check
36+
37+
- name: Run Tests
38+
run: cargo test --all --verbose

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
create-release:
10+
name: Create GitHub Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Build Release Artifacts
16+
run: cargo build --release
17+
18+
- name: Create Release
19+
uses: softprops/action-gh-release@v1
20+
with:
21+
files: |
22+
target/release/streamforge-exe
23+
target/release/streamforge.exe
24+
generate_release_notes: true
25+
draft: false
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

.zed/README.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# Zed Configuration for StreamForge Project
2+
3+
This directory contains configuration files to fix language server issues in Zed on Windows.
4+
5+
## Issues Fixed
6+
7+
### 1. Docker Compose Language Server Error
8+
9+
**Problem**: The docker-compose language server extension was failing with:
10+
```
11+
SyntaxError: missing ) after argument list
12+
at wrapSafe (node:internal/modules/cjs/loader:1486:18)
13+
```
14+
15+
**Solution**: Created a batch file wrapper that properly calls the PowerShell version of the language server.
16+
17+
### 2. PowerShell Language Server Error
18+
19+
**Problem**: The PowerShell extension reported:
20+
```
21+
PowerShell must be installed for PowerShell Extension
22+
```
23+
24+
**Solution**: Created a PowerShell wrapper script and configuration to properly locate and launch PowerShell.
25+
26+
## Files Created
27+
28+
1. **`.zed\settings.json`** - Main Zed configuration for both language servers
29+
2. **`.zed\docker-compose-langserver.bat`** - Batch file wrapper for docker-compose language server
30+
3. **`.zed\powershell-wrapper.bat`** - Batch file wrapper for PowerShell language server
31+
4. **`.zed\docker-compose-langserver-wrapper.ps1`** - PowerShell wrapper for docker-compose (alternative)
32+
5. **`.zed\powershell-settings.json`** - PowerShell-specific configuration
33+
6. **`.zed\language_servers.json`** - Additional language server configuration
34+
35+
## How It Works
36+
37+
### Docker Compose Language Server
38+
The batch file wrapper (`docker-compose-langserver.bat`) properly calls the PowerShell version of the language server that comes with the extension, bypassing the problematic Unix shell script.
39+
40+
### PowerShell Language Server
41+
The PowerShell wrapper (`powershell-wrapper.bat`) automatically detects and uses the correct PowerShell installation on your system, whether it's:
42+
- Windows PowerShell (v1.0)
43+
- PowerShell Core 7 (x64 or x86)
44+
- PowerShell available in system PATH
45+
46+
## Testing
47+
48+
After applying these changes:
49+
50+
1. **Restart Zed** - This is important for the new configuration to take effect
51+
2. **Test docker-compose files** - Open a `docker-compose.yml` file, the language server should initialize without errors
52+
3. **Test PowerShell files** - Open a `.ps1` file, PowerShell language server should work properly
53+
4. **Check functionality** - You should get syntax highlighting, IntelliSense, and other language server features
54+
55+
## Troubleshooting
56+
57+
### If Docker Compose Language Server Still Fails
58+
59+
1. **Check paths**: Ensure the paths in `docker-compose-langserver.bat` match your system's extension directory
60+
2. **Try PowerShell wrapper**: Update `settings.json` to use `docker-compose-langserver-wrapper.ps1` instead
61+
3. **Disable extension**: Set `"enabled": false` in the docker-compose language server configuration to use Zed's built-in YAML support
62+
63+
### If PowerShell Language Server Still Fails
64+
65+
1. **Check PowerShell installation**: Ensure PowerShell is installed on your system
66+
2. **Check wrapper script**: Verify that `powershell-wrapper.bat` can find PowerShell on your system
67+
3. **Manual PowerShell path**: Set `"powershellExePath"` in settings to the full path of your PowerShell executable
68+
4. **Use built-in support**: Disable the PowerShell language server and rely on Zed's built-in syntax highlighting
69+
70+
### Common PowerShell Installation Paths
71+
72+
- Windows PowerShell: `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`
73+
- PowerShell Core 7 (x64): `C:\Program Files\PowerShell\7\pwsh.exe`
74+
- PowerShell Core 7 (x86): `C:\Program Files (x86)\PowerShell\7\pwsh.exe`
75+
76+
### Disabling Language Servers
77+
78+
If you want to disable either language server, set `"enabled": false` in the respective configuration:
79+
80+
```json
81+
{
82+
"language_servers": {
83+
"docker-compose": {
84+
"enabled": false
85+
},
86+
"powershell": {
87+
"enabled": false
88+
}
89+
}
90+
}
91+
```
92+
93+
## Alternative Solutions
94+
95+
### Using Built-in Language Support
96+
97+
Zed has good built-in support for both YAML and PowerShell syntax highlighting. If the language servers continue to cause issues, you can:
98+
99+
1. Disable the language servers as shown above
100+
2. Rely on Zed's built-in syntax highlighting and basic language features
101+
3. Use external tools for advanced language server features when needed
102+
103+
### Manual PowerShell Installation
104+
105+
If PowerShell is not installed on your system:
106+
107+
1. **Windows PowerShell**: Comes pre-installed on Windows 7+ (may need to be enabled)
108+
2. **PowerShell Core 7**: Download from [Microsoft's GitHub releases](https://github.com/PowerShell/PowerShell/releases)
109+
3. **Windows Package Manager**: `winget install --id Microsoft.PowerShell`
110+
111+
## Support
112+
113+
If you continue to experience issues:
114+
115+
1. Check the Zed logs for more detailed error information
116+
2. Verify that the wrapper scripts have execute permissions
117+
3. Ensure that the language server extensions are properly installed in Zed
118+
4. Consider filing an issue with the respective language server extension repositories
119+
```
120+
121+
<tool_call>
122+
<function=edit_file>
123+
<parameter=path>
124+
C:\Users\PC\Documents\streamforge\.zed\README.md
125+
</parameter>
126+
<parameter=mode>
127+
overwrite
128+
</parameter>
129+
<parameter=display_description>
130+
Update README with comprehensive PowerShell and docker-compose fixes
131+
</parameter>
132+
</function>
133+
</tool_call>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env pwsh
2+
# Docker Compose Language Server Wrapper
3+
# This script ensures the docker-compose language server runs correctly on Windows
4+
5+
$ErrorActionPreference = 'Stop'
6+
7+
# Get the path to the actual language server
8+
$homePath = $env:USERPROFILE
9+
$serverPath = Join-Path $homePath "AppData\Local\Zed\extensions\work\docker-compose\node_modules\.bin\docker-compose-langserver.ps1"
10+
11+
# Check if the server file exists
12+
if (-Not (Test-Path $serverPath)) {
13+
Write-Error "Docker Compose Language Server not found at: $serverPath"
14+
exit 1
15+
}
16+
17+
# Run the language server with all arguments passed to this wrapper
18+
try {
19+
& $serverPath @args
20+
exit $LASTEXITCODE
21+
} catch {
22+
Write-Error "Failed to start Docker Compose Language Server: $_"
23+
exit 1
24+
}
25+
```
26+
</tool_response>

.zed/docker-compose-langserver.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
@echo off
2+
REM Docker Compose Language Server Batch Wrapper
3+
REM This script ensures the docker-compose language server runs correctly on Windows
4+
5+
setlocal
6+
7+
REM Get the path to the PowerShell script
8+
set "PS_SCRIPT=%USERPROFILE%\AppData\Local\Zed\extensions\work\docker-compose\node_modules\.bin\docker-compose-langserver.ps1"
9+
10+
REM Check if the PowerShell script exists
11+
if not exist "%PS_SCRIPT%" (
12+
echo ERROR: Docker Compose Language Server not found at: %PS_SCRIPT%
13+
exit /b 1
14+
)
15+
16+
REM Run the PowerShell script with all arguments passed to this batch file
17+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%" %*
18+
19+
REM Exit with the same code as the PowerShell script
20+
exit /b %ERRORLEVEL%
21+
```
22+
</tool_response>

.zed/language_servers.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"docker-compose": {
3+
"command": "pwsh",
4+
"args": [
5+
"-NoProfile",
6+
"-ExecutionPolicy",
7+
"Bypass",
8+
"-File",
9+
"${home}/AppData/Local/Zed/extensions/work/docker-compose/node_modules/.bin/docker-compose-langserver.ps1"
10+
]
11+
}
12+
}

.zed/powershell-settings.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"powershell": {
3+
"powershellExePath": null,
4+
"powershellDefaultVersion": null,
5+
"powershellEnableProfileLoading": "no",
6+
"powershellAdditionalExePaths": [],
7+
"powershellAdditionalModules": [],
8+
"powershellEnableConsoleRepl": true,
9+
"powershellEnableProfileLoading": false,
10+
"powershellEnablePowershellPreviewFeatures": false,
11+
"powershellEnableCodeActions": true,
12+
"powershellEnableCompletion": true,
13+
"powershellEnableHover": true,
14+
"powershellEnableIntellisense": true,
15+
"powershellEnableDocumentFormatting": true,
16+
"powershellEnableDocumentSymbolProvider": true,
17+
"powershellEnableWorkspaceSymbolProvider": true,
18+
"powershellEnableRunTests": true,
19+
"powershellEnablePesterLinter": true,
20+
"powershellEnableScriptAnalyzer": true
21+
}
22+
}

.zed/powershell-wrapper.bat

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@echo off
2+
REM PowerShell Language Server Wrapper
3+
REM This script ensures PowerShell is properly launched for the language server
4+
5+
setlocal
6+
7+
REM Try to find PowerShell
8+
set "POWERSHELL_PATH="
9+
10+
REM Check common PowerShell locations
11+
if exist "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" (
12+
set "POWERSHELL_PATH=C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
13+
) else if exist "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" (
14+
set "POWERSHELL_PATH=C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe"
15+
) else if exist "C:\Program Files\PowerShell\7\pwsh.exe" (
16+
set "POWERSHELL_PATH=C:\Program Files\PowerShell\7\pwsh.exe"
17+
) else if exist "C:\Program Files (x86)\PowerShell\7\pwsh.exe" (
18+
set "POWERSHELL_PATH=C:\Program Files (x86)\PowerShell\7\pwsh.exe"
19+
)
20+
21+
REM If PowerShell not found, try using system PATH
22+
if "%POWERSHELL_PATH%"=="" (
23+
where powershell >nul 2>&1
24+
if %ERRORLEVEL%==0 (
25+
set "POWERSHELL_PATH=powershell"
26+
) else (
27+
where pwsh >nul 2>&1
28+
if %ERRORLEVEL%==0 (
29+
set "POWERSHELL_PATH=pwsh"
30+
)
31+
)
32+
)
33+
34+
REM Check if we found PowerShell
35+
if "%POWERSHELL_PATH%"=="" (
36+
echo ERROR: PowerShell not found on this system
37+
echo Please install PowerShell from: https://docs.microsoft.com/en-us/powershell/
38+
exit /b 1
39+
)
40+
41+
echo Using PowerShell at: %POWERSHELL_PATH%
42+
43+
REM Launch PowerShell with the provided arguments
44+
"%POWERSHELL_PATH%" -NoProfile -ExecutionPolicy Bypass %*
45+
46+
REM Exit with the same code as PowerShell
47+
exit /b %ERRORLEVEL%
48+
```
49+
50+
<tool_call>
51+
<function=edit_file>
52+
<parameter=path>
53+
C:\Users\PC\Documents\streamforge\.zed\settings.json
54+
</parameter>
55+
<parameter=mode>
56+
overwrite
57+
</parameter>
58+
<parameter=display_description>
59+
Update settings to use PowerShell wrapper
60+
</parameter>
61+
</function>
62+
</tool_call>

0 commit comments

Comments
 (0)