Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to control workspaceFolders in InitializeParams #1470

Open
hyangah opened this issue May 3, 2024 · 1 comment
Open

Option to control workspaceFolders in InitializeParams #1470

hyangah opened this issue May 3, 2024 · 1 comment
Labels
feature-request Request for new features or functionality
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented May 3, 2024

Sorry for opening an issue to ask questions.

We (Go extension) are using this client library to interact with the go language server. Currently the server assumes all workspace folders have file://-scheme. In vscode, however, that's not always true - some extensions register virtual file systems and their folders can be added as workspace folders. I hoped that we could use the WorkspaceFolderMiddleware. But, I suspect this is not used when populating the workspaceFolders property of the initializeParams.

The WorkspaceFolderFeature's fillInitalizeParam calls vscode.workspace.workspaceFolders directly.

const folders = workspace.workspaceFolders;

Are there other paths that I can use to filter out non-file type folders when building the initialize request message?

@dbaeumer
Copy link
Member

dbaeumer commented May 6, 2024

The only way I can currently think of is subclassing the client and overriding fillInitializeParams and patching the workspace folders there. This being said, subclassing is generally not recommended and this might break in future versions.

The correct way would be to provide a hook via the client options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants