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

Use default Format options in Extensions #940

Closed
kasik96 opened this issue Dec 2, 2015 · 7 comments
Closed

Use default Format options in Extensions #940

kasik96 opened this issue Dec 2, 2015 · 7 comments
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Milestone

Comments

@kasik96
Copy link

kasik96 commented Dec 2, 2015

Hi, i writing an extension to VS Code, but i dont find any way to be able use VS Code Formating on my Strings (Like HTML and JS Format separatly). Any plans to add it?

@alexdima alexdima added the feature-request Request for new features or functionality label Dec 3, 2015
@alexdima
Copy link
Member

alexdima commented Dec 3, 2015

@jrieken Would this be enabled by the commanding work?

@jrieken jrieken added the info-needed Issue requires more information from poster label Dec 3, 2015
@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

Unsure if I understand correctly. @kasik96 Do you want to be able to format a substring of a document, e.g. a string literal inside a JS file, or do you want to contribute a formatter for that targets string literals?

@kasik96
Copy link
Author

kasik96 commented Dec 3, 2015

Ok, example of my use:
I make a PHP Format, but lot of people use HTML with PHP in it. So first i use my PHP Format and after it on the same String(etc. Code i wrote) i want to use VS Code native HTML format. But i dont find any way to use VS Code HTML format on String.

On 03 Dec 2015, at 12:15, Johannes Rieken notifications@github.com wrote:

Unsure if I understand correctly. @kasik96 https://github.com/kasik96 Do you want to be able to format a substring of a document, e.g. a string literal inside a JS file, or do you want to contribute a formatter for that targets string literals?


Reply to this email directly or view it on GitHub #940 (comment).

@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

In theory with the updating release you will be able to invoke the vscode.executeFormatDocumentProvider-command to get all format edits for a given document but it will recurse it yourself again. So be cautious with that.

Despite, I believe the proper way to address this is using scopes. That is when registering your php formatter you can say: this is for php-files and the php-portion of html files with a DocumentSelector like this ['php', { language: 'html', scope: 'php.scope'}].

This issue is related (maybe a dup) of #580.

@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

Also related (maybe dup) of #719

@jrieken
Copy link
Member

jrieken commented Dec 3, 2015

@alexandrudima @aeschli Mixed modes are a topic we should figure out how to handle

@jrieken jrieken removed the info-needed Issue requires more information from poster label Dec 3, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@mjbvz mjbvz added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 8, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Nov 8, 2017

Duplicate of #14447

See this comment for more information about the issue

@mjbvz mjbvz closed this as completed Nov 8, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 24, 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

5 participants