diff --git a/src/anchor/entryAnchor.ts b/src/anchor/entryAnchor.ts index eaf27b2..6d7fcbb 100644 --- a/src/anchor/entryAnchor.ts +++ b/src/anchor/entryAnchor.ts @@ -86,8 +86,7 @@ export default class EntryAnchor extends EntryBase { public decorateDocument(document: TextDocument, options: DecorationOptions[]): void { options.push({ - hoverMessage: "Comment Anchor: " + this.anchorText, - range: this.getAnchorRange(document, false), + range: this.getAnchorRange(document, false) }); } diff --git a/src/anchorListView.ts b/src/anchorListView.ts index 00b6116..d5d6de4 100644 --- a/src/anchorListView.ts +++ b/src/anchorListView.ts @@ -11,7 +11,6 @@ export function createViewContent(engine: AnchorEngine, webview: Webview): strin let tagList = ""; for (const tag of engine.tags.values()) { - const isDefault = tag.iconColor == "default"; const tagFlags = []; let tagStyle = ""; diff --git a/src/util/linkProvider.ts b/src/util/linkProvider.ts index 3324c64..d8f94bc 100644 --- a/src/util/linkProvider.ts +++ b/src/util/linkProvider.ts @@ -36,13 +36,15 @@ export class LinkProvider implements DocumentLinkProvider { const workspacePath = workspace.getWorkspaceFolder(document.uri)?.uri?.fsPath ?? ""; const tasks: Promise[] = []; - for (const anchor of flattened + const flattenedLinks = flattened .filter((anchor) => { const tagId = anchor.anchorTag; const tag = this.engine.tags.get(tagId); return tag?.behavior == "link"; - })) { + }); + + for (const anchor of flattenedLinks) { const components = LINK_REGEX.exec(anchor.anchorText)!; const parameter = components[3] || ''; const filePath = components[2] || document?.uri?.fsPath || ''; @@ -73,9 +75,10 @@ export class LinkProvider implements DocumentLinkProvider { const flattened = flattenAnchors(anchors); let targetLine = 0; - for (const anchor of flattened) { - if (anchor.attributes.id == targetId) { - targetLine = anchor.lineNumber; + for (const otherAnchor of flattened) { + if (otherAnchor.attributes.id == targetId) { + targetLine = otherAnchor.lineNumber; + break; } }