-
Notifications
You must be signed in to change notification settings - Fork 304
Don’t return edits from ExecuteCommandRequest
#1498
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
Comments
Synced to Apple’s issue tracker as rdar://130207754 |
lokesh-tr
added a commit
to lokesh-tr/sourcekit-lsp
that referenced
this issue
Jul 2, 2024
------------------------------------------------------------------------------- This implements an LSP Extension `PeekDocumentsRequest` to let `ExpandMacroCommand` to open the macro expansions in a "peeked" editor window. For this to work, the client has to pass "workspace/peekDocuments" enabled to `ClientCapabilities.experimental` and the client should handle the `PeekDocumentsRequest` and show the expansions in a "peeked" editor window. PR to support the above capability in the "Swift for VS Code" Extension: swiftlang/vscode-swift#945 The "Swift for VS Code" extension cannot send the client capability, so it instead passes the same through `initializationOptions` in the `InitializeRequest`. For editors which doesn't support this capability, `sourcekit-lsp` sends a `ShowDocumentRequest`. The `ShowDocumentRequest` is updated to show all the macro expansions in a single generated file. Moreover, its folder structure is updated to use hex string of MD5 hash of concatenation of buffer names of expansions. Fixes swiftlang/vscode-swift#564 Fixes swiftlang#1498 ( rdar://130207754 )
lokesh-tr
added a commit
to lokesh-tr/sourcekit-lsp
that referenced
this issue
Jul 4, 2024
------------------------------------------------------------------------------- This implements an LSP Extension `PeekDocumentsRequest` to let `ExpandMacroCommand` to open the macro expansions in a "peeked" editor window. For this to work, the client has to pass "workspace/peekDocuments" enabled to `ClientCapabilities.experimental` and the client should handle the `PeekDocumentsRequest` and show the expansions in a "peeked" editor window. PR to support the above capability in the "Swift for VS Code" Extension: swiftlang/vscode-swift#945 The "Swift for VS Code" extension cannot send the client capability, so it instead passes the same through `initializationOptions` in the `InitializeRequest`. For editors which doesn't support this capability, `sourcekit-lsp` sends a `ShowDocumentRequest`. The `ShowDocumentRequest` is updated to show all the macro expansions in a single generated file. Moreover, its folder structure is updated to use hex string of MD5 hash of concatenation of buffer names of expansions. Fixes swiftlang/vscode-swift#564 Fixes swiftlang#1498 ( rdar://130207754 )
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
ExecuteCommandRequest
is returning the edits it wants to perform to the source file as theLSPAny
response. Clients shouldn’t know how to interpret thatLSPAny
and the edits are actually applied by sending aApplyEditRequest
to the client.Only tests are currently relying on the response of the
ExecuteCommandRequest
. We should change those tests to test the actualApplyEditRequest
sent to the client and makeExecuteCommandRequest
return an empty response.The text was updated successfully, but these errors were encountered: