You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This request is send from client to server to handle "Matching Brace" editor action.
Method:experimental/matchingBrace
Request:
interfaceMatchingBraceParams{textDocument: TextDocumentIdentifier,/// Position for each cursorpositions: Position[],}
Response:
Position[]
Example
fnmain(){let x:Vec<()>/*cursor here*/ = vec![]}
experimental/matchingBrace yields the position of <.
In many cases, matching braces can be handled by the editor.
However, some cases (like disambiguating between generics and comparison operations) need a real parser.
Moreover, it would be cool if editors didn't need to implement even basic language parsing
Unresolved Question
Should we return a a nested brace structure, to allow paredit-like actions of jump out of the current brace pair?
This is how SelectionRange request works.
Alternatively, should we perhaps flag certain SelectionRanges as being brace pairs?
The text was updated successfully, but these errors were encountered:
This basically documents what rust-analyzer is doing today, but now I lean towards the last alternative for the general protocol -- just stuffing info about braces into SelectionRange request.
Another request from rust-analyzer
Matching Brace
Server Capability:
{ "matchingBrace": boolean }
This request is send from client to server to handle "Matching Brace" editor action.
Method:
experimental/matchingBrace
Request:
Response:
Example
experimental/matchingBrace
yields the position of<
.In many cases, matching braces can be handled by the editor.
However, some cases (like disambiguating between generics and comparison operations) need a real parser.
Moreover, it would be cool if editors didn't need to implement even basic language parsing
Unresolved Question
This is how
SelectionRange
request works.SelectionRange
s as being brace pairs?The text was updated successfully, but these errors were encountered: