diff --git a/CHANGELOG.md b/CHANGELOG.md index dd06b7b..ef279d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [Unreleased] +### Fixed +- Windows url detection + ## [1.1.1] - 2023-01-03 ### Fixed diff --git a/server/package.json b/server/package.json index 57db637..6d5bfc5 100644 --- a/server/package.json +++ b/server/package.json @@ -8,6 +8,7 @@ "dependencies": { "vscode-languageserver": "^8.0.2", "vscode-languageserver-textdocument": "^1.0.7", + "vscode-uri": "^3.0.7", "web-tree-sitter": "^0.20.5" }, "devDependencies": { diff --git a/server/src/features/depsIndex.ts b/server/src/features/depsIndex.ts index 918173f..87383a1 100644 --- a/server/src/features/depsIndex.ts +++ b/server/src/features/depsIndex.ts @@ -3,12 +3,12 @@ import * as Parser from 'web-tree-sitter'; import { DocumentStore } from '../documentStore'; import { queryDirectives } from '../queries/directives'; import { Trees } from '../trees'; -import { normalize as normalizePath } from 'path'; +import { Utils, URI } from 'vscode-uri'; function resolvePathSegment(documentUri: string, path: string) { let result = documentUri.split('/').slice(0, -1).join('/').substring('file://'.length); - return 'file://' + normalizePath(result + '/' + path); + return Utils.joinPath(URI.parse(result), '/', path).toString(); } export class DepsIndex { diff --git a/server/yarn.lock b/server/yarn.lock index 0892e36..6030acf 100644 --- a/server/yarn.lock +++ b/server/yarn.lock @@ -1761,7 +1761,7 @@ __metadata: "fsevents@patch:fsevents@^2.3.2#~builtin": version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7" + resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" dependencies: node-gyp: latest conditions: os=darwin @@ -3376,7 +3376,7 @@ __metadata: "resolve@patch:resolve@^1.20.0#~builtin": version: 1.22.1 - resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b" + resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" dependencies: is-core-module: ^2.9.0 path-parse: ^1.0.7 @@ -3466,6 +3466,7 @@ __metadata: typescript: ^4.6.3 vscode-languageserver: ^8.0.2 vscode-languageserver-textdocument: ^1.0.7 + vscode-uri: ^3.0.7 web-tree-sitter: ^0.20.5 languageName: unknown linkType: soft @@ -3865,11 +3866,11 @@ __metadata: "typescript@patch:typescript@^4.6.3#~builtin": version: 4.8.2 - resolution: "typescript@patch:typescript@npm%3A4.8.2#~builtin::version=4.8.2&hash=f456af" + resolution: "typescript@patch:typescript@npm%3A4.8.2#~builtin::version=4.8.2&hash=3b564f" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 6f49363af8af2fe480da1d5fa68712644438785208b06690a3cbe5e7365fd652c3a0f1e587bc8684d78fb69de3dde4de185c0bad7bb4f3664ddfc813ce8caad6 + checksum: 28e130a49d9330b64b8229ad336247bf980e9a705c5850f30a859a68c051e8e68e367b3275f119da4a825dca71ad0fe315964a1315d4a381c0021bca5eeeb62e languageName: node linkType: hard @@ -3982,6 +3983,13 @@ __metadata: languageName: node linkType: hard +"vscode-uri@npm:^3.0.7": + version: 3.0.7 + resolution: "vscode-uri@npm:3.0.7" + checksum: c899a0334f9f6ba53021328e083f6307978c09b94407d7e5fe86fcd8fcb8f1da0cb344123a335e55769055007a46d51aff83f9ee1dfc0296ee54b78f34ef0e4f + languageName: node + linkType: hard + "w3c-hr-time@npm:^1.0.2": version: 1.0.2 resolution: "w3c-hr-time@npm:1.0.2"