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

How can we reuse editor of another language in any file #9650

Closed
Thaina opened this issue Jul 23, 2016 · 6 comments
Closed

How can we reuse editor of another language in any file #9650

Thaina opened this issue Jul 23, 2016 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@Thaina
Copy link

Thaina commented Jul 23, 2016

Basically it like HTML can edit css and javascript in <style> and <script> tag

I am using couchDB and have a hard time edit its document. couchdb work with javascript in json so I need to write javascript in string

something like this

{
  "_id": "_design/_auth",
  "language": "javascript",
  "updates": {
    "test": "function (doc, req) {\n if(!req.id)\n return [null,JSON.stringify([doc,req])];\n}"
  }
}

Something like this. It hard and ugly so I want to make it easy by developing vscode extension

Could you please guide me?

Also I have heard from typescript team that vscode still lack this feature so they can't put salsa editor in HTML file. If it's true then I would like to make feature request

@wholroyd
Copy link

This may be a duplicate of #1751

@kieferrm kieferrm added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Jul 25, 2016
@aeschli
Copy link
Contributor

aeschli commented Jul 25, 2016

Bringing back JS and CSS in HTML is part of the task #3995.

@aeschli aeschli closed this as completed Jul 25, 2016
@Thaina Thaina changed the title How can we reuse editor of another language in a file of another How can we reuse editor of another language in any file Jul 26, 2016
@Thaina
Copy link
Author

Thaina commented Jul 26, 2016

@aeschli It might be related but my point is wider. Because what I would like is not only in html script tag but in any arbitrary file like json, which has no tag to specified like HTML so it cannot load automatically

Is it possible to open sub editor, like peek, but reuse another language server? Or you plan to enable ability to switch language on specific lines?

I would like to make an extension so I want some workaround of this, it not need to be automatically like js in html, but that's all I need

If it not in the scope of html tag then I would like you to reopen this as feature request

@aeschli
Copy link
Contributor

aeschli commented Jul 26, 2016

Is it possible to open sub editor, like peek, but reuse another language server? Or you plan to enable ability to switch language on specific lines?

I didn't think of this, I think that would make a nice extension idea. My guess is that this is useful for an occasional edit in an embedded language, but will be cumbersome after a while, as it invokes a manual setup.
IMO, you want the embedding language to understand what the embedded languages are and automatically enable these. That's what we're heading for in HTML and what could be also be done in JSON if for example the schema or the tokenizer gives additional context.

But feel free to reopen and maybe make the issue description more specific. I don't see a generic solution to this solving all embedded language problems in one go. The more general the issue is formulated, the more difficult it will be to really come to a solution.

@Thaina
Copy link
Author

Thaina commented Jul 26, 2016

@aeschli I was opened issue like this because I'm not sure if the solution is already exist or there are some workaround possible

As of now it seem hard and need so long to wait for you guys implement inline embedding. So I want some other way, like a custom peek window I mention about

Or could you advise me any idea better and possible as of now?

@egamma egamma added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 26, 2016
@egamma
Copy link
Member

egamma commented Jul 26, 2016

@Thaina this is currently not supported and there is no work around.

What you are asking for are language injections as @wholroyd has pointed out above and this is a duplicate of #1751, adding the duplicate tag.

@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) *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

5 participants