Skip to content

Commit

Permalink
change: remove useless hover text
Browse files Browse the repository at this point in the history
closes #208
  • Loading branch information
macjuul committed Jan 19, 2024
1 parent fc628fd commit 15a25ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/anchor/entryAnchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
}

Expand Down
1 change: 0 additions & 1 deletion src/anchorListView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down
13 changes: 8 additions & 5 deletions src/util/linkProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ export class LinkProvider implements DocumentLinkProvider {
const workspacePath = workspace.getWorkspaceFolder(document.uri)?.uri?.fsPath ?? "";
const tasks: Promise<unknown>[] = [];

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 || '';
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 15a25ab

Please sign in to comment.