microsoft / microsoft/language-server-protocol
Clarification on workspace folders and roots in the initialize request
Open
Nobody has claimed this yet.
clarification
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 1k
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 10
Description
/**
* The rootPath of the workspace. Is null
* if no folder is open.
*
* @deprecated in favour of `rootUri`.
*/
rootPath?: string | null;
/**
* The rootUri of the workspace. Is null if no
* folder is open. If both `rootPath` and `rootUri` are set
* `rootUri` wins.
*
* @deprecated in favour of `workspaceFolders`
*/
rootUri: DocumentUri | null;
/**
* The workspace folders configured in the client when the server starts.
* This property is only available if the client supports workspace folders.
* It can be `null` if the client supports workspace folders but none are
* configured.
*
* @since 3.6.0
*/
workspaceFolders?: WorkspaceFolder[] | null;
{
"rootPath": "/tmp/lsp/question",
"rootUri": "file:///tmp/lsp/question",
"workspaceFolders": []
}
- If
workspaceFoldersis[], should we ignorerootUriandrootPath? I presume yes as it is still there and the language server should do its best to provide a trimmed down set of features and/or infer the "root" from opened files instead of deferring torootUriand/orrootPath.
{
"rootPath": "/tmp/lsp/question",
"rootUri": "file:///tmp/lsp/question",
"workspaceFolders": null
}
- If
workspaceFoldersisnull, should we ignorerootUriandrootPath? I presume yes, per the documentation that "none are configured". So we should do the same as 1 above, right?
{
"rootPath": "/no/scheme",
"rootUri": ":/no/scheme"
}
- If
workspaceFoldersis completely missing, androotUriis""or an invalid URI, should the server respond withInvalidParams(-32602) or should the server just ignore it and userootPath? 🤔
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the initialize request definitions for rootPath, rootUri, and workspaceFolders, then resolve the behavior for empty, null, missing, and invalid values described in the examples. Done means the protocol semantics are decided and the clarification is recorded in the relevant documentation or specification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100