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

Code formatting for multiple languages in one file #14447

Closed
jnessier opened this issue Oct 25, 2016 · 2 comments
Closed

Code formatting for multiple languages in one file #14447

jnessier opened this issue Oct 25, 2016 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality formatting Source formatter issues
Milestone

Comments

@jnessier
Copy link

Hi,

this is a feature request and not an issue.

Please give code formatting for multiple languages in one file. As example: If you are having HTML and PHP code in a php-file, then you won't get formatted HTML code and you have to format your HTML code manually.

As solution, it would be nice to associate a extension to multiple languages in the settings:
"files.associations": { "*.php": ["php", "html"] }

Thanks and best regards!

@weinand weinand added the feature-request Request for new features or functionality label Oct 25, 2016
@jrieken
Copy link
Member

jrieken commented Oct 25, 2016

This is the nested mode story - unsure where @aeschli and @alexandrudima will eventually land on this but work has already started

@aeschli aeschli added this to the Backlog milestone Oct 26, 2016
@jrieken jrieken added the formatting Source formatter issues label Oct 26, 2016
@aeschli
Copy link
Contributor

aeschli commented Nov 24, 2016

The current story is that for a PHP file, the PHP formatter has to deal with the html content and format it.
Generic solutions are difficult and will result in bugs due to lack of understanding on how the two languages play together. Can the embedded content be indented? Can new lines be added? Most of the time only the main language has an understanding of that.

So if you miss html formatting in PHP, file an issue against the provider of the PHP formatter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality formatting Source formatter issues
Projects
None yet
Development

No branches or pull requests

5 participants