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 the internal getLanguageIdAtPosition to extensions #28047

Closed
ramya-rao-a opened this issue Jun 5, 2017 · 2 comments
Closed

Expose the internal getLanguageIdAtPosition to extensions #28047

ramya-rao-a opened this issue Jun 5, 2017 · 2 comments
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s)

Comments

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 5, 2017

document.getLanguageId() only gives the language of the document.

In case of embedded languages like css/js in html, the editor is aware of the languageId at position via getLanguageIdAtPosition. But this information is not available for extensions.

In my case, the emmet extension needs to know whether it should suggest html or css abbreviations based on the language under the cursor. Of course, I can do that by using some regex magic, but since this information is available in the editor, it would be good to make it available for extensions as well.

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented Jun 5, 2017

cc @alexandrudima @rebornix

@jrieken
Copy link
Member

jrieken commented Jun 6, 2017

This dupes (more or less) #580 which about moving tokens to the ext side. Tricky because it expensive and would require us to re-sync on type...

@jrieken jrieken closed this as completed Jun 6, 2017
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants