Skip to content

Format code option does nothing #19

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

Closed
aga5tya opened this issue Oct 5, 2016 · 10 comments
Closed

Format code option does nothing #19

aga5tya opened this issue Oct 5, 2016 · 10 comments

Comments

@aga5tya
Copy link

aga5tya commented Oct 5, 2016

Hi, first off thank you for the wonderful php intellisense plugin.

I tried the format code option, but doesn't seem to show any effect on the file. Is there anything i am missing out on ?

Operation System: OSX
VS Code: 1.5.3
PHP Intellisense: 0.0.9

@felixfbecker
Copy link
Owner

It would help if you could show the file you are trying to format.

@aga5tya
Copy link
Author

aga5tya commented Oct 7, 2016

I tried it on a sample php files from the twig library trying to mess up the indentation. Doesn't work with that. Below is the link to a sample gist.

Link

@felixfbecker
Copy link
Owner

animation

@sunverwerth
Copy link

@aga5tya
I just tried the gist and everything worked as expected.
I have the same configuration as you, except that I am running Windows 10.

@felixfbecker
Copy link
Owner

Do you have any other PHP formatter installed?

@sunverwerth
Copy link

Did you select the text before formatting? That is a feature that is currently not supported by this plugin.

@aga5tya
Copy link
Author

aga5tya commented Oct 8, 2016

@felixfbecker I tried with a fresh copy of vs code with only intellisense plugin installed. Still does not work. Any specific logs i can share up? Are you on OSX ?

Also FYI, I am on this version of PHP.

PHP 7.0.11 (cli) (built: Oct 2 2016 00:32:27) ( NTS )

@madhed I tried both ways, not sure what is causing the issue. Let me check on a linux OS and see if it works there.

format-config

@felixfbecker
Copy link
Owner

felixfbecker commented Oct 8, 2016

Don't select the code :)

@aga5tya
Copy link
Author

aga5tya commented Oct 8, 2016

@felixfbecker Thank you! That solved it. I could not get it done earlier since some portion or variable was always highlighted in mine.

Also one more concern, formatting does not preserve empty lines.

@felixfbecker
Copy link
Owner

It currently is very opinionated about where you should have empty lines and where not
felixfbecker/php-language-server#29
felixfbecker/php-language-server#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants