Skip to content

Commit 75cb1c4

Browse files
committed
Fix shaderPaths setting being ignored by language server - bump to 0.7.1
The extension correctly sent additionalShaderPaths in initializationOptions but the language server never read them. Shaders from configured paths were only found after manually opening the file in a tab.
1 parent 76665ea commit 75cb1c4

File tree

4 files changed

+136
-8
lines changed

4 files changed

+136
-8
lines changed

VSCode/language-server/Program.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ static async Task Main(string[] args)
7474
_textDocumentSyncHandler.SetDiagnosticsDelay(delayMs);
7575
_logger?.LogInformation("Diagnostics delay set to {DelayMs}ms", delayMs);
7676
}
77+
78+
// Add user-configured additional shader paths
79+
if (initOptions.TryGetValue("additionalShaderPaths", out var pathsToken))
80+
{
81+
var additionalPaths = pathsToken.ToObject<List<string>>() ?? [];
82+
foreach (var path in additionalPaths)
83+
{
84+
if (Directory.Exists(path))
85+
{
86+
_workspace.AddShaderSearchPath(path, Services.ShaderSource.Workspace);
87+
_logger?.LogInformation("Added additional shader path from settings: {Path}", path);
88+
}
89+
else
90+
{
91+
_logger?.LogWarning("Additional shader path does not exist: {Path}", path);
92+
}
93+
}
94+
}
7795
}
7896

7997
// Auto-discover shader paths

VSCode/language-server/Services/ShaderWorkspace.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void DiscoverShaderPaths()
9292
_logger.LogInformation("Discovered {Count} total shader search paths", _shaderSearchPaths.Count);
9393
}
9494

95-
private void AddShaderSearchPath(string path, ShaderSource source)
95+
public void AddShaderSearchPath(string path, ShaderSource source)
9696
{
9797
lock (_lock)
9898
{

VSCode/vscode-extension/package-lock.json

Lines changed: 25 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VSCode/vscode-extension/package.json

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Stride SDSL Shader Tools",
44
"description": "IntelliSense, (future) debugging, and assistance for Stride and vvvv SDSL shaders",
55
"icon": "icons/icon.png",
6-
"version": "0.6.0",
6+
"version": "0.7.1",
77
"publisher": "tebjan",
88
"engines": {
99
"vscode": "^1.95.0"
@@ -147,6 +147,90 @@
147147
"command": "strideShaderTools.renameShaderInFile",
148148
"title": "Stride Shaders: Rename Shader Declaration"
149149
}
150+
],
151+
"debuggers": [
152+
{
153+
"type": "sdsl-shader",
154+
"label": "SDSL Shader Debugger",
155+
"program": "./dist/debugAdapter.js",
156+
"runtime": "node",
157+
"configurationAttributes": {
158+
"launch": {
159+
"required": [],
160+
"properties": {
161+
"captureFile": {
162+
"type": "string",
163+
"description": "Path to RenderDoc .rdc capture file (auto-detected if omitted)",
164+
"default": null
165+
},
166+
"pixelX": {
167+
"type": "number",
168+
"description": "X coordinate of pixel to debug",
169+
"default": 640
170+
},
171+
"pixelY": {
172+
"type": "number",
173+
"description": "Y coordinate of pixel to debug",
174+
"default": 360
175+
},
176+
"autoCapture": {
177+
"type": "boolean",
178+
"description": "Automatically detect and load latest capture from vvvv",
179+
"default": true
180+
},
181+
"vvvvLogDir": {
182+
"type": "string",
183+
"description": "Path to vvvv log folder containing HLSL files"
184+
},
185+
"workspaceDirs": {
186+
"type": "array",
187+
"description": "Additional directories to search for SDSL files",
188+
"items": {
189+
"type": "string"
190+
},
191+
"default": []
192+
}
193+
}
194+
}
195+
},
196+
"initialConfigurations": [
197+
{
198+
"type": "sdsl-shader",
199+
"request": "launch",
200+
"name": "Debug Shader (Auto-detect)",
201+
"autoCapture": true
202+
}
203+
],
204+
"configurationSnippets": [
205+
{
206+
"label": "SDSL: Debug Shader (Auto)",
207+
"description": "Auto-detect latest capture and debug shader",
208+
"body": {
209+
"type": "sdsl-shader",
210+
"request": "launch",
211+
"name": "Debug Shader",
212+
"autoCapture": true
213+
}
214+
},
215+
{
216+
"label": "SDSL: Debug Shader (Manual)",
217+
"description": "Debug specific capture file",
218+
"body": {
219+
"type": "sdsl-shader",
220+
"request": "launch",
221+
"name": "Debug Shader",
222+
"captureFile": "^\"\\${workspaceFolder}/captures/test_capture.rdc\"",
223+
"pixelX": 640,
224+
"pixelY": 360
225+
}
226+
}
227+
]
228+
}
229+
],
230+
"breakpoints": [
231+
{
232+
"language": "sdsl"
233+
}
150234
]
151235
},
152236
"scripts": {
@@ -163,7 +247,9 @@
163247
"test": "vscode-test"
164248
},
165249
"dependencies": {
166-
"vscode-languageclient": "^9.0.1"
250+
"vscode-languageclient": "^9.0.1",
251+
"@vscode/debugadapter": "^1.67.0",
252+
"@vscode/debugprotocol": "^1.67.0"
167253
},
168254
"devDependencies": {
169255
"@biomejs/biome": "^1.9.0",
@@ -181,5 +267,9 @@
181267
"type": "git",
182268
"url": "https://github.com/tebjan/Stride.ShaderExplorer"
183269
},
270+
"homepage": "https://forum.vvvv.org/t/stride-sdsl-shader-tools-for-vs-code/24975",
271+
"bugs": {
272+
"url": "https://github.com/tebjan/Stride.ShaderExplorer/issues"
273+
},
184274
"license": "GPL-3.0"
185275
}

0 commit comments

Comments
 (0)