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

x/tools/gopls: update protocol generation to support unions #52969

Open
findleyr opened this issue May 18, 2022 · 0 comments
Open

x/tools/gopls: update protocol generation to support unions #52969

findleyr opened this issue May 18, 2022 · 0 comments
Assignees
Labels
gopls Tools
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented May 18, 2022

In the implementation of #41567, it is likely that we will need to extend our support for workspace edits.

Specifically, the WorkspaceEdit protocol type supports resource operations creating, renaming, and deleting files:

documentChanges?: (
		[TextDocumentEdit](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentEdit)[] |
		([TextDocumentEdit](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentEdit) | [CreateFile](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#createFile) | [RenameFile](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#renameFile) | [DeleteFile](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#deleteFile))[]
	);

However, our protocol generation only supports []TextDocumentEdit:
https://cs.opensource.google/go/x/tools/+/master:internal/lsp/protocol/tsprotocol.go;l=5702;drc=b7d757405fe14c924baefbdedd785e4c6a7a0f88

In order to implement package renaming, we'll want to rename directories, and so will need to be able to express this in our WorkspaceEdit response.

CC @dle8 @pjweinb

@findleyr findleyr added this to the gopls/v0.9.0 milestone May 18, 2022
@gopherbot gopherbot added Tools gopls labels May 18, 2022
@findleyr findleyr removed this from the gopls/v0.9.0 milestone Jun 27, 2022
@findleyr findleyr added this to the gopls/v0.9.1 milestone Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Tools
Projects
None yet
Development

No branches or pull requests

3 participants