shader-slang / slang-vscode-extension

Visual Studio Code extension for Slang
https://marketplace.visualstudio.com/items?itemName=shader-slang.slang-language-extension
MIT License
12 stars 2 forks source link

Different search paths for different subdirectories #7

Open shadowndacorner opened 3 weeks ago

shadowndacorner commented 3 weeks ago

Currently, the additionalSearchPaths configuration variable applies to any Slang source file in the workspace, however that doesn't necessarily map well to more complex build configurations. It would be very nice to be able to specify that additional search paths only affect certain subdirectories. For example, in an actual build, source files compiled under {workspaceDir}/packages/shaders/pbr may be able to see {workspaceDir}/packages/shaders/shadowutils, but not {workspaceDir}/packages/shaders/lambert.

I imagine this would be a new configuration variable that contains an array of something like { path: string, searchPaths: string[] }.

bmillsNV commented 2 weeks ago

Likely an issue with Visual Studio Code. We might be able to provide an WAR for this, but don't have capacity right now. However, we welcome contributions if you'd like to see this fixed sooner.

shadowndacorner commented 2 weeks ago

@bmillsNV Is this already supported in the language server? If so, if you could either point me in the general direction of how that is configured OR documentation on the language server in general (as, unless I'm missing it, it seems to be fairly undocumented), I'd be happy to look into implementing this on the VSC side as I described. Given the available configuration options, I assumed that it wasn't currently supported in the language server, or would require multiple instances of the language server to support, which seems unnecessarily wasteful for large projects. Though maybe the latter is the workaround you are referring to.