fabiospampinato / vscode-highlight

Advanced text highlighter based on regexes. Useful for todos, annotations etc.
MIT License
169 stars 28 forks source link

Minimap support #73

Open agutenkunst opened 3 years ago

agutenkunst commented 3 years ago

I vaguely remember that the minimap also showed the highlights but at least currently for me it does not:

image

Now this could be a problem of minimap or at which point the extensions hooks into the overall system.

Any ideas?

andregreeff commented 1 year ago

I've just recent switched to this from "TODO Highlight" because this handles regex patterns in a far nicer way.. I did notice the minimap doesn't show highlights, but a few days in and I find I'm missing those a lot more than I thought I would.

tried with the minimap set to "Render Characters" as well (which I normally have turned off), but that didn't seem to help.

@fabiospampinato just wondering if you have any ideas on this one? many of the files I work on have hundreds if not thousands of lines (don't ask why, the reasons are crappy), so VSCode's minimap is a big part of "code navigation" for me.

fabiospampinato commented 1 year ago

@andregreeff I'm not quite sure. I don't see minimap-specific APIs in the docs 🤔 Maybe you can try adding overviewRulerColors (https://code.visualstudio.com/api/references/vscode-api#DecorationRenderOptions) to your decorations to see if that causes those decorations to be rendered in the minimap also. Or alternatively if markers in the overview rulers would be good enough for you.

andregreeff commented 1 year ago

@andregreeff I'm not quite sure. I don't see minimap-specific APIs in the docs 🤔 Maybe you can try adding overviewRulerColors (code.visualstudio.com/api/references/vscode-api#DecorationRenderOptions) to your decorations to see if that causes those decorations to be rendered in the minimap also. Or alternatively if markers in the overview rulers would be good enough for you.

thanks for the suggestion @fabiospampinato, but I have also gone down that rabbithole in the docs.. my current config for TODO-and-friends is as follows:

"((?:<!-- *)?(?:#|// @|//|./\\*+|<!--|--|\\* @|{!|{{!--|{{!) *TODO(?:\\s*\\([^)]+\\))?:?)((?!\\w)(?: *-->| *\\*/| *!}| *--}}| *}}|(?= *(?:[^:]//|/\\*+|<!--|@|--|{!|{{!--|{{!))|(?: +[^\\n@]*?)(?= *(?:[^:]//|/\\*+|<!--|@|--(?!>)|{!|{{!--|{{!))|(?: +[^@\\n]+)?))": {
  "filterFileRegex": ".*(?<!CHANGELOG.md)$",
  "decorations": [
    {
      "overviewRulerColor": "#ffcc00",
      "backgroundColor": "#ffcc00",
      "color": "#1f1f1f",
      "fontWeight": "bold"
    },
    {
      "backgroundColor": "#ffcc00",
      "color": "#1f1f1f"
    }
  ]
}

..with the same structure but different colours for the others. basically just the initial sample configs, but with the decorations values tweaked slightly.

I was planning to look at the source code for Wayou Liu's TODO Highlight, which is what I was using previously, just to see how the minimap stuff was implemented.. but alas, time is not my friend at the moment, so I haven't dug into that one yet.

full disclaimer: I haven't built a VSCode extension myself yet, so I am most definitely keen to get into it.. when I can. 🤷🏼‍♂️ with that said, I am still sticking with this extension though, I do prefer it over all of the ones I've tried.