|
| 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> |
0 commit comments