GithubHelp home page GithubHelp logo

Comments (15)

JPinkney avatar JPinkney commented on August 10, 2024 3

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

from vscode-yaml.

JPinkney avatar JPinkney commented on August 10, 2024 3

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.

from vscode-yaml.

danhofer avatar danhofer commented on August 10, 2024 2

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?

from vscode-yaml.

JPinkney avatar JPinkney commented on August 10, 2024 1

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

from vscode-yaml.

marco-m avatar marco-m commented on August 10, 2024

Thanks!

from vscode-yaml.

dburles avatar dburles commented on August 10, 2024

Hey I'm on 0.0.9 and seeing the same message

from vscode-yaml.

unional avatar unional commented on August 10, 2024

Same here. No formatter in 0.0.9

from vscode-yaml.

unional avatar unional commented on August 10, 2024

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

from vscode-yaml.

danhofer avatar danhofer commented on August 10, 2024

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.

from vscode-yaml.

JPinkney avatar JPinkney commented on August 10, 2024

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?

from vscode-yaml.

JPinkney avatar JPinkney commented on August 10, 2024

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?

from vscode-yaml.

danhofer avatar danhofer commented on August 10, 2024

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

from vscode-yaml.

JPinkney avatar JPinkney commented on August 10, 2024

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

from vscode-yaml.

danhofer avatar danhofer commented on August 10, 2024

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

from vscode-yaml.

PZ01 avatar PZ01 commented on August 10, 2024

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

from vscode-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.