Skip to content

Commit

Permalink
Try to fix Casing issue in uri.path between formatted diagnostics and…
Browse files Browse the repository at this point in the history
… hoverProvider #100
  • Loading branch information
yoavbls committed Apr 7, 2024
1 parent b388ac5 commit 98b5291
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions examples/errors.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup lang="ts">
import { RouterView } from "vue-router";
const x = [1, 2, 3, "4"];
function y(param: number[]) {}
y(x);
</script>
<template>
<RouterView />
</template>
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function activate(context: ExtensionContext) {
hasTsDiagnostic = true;
});

uriStore[uri.path] = items;
uriStore[uri.fsPath] = items;

if (hasTsDiagnostic) {
const editor = window.visibleTextEditors.find(
Expand Down
2 changes: 1 addition & 1 deletion src/format/embedSymbolLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function embedSymbolLinks(diagnostic: Diagnostic): Diagnostic {
...diagnostic,
message: diagnostic.message.replaceAll(
symbol,
`${symbol} <a href="${URI.parse(ref.location.uri).path}#${
`${symbol} <a href="${URI.parse(ref.location.uri).fsPath}#${
ref.location.range.start.line + 1
},${
ref.location.range.start.character + 1
Expand Down
2 changes: 1 addition & 1 deletion src/provider/hoverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { uriStore } from "./uriStore";

export const hoverProvider: HoverProvider = {
provideHover(document, position) {
const itemsInUriStore = uriStore[document.uri.path];
const itemsInUriStore = uriStore[document.uri.fsPath];

if (!itemsInUriStore) {
return null;
Expand Down

0 comments on commit 98b5291

Please sign in to comment.