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

API for extensions to know the scope as per grammar of the cursor position #18485

Closed
ramya-rao-a opened this issue Jan 13, 2017 · 4 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality

Comments

@ramya-rao-a
Copy link
Contributor

It would be helpful for extension authors to know if the cursor is inside a string or a comment or any of the other scopes as defined by the grammar.

When an extension is not using LSP, this can help the extension in being smarter say in case of completion item provider.
Currently to do so, the extension needs to parse the file itself.
But, the scope (as per grammar) is already available to core VS Code.

If that can be exposed, I can fix a bunch of issues in the Go extension :)

@rebornix
Copy link
Member

Extensions provide a language grammar for Code to generate the tokens and then ask Code for the token info, very reasonable.

@rebornix rebornix added the feature-request Request for new features or functionality label Jan 13, 2017
@siegebell
Copy link

See #580.

Until the feature is supported by vscode, my extension (scope-info) exports an API that other extensions can use to get the scope information that vscode uses.

@ramya-rao-a
Copy link
Contributor Author

Closing as duplicate of #580

@ramya-rao-a ramya-rao-a added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 16, 2017
@ramya-rao-a
Copy link
Contributor Author

Thanks for the pointer @siegebell !

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants