alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[FEATURE] - add separator above comment related to func but sitting on top of declaration #8

Closed irisida closed 3 years ago

irisida commented 3 years ago

Not idiomatic in all code guides but its not uncommon for a comment to be outside/ontop the func signature. It would be nice to be abe to have the separators include that. (configurable maybe?)

current example

// some comment text
------------------------------------
func name(sig) {
}

desired sample

------------------------------------
// some comment text
func name(sig) {
}

Given it's not correct for all languages it might be better as a boolean option or something. Anyway, thanks for reading/considering.

alefragnani commented 3 years ago

Hi @irisida ,

The extension uses the VS Code/extensions engine to detect the Symbols (Methods, Functions and Constructors). Doing so, location it uses to draw the lines, depends entirely on these engines. I don’t do any kind of parsing on the source code. And Comments, is not a SymbolKind supported by VS Code.

To support this feature, parsing is mandatory. I know a few programming languages, and I remember different syntax for comments on each of them. So, in fact, it would require a few parsers.

Hope this helps

irisida commented 3 years ago

Makes sense. Would be a big ask and add overhead and flakiness at an early evolution. closing issue.