bitwisecook / vscode-tcl

Tcl for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=bitwisecook.tcl
MIT License
39 stars 19 forks source link

Is it possible to switch off reformatting of comment lines? #5

Open telecasterer opened 3 years ago

telecasterer commented 3 years ago

I really appreciate the appearance of the Tcl code reformatting in the latest release. I inherit a lot of code from others and being able to now reformat it quicky to a sane readable format is a real plus. However, I need to stop it reformatting comments as they have a special function in the context I'm working in. Is there an option to do that? and if not could it be added please?

Thanks

maciejmatczak commented 3 years ago

Still looking for it? It's VS Code native functionality. From top of my head:

"[tcl]" {
  "editor.formatOnSave": false
}
telecasterer commented 3 years ago

Still looking for it? It's VS Code native functionality. From top of my head:

"[tcl]" {
  "editor.formatOnSave": false
}

Erm, thanks but that's got absolutley nothing to do with my question. As I explained I want to be able to stop the formatter formatting comments.

maciejmatczak commented 3 years ago

Oh man, sorry.

And your request is pretty important, any 3rd party utility utilizing comments would have that problem...

I fast read through it and assumed you had problem with just auto formatting. This plugin currently destroys almost every script I try to format ;)

bitwisecook commented 1 year ago

there is no such command to do so, you'd want to add something around here:

https://github.com/bitwisecook/vscode-tcl/blob/master/src/formatProvider.ts#L53 https://github.com/bitwisecook/vscode-tcl/blob/master/src/extension.ts#L29

you'll need to add a configuration to hold what you want to do, like:

https://github.com/bitwisecook/vscode-iRule/blob/master/package.json#L46-L55

and use it like:

https://github.com/bitwisecook/vscode-iRule/blob/master/src/diagnosticsProvider.ts#L193

I'm happy to receive pull requests for such things