Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
refactor: normalize file path
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Mar 4, 2020
1 parent 8191668 commit 62dcb5e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/tree_view_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "vscode";
import { Extension } from "./extension";

import { str2regexpStr } from "../../core/util";
import { str2regexpStr, normalizeFilepath } from "../../core/util";
import { Position } from "../../core/deno_deps";
import { Disposable } from "vscode-languageclient";

Expand Down Expand Up @@ -142,10 +142,11 @@ export class TreeViewProvider implements TreeDataProvider<Item> {
return [];
}

return element.references.map(r => {
const workspaceFolderFilepath =
element.parentNode?.resourceUri?.fsPath + path.sep;
const workspaceFolderFilepath = normalizeFilepath(
element.parentNode?.resourceUri?.fsPath + path.sep
);

return element.references.map(r => {
const filename = r.filepath
.replace(
new RegExp("^" + str2regexpStr(workspaceFolderFilepath as string)),
Expand Down

0 comments on commit 62dcb5e

Please sign in to comment.