Nasller / CodeGlancePro

Minimap run on jetbrains platform.
Apache License 2.0
201 stars 22 forks source link

[Feature Request] Add support for region comment #135

Closed paulverbeke closed 2 months ago

paulverbeke commented 2 months ago

Hi,

Would you be opened to implement or accept a PR to support for dotnet #region like VS Code ? image

I suppose we only need to change the default value of the Mark regex ?

Thanks

Nasller commented 2 months ago

sure,i can accept a PR to support it.

paulverbeke commented 2 months ago

Does your current regex only applies in comments ?

Nasller commented 2 months ago

yes,sir

paulverbeke commented 2 months ago

So I've made a simple PR to update the default regex to handle region comment (like requested in #79) but I suppose adding support for #region in C# will be harder because it is not a comment. Any hints to guide me in the good direction ? I'm not a kotlin dev 😅

Nasller commented 2 months ago

I guess we need to find its specific type in the parse tree.The type of comment in the parse tree is com.intellij.psi.PsiComment. You can try use psiViewer plugin to find it. Parsing it requires great caution as this class is executed very frequently com.nasller.codeglance.extensions.visitor.MarkCommentVisitor