Skip to content

LSP: Use snippet insert mode to add closing braces#96726

Closed
HolonProduction wants to merge 1 commit intogodotengine:masterfrom
HolonProduction:lsp-braces
Closed

LSP: Use snippet insert mode to add closing braces#96726
HolonProduction wants to merge 1 commit intogodotengine:masterfrom
HolonProduction:lsp-braces

Conversation

@HolonProduction
Copy link
Copy Markdown
Member

@HolonProduction HolonProduction commented Sep 8, 2024

Fixes #84549

LSP clients don't seem to auto-close braces from insert texts (seems like unspecified territory). We can instead close them in the server and use the snippet insert mode to place the caret between the braces:

Screencast.from.2024-09-08.22-00-12.webm

Note

In theory this should be locked behind certain client capabilities, but from what I see we don't track them.

@HolonProduction HolonProduction requested a review from a team as a code owner September 8, 2024 20:07
@dalexeev dalexeev added this to the 4.4 milestone Sep 8, 2024
@HolonProduction
Copy link
Copy Markdown
Member Author

HolonProduction commented Sep 24, 2024

I'm converting this to a draft for now, as I stated above this should be locked behind client capability tracking which isn't implemented at the moment, so this might break LSP compatibility with editors that aren't VSCode.

When/if capability tracking is a thing we can revisit this, in the meantime we should just strip those quotes and parenthesis.

Also godotengine/godot-proposals#6312 seems related to this.

@HolonProduction
Copy link
Copy Markdown
Member Author

Superseded by #114598

@HolonProduction HolonProduction removed this from the 4.x milestone Jan 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lsp autocompletion no close parenthesis

2 participants