idaholab / moose-language-support

MOOSE language support for VSCode
Other
5 stars 4 forks source link

Feature Request: Specify Comment Character #5

Closed maxnezdyur closed 2 years ago

maxnezdyur commented 2 years ago

VS code doesn't know the comment character for the file. This keeps me from highlighting a block of code and commenting it all out. It is possible for me to fix this on my settings and add the comment character for .i files, but I think this would be useful in general for this extension.

maxnezdyur commented 2 years ago

I haven't ever written an extension, but I may try to implement this later. The resource I found for this is here. https://code.visualstudio.com/api/language-extensions/language-configuration-guide This would also allow one to setup auto-closing brackets.

dschwen commented 2 years ago

Oh yeah, this would be nice. We're currently also missing Auto indent, which the atom language extension had as part of the syntax highlight file. That was lost in conversion and apparently is configured in a different file in vscode.

maxnezdyur commented 2 years ago

I believe auto indent is also configured in the link I sent. Here is a snippet

  "indentationRules": {
    "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
    "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$"
  }

It seems easier than I thought it would be to implement, I might have to pull your repo later and add other things that come to my mind.