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

Expose bracket matching functionality to extensions #7177

Closed
johnfn opened this issue Jun 3, 2016 · 12 comments
Closed

Expose bracket matching functionality to extensions #7177

johnfn opened this issue Jun 3, 2016 · 12 comments
Assignees
Labels
api feature-request Request for new features or functionality

Comments

@johnfn
Copy link
Contributor

johnfn commented Jun 3, 2016

I'm developing a Vim extension for Visual Studio Code and I could really use your guys' bracket matching logic.

Either exposing a function like getTextDecorations() or, better yet, a function like getMatchingBracket(position: Position) would be awesome.

Thanks!

@jrieken jrieken added feature-request Request for new features or functionality api labels Jun 3, 2016
@jrieken
Copy link
Member

jrieken commented Jun 3, 2016

fyi @alexandrudima

@johnfn johnfn mentioned this issue Jul 9, 2016
89 tasks
@egamma egamma mentioned this issue Jul 9, 2016
4 tasks
@egamma egamma added this to the July 2016 milestone Jul 14, 2016
@jrieken jrieken removed this from the July 2016 milestone Jul 21, 2016
@jrieken
Copy link
Member

jrieken commented Jul 21, 2016

Sorry, but that won't happen in July

@johnfn
Copy link
Contributor Author

johnfn commented Dec 5, 2016

How about December? 😉

@jrieken
Copy link
Member

jrieken commented Dec 5, 2016

How about a PR?

@johnfn
Copy link
Contributor Author

johnfn commented 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
Copy link
Contributor

CoenraadS commented Apr 8, 2017

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.

getMatchingBracket(position: Position) : Bracket
getSurroundingBrackets(position: Position) : BracketPair

Thoughts on including it, or should I make a separate request/issue?

@CoenraadS
Copy link
Contributor

CoenraadS commented May 6, 2017

@johnfn Is this being worked on? Else I might try it myself if its not too hard. (Not enough time)

@jrieken Should API be discussed here or in PR?

@jrieken
Copy link
Member

jrieken commented May 8, 2017

@jrieken Should API be discussed here or in PR?

here

@johnfn
Copy link
Contributor Author

johnfn commented May 8, 2017

No, I haven't worked on this.

Sorry I missed your question almost a month ago. getSurroundingBrackets would be ideal.

@CoenraadS
Copy link
Contributor

CoenraadS commented May 8, 2017

getMatchingBracketPosition(position: Position) : Position?
getSurroundingBracketPositions(position: Position, type?: CharacterPair) : Position[]?
getBracketTypes() : CharacterPair[]

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

@jrieken
Copy link
Member

jrieken commented 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
Copy link
Member

jrieken commented 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!

@jrieken jrieken closed this as completed Nov 17, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants