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

Duplicate in workspace #139

Open danilort opened 2 years ago

danilort commented 2 years ago

INFO

CommentAnchors v1.9.6 (also beta 1.10.0) VSCODE v1.63.2 OS: Windows 10

Description

In the "Workspace Anchors" section I often see duplicates. It's not a big problem, but creates a bit of confusion.

immagine

Very strange.

bretonics commented 2 years ago

I have observed the same in Epic anchors. Suddenly, without a pattern I have noticed, duplicate entries for the same anchor are under Epics.

CryReaper commented 1 year ago

I am having this problem as well. On version 1.10.1 and VS code version 1.73.1.

I don't know if this is the cause, but I noticed that there is a slight difference in the path of the double entries. One starts with lowercase drive letter /c:/ and the other starts with an uppercase drive letter /C:/.

CryReaper commented 1 year ago

I also noticed I was only seeing duplicates when a file with anchors was open in the open editors window.

kboudy commented 1 year ago

just discovered this extension and LOVE it so much. wish I knew about it sooner. I have this issue as well. Hopefully these repro notes will help @danilort fix: settings.json:

  "commentAnchors.tags.anchors": {
    "ANCHOR": {
      "scope": "workspace"
    }
  }

the issue is then triggered by:

comment_anchors_issue

mfcoxo commented 1 year ago

Seems to only happen with a file with link to Anchor. If the same file has a link to a line number it doesn't duplicate the entries. The duplicate entries will also start showing up if you just focus another tab and switch back to the tab that has the link to the anchor. The actual link to anchor will only jump to the top of the file not the anchor line. Not sure if its related.

mfcoxo commented 1 year ago

The issue seems to be that by calling the getAnchors in linkProvider.ts with a newly created fileUri its triggering an add to the cache since the keys are Uri objects @JordanDi123