-
Notifications
You must be signed in to change notification settings - Fork 145
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
Issue #132: Proposal for workspaceFolders #133
Issue #132: Proposal for workspaceFolders #133
Conversation
650c353
to
70fa8f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
In addition to the remarks below, I would propose to add comments to the new classes and properties making clear that this API is in a "proposed" state and might be changed in the future. We could also use the com.google.common.annotations.Beta
annotation for that.
/** | ||
* Capabilities specific to the `workspace/didChangeWorkspaceFolders` notification. | ||
*/ | ||
WorkspaceFoldersOptions workspaceFolders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current version of the proposed extension, the workspaceFolders
options are wrapped in an additional workspace
property. This should be a new class named WorkspaceServerCapabilities
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's more something to fix on the proposed extension side ;)
/** | ||
* The server has support for workspace folders | ||
*/ | ||
Boolean workspaceFolders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be named supported
.
/** | ||
* The associated URI for this workspace folder. | ||
*/ | ||
String uri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be @NonNull
.
* the workspace folders otherwise. | ||
*/ | ||
@JsonRequest("workspace/workspaceFolders") | ||
CompletableFuture<List<WorkspaceFolder>> workspaceFolders(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a method here breaks existing implementations. Since the protocol extension is still in a "proposed" state, we should avoid breaking changes. Either move the method to a separate interface or add a default implementation here. I prefer the second option.
* registered to receive this notification it first. | ||
*/ | ||
@JsonNotification | ||
void didChangeWorkspaceFolders(DidChangeWorkspaceFoldersParams params); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks existing implementations, see above.
70fa8f9
to
6105cf4
Compare
PR updated. Only the first comment has not been fixed since I'm waiting for a clarification on the proposal: microsoft/language-server-protocol#298 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Let's wait for a reply by @dbaeumer regarding ServerCapabilities before we merge this.
Commented in microsoft/language-server-protocol#298 (comment) |
Signed-off-by: Mickael Istria <mistria@redhat.com>
6105cf4
to
4ae0ab3
Compare
Thanks for the clarification @dbaeumer . |
👍 |
Signed-off-by: Mickael Istria mistria@redhat.com