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

Let the user define its own embedded languages in the settings #46133

Closed
stef-levesque opened this issue Mar 19, 2018 · 2 comments
Closed

Let the user define its own embedded languages in the settings #46133

stef-levesque opened this issue Mar 19, 2018 · 2 comments
Assignees
Labels
*extension-candidate Issue identified as good extension implementation

Comments

@stef-levesque
Copy link

stef-levesque commented Mar 19, 2018

Issue Type: Feature Request

It would be helpful to have the user be able to define its own embedded languages in the settings (user or workspace)

This would be especially useful with C++11 Raw String Delimiters
(see issue stef-levesque/vscode-shader#13)

I would expect something like that, in a similar manner to how the editor settings can be overridden per language

    "[cpp]":  {
        "embeddedLanguages": [{
            "hlsl": {
                "begin": "(?:^\\s*)R\"glsl\\(",
                "end": "\\)glsl\"",
            }
        }]
    },

    "[html]":  {
        "embeddedLanguages": [{
            "python": {
                "begin": "(?:^\\s*)<\\?python(?!.*\\?>)",
                "end": "\\?>(?:\\s*$\\n)?",
            }
        }]
    }

VS Code version: Code 1.21.1 (79b44aa, 2018-03-14T14:46:47.128Z)
OS version: Windows_NT x64 10.0.15063

@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2018

@mjbvz you probably know who to send this one to

@vscodebot vscodebot bot removed the new release label Mar 20, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 23, 2018

Extensions can already contributed injected grammars, see the styled-components extension for example: https://github.com/styled-components/vscode-styled-components

Doing this properly gets rather complicated (and it is not easily simplified) so it's probably a better fit for an extension rather than a user setting

@mjbvz mjbvz closed this as completed Mar 23, 2018
@mjbvz mjbvz added the *extension-candidate Issue identified as good extension implementation label Mar 23, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*extension-candidate Issue identified as good extension implementation
Projects
None yet
Development

No branches or pull requests

3 participants