Skip to content

Expose the internal getLanguageIdAtPosition to extensions #28047

Closed

Description

@ramya-rao-a

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.

Activity

  1. ramya-rao-a commented on Jun 5, 2017

    @ramya-rao-a
    ContributorAuthor
  2. jrieken commented on Jun 6, 2017

    @jrieken
    Contributor

    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...

  3. added
    *duplicate
    on Jun 6, 2017
  4. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicateapi

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions