Skip to content

Conversation

ogoffart
Copy link
Member

Closes #5961

@ogoffart ogoffart requested a review from NigelBreslaw June 28, 2025 13:39
@ogoffart
Copy link
Member Author

I've tested it in slint-ui/material-cpp-template#1

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if the Lsp’s working directory is guaranteed or if we can somehow ensure it ourselves when we set up the launch config in extension.ts?

Copy link
Member Author

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if the Lsp’s working directory is guaranteed or if we can somehow ensure it ourselves when we set up the launch config in extension.ts?

Yes, vscode starts the LSP with the workspace root as the directory.
If the workspace has multiple root, the first one is used.

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
@tronical
Copy link
Member

I'd like to suggest #8815 as a safeguard, unless you're certain that the behaviour is guaranteed.

@ogoffart
Copy link
Member Author

The cwd is set around here.
https://github.com/microsoft/vscode-languageserver-node/blob/4376df05e1cc7cefb106137f74b844fc709c8e7a/client/src/node/main.ts#L576

This is not documented, but i doubt they'd change it.

@ogoffart ogoffart merged commit 2890e69 into master Jun 30, 2025
76 of 77 checks passed
@ogoffart ogoffart deleted the olivier/fix-#5961 branch June 30, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VSCode Extension: slint.{includePaths, libraryPaths} should support ${workspaceFolder} interpolation
2 participants