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
{{ message }}
Repository navigation
Expose bracket matching functionality to extensions #7177
For your proposed API getMatchingBracket(position: Position), do you expect position to already be a bracket position, or make it such that someone can put any arbitrary position in and it will return the 2 surrounding brackets of that position.
Using the above api it would be possible to expose getting the bracket types for a document, and then being able to search surrounding brackets based on the bracket type.
The reason for needing vscode to do this work rather then parse it extension side is because we can't tell if a bracket is in a comment or a string without having to implement language specific parsing, while we want a generic solution for all languages. I'm hoping that some of the logic in bracketMatching.ts might be able to be reused, but I'm not sure its possible to reach that code from an entry point such as ExtHostDocumentData
cc alexandrudima who knows more about this. CoenraadS today we have no token information in the extension host and for performance reasons have no plans yet to change that
This feature request will not be considered in the next 6-12 months roadmap and as such will be closed to keep the number of issues we have to maintain actionable. Thanks for understanding and happy coding!
Activity
jrieken commentedon Jun 3, 2016
fyi alexandrudima
jrieken commentedon Jul 21, 2016
Sorry, but that won't happen in July
johnfn commentedon Dec 5, 2016
How about December? 😉
jrieken commentedon Dec 5, 2016
How about a PR?
johnfn commentedon Mar 17, 2017
Alright, but if I make a PR on vscode you have to make a PR on vscodevim. It's only fair! 😉
CoenraadS commentedon Apr 8, 2017
For your proposed API
getMatchingBracket(position: Position), do you expectpositionto already be a bracket position, or make it such that someone can put any arbitrary position in and it will return the 2 surrounding brackets of that position.getMatchingBracket(position: Position) : BracketgetSurroundingBrackets(position: Position) : BracketPairThoughts on including it, or should I make a separate request/issue?
CoenraadS commentedon May 6, 2017
Grant Mathews (@johnfn) Is this being worked on?
Else I might try it myself if its not too hard.(Not enough time)Johannes Rieken (@jrieken) Should API be discussed here or in PR?
jrieken commentedon May 8, 2017
here
johnfn commentedon May 8, 2017
No, I haven't worked on this.
Sorry I missed your question almost a month ago.
getSurroundingBracketswould be ideal.CoenraadS commentedon May 8, 2017
Using the above api it would be possible to expose getting the bracket types for a document, and then being able to search surrounding brackets based on the bracket type.
The reason for needing vscode to do this work rather then parse it extension side is because we can't tell if a bracket is in a comment or a string without having to implement language specific parsing, while we want a generic solution for all languages. I'm hoping that some of the logic in
bracketMatching.tsmight be able to be reused, but I'm not sure its possible to reach that code from an entry point such asExtHostDocumentDatajrieken commentedon May 8, 2017
cc alexandrudima who knows more about this.
CoenraadS today we have no token information in the extension host and for performance reasons have no plans yet to change that
jrieken commentedon Nov 17, 2017
This feature request will not be considered in the next 6-12 months roadmap and as such will be closed to keep the number of issues we have to maintain actionable. Thanks for understanding and happy coding!