vscode-tcl icon indicating copy to clipboard operation
vscode-tcl copied to clipboard

Is it possible to switch off reformatting of comment lines?

Open telecasterer opened this issue 4 years ago • 4 comments

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

telecasterer avatar Jan 19 '21 14:01 telecasterer

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

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

maciejmatczak avatar Mar 01 '21 20:03 maciejmatczak

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.

telecasterer avatar Mar 02 '21 12:03 telecasterer

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 ;)

maciejmatczak avatar Mar 02 '21 12:03 maciejmatczak

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

bitwisecook avatar Nov 13 '22 12:11 bitwisecook