StarlaneStudios / vscode-comment-anchors

⚓A Visual Studio Code extension that adds support for comment anchors 🔭
https://marketplace.visualstudio.com/items?itemName=ExodiusStudios.comment-anchors
MIT License
206 stars 32 forks source link

[Feature request] Less false anchors #138

Closed danilort closed 2 years ago

danilort commented 2 years ago

This is a beautiful extension, but there is a problem: many false anchors are found.

immagine

You should limit the characters that are allowed around the text string. It would be very useful to be able to define the allowed characters.

My suggestion

matchBefore

"commentAnchors.tags.matchBefore": [
    " ",
    "//"
],
// ANCHOR this is an anchor
//ANCHOR this is an anchor
// NEXT-ANCHOR this is not an anchor
//anytext "ANCHOR" this is not an anchor
// AAA/ANCHOR/BBB this is not an anchor

matchAfter

"commentAnchors.tags.matchAfter": [
    " ",
    ":"
],
//ANCHOR this is an anchor
//ANCHOR: this is an anchor
//ANCHOR_TYPE this is not an anchor
//ANCHOR.TYPE this is not an anchor
//ANCHOR123 this is not an anchor

My config

CommentAnchors v1.9.6 VSCODE v1.63.2 OS: Windows 10

macjuul commented 2 years ago

Hello and thanks for your issue!

Since this specific issue has received lots of attention recently, any further discussion on the topic will be consolidated into #116