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

Feature request: formatter #64

Closed
marco-m opened this issue Feb 9, 2018 · 15 comments
Closed

Feature request: formatter #64

marco-m opened this issue Feb 9, 2018 · 15 comments

Comments

@marco-m
Copy link

marco-m commented Feb 9, 2018

Hello,
if I select "Format document", vscode pops up "Sorry, but there is no formatter for 'yaml'-files installed."
It would be nice if this extension supported formatting :-)

@JPinkney
Copy link
Contributor

The formatter should be available in our latest update! The code was in it server side for a while I just didn't update some vscode extension dependencies so it wasn't showing up

@marco-m
Copy link
Author

marco-m commented Feb 13, 2018

Thanks!

@dburles
Copy link

dburles commented Feb 16, 2018

Hey I'm on 0.0.9 and seeing the same message

@unional
Copy link

unional commented Mar 3, 2018

Same here. No formatter in 0.0.9

@JPinkney
Copy link
Contributor

JPinkney commented Mar 3, 2018

Have you turned on the formatter in the yaml settings? It’s not enabled by default. After it’s enabled it requires a restart.

@unional
Copy link

unional commented Mar 3, 2018

I see. Yes, it is working with the settings enabled.

@danhofer
Copy link

danhofer commented May 1, 2018

I've enabled the formatter and restarted VS Code, yet I still get the message that there is no formatter. I'm on version 0.0.11. Tried uninstalling and re-installing the extension, too.

@JPinkney
Copy link
Contributor

JPinkney commented May 1, 2018

It seems to work fine for me on latest version. Are you accidentally using https://marketplace.visualstudio.com/items?itemName=adamvoss.yaml instead of https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml or do you have any other yaml extensions activated?

@danhofer
Copy link

danhofer commented May 2, 2018

The only other extensions I have installed besides this one are a Python extension and an ESLint extension. I've enabled "yaml.format.enable": true in my user settings. I'm assuming I can format code by highlighting what I want to format and pressing cmd-K-F like I can for JavaScript. Is that correct, or am I misunderstanding?

@JPinkney
Copy link
Contributor

JPinkney commented May 2, 2018

Currently it just formats the entire document. If you right click on a yaml file is the format document option there? Which version of vscode are you using?

@danhofer
Copy link

danhofer commented May 2, 2018

I'm on VS Code version 1.22.2. When the file is open in the file explorer this is my menu when I right click. Right clicking on a closed file has a menu with less options.
menu

@JPinkney
Copy link
Contributor

JPinkney commented May 2, 2018

No, I mean when you have a yaml file open and you right click inside the text editor. This is what I see.
screenshot from 2018-05-02 10-39-24

@danhofer
Copy link

danhofer commented May 2, 2018

Ah yes, I see it. When I click the menu option it works. Thank you very much!

@PZ01
Copy link

PZ01 commented Sep 25, 2018

Any reason why the format removes comments?(Statements starting with a hash #)

@JPinkney
Copy link
Contributor

The parser does not support comments so when formatting it it just removed it. I’m switching formatters soon and that will fix the problem.

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

6 participants