Skip to content

Commit 2ddc0f5

Browse files
authored
Normalize URI in JSON store. Update sqlite to 10.7.0 (#188)
* Normalize URI in JSON store. Move sqlite to 10.7.0 * Remove unnecessary toString()
1 parent ce80342 commit 2ddc0f5

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

language-service/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

language-service/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@vscode/lsif-language-service",
33
"description": "LSIF based language services",
4-
"version": "0.1.0-pre.2",
4+
"version": "0.1.0-pre.3",
55
"author": "Microsoft Corporation",
66
"license": "MIT",
77
"repository": {

language-service/src/jsonStore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ export class JsonStore extends Database {
235235
}
236236

237237
private doProcessDocument(document: Document): void {
238+
// Normalize the document uri to the format used in VS Code.
239+
document.uri = URI.parse(document.uri).toString(true);
238240
const contents = document.contents !== undefined ? document.contents : 'No content provided.';
239241
this.vertices.documents.set(document.id, document);
240242
const hash = crypto.createHash('md5').update(contents).digest('base64');

language-service/src/tests/jsonTests.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,21 @@ suite('JSON Dump', async () => {
2727
assert.ok(references !== undefined);
2828
assert.strictEqual(references!.length, 10);
2929
});
30+
});
31+
32+
suite('Rust dump', async () => {
33+
let store: JsonStore;
34+
35+
setup(async () => {
36+
store = new JsonStore();
37+
await store.load(path.join(__dirname, '..', '..', 'src', 'tests', 'rust.lsif'));
38+
});
39+
40+
test('Normalized URIs', async() => {
41+
assert.strictEqual(store.getWorkspaceRoot().toString(true), 'file:///c:/fixtures/fix-test-failure/case9');
42+
const documents = store.getDocumentInfos();
43+
assert.strictEqual(documents.length, 2);
44+
assert.strictEqual(documents[0].uri, 'file:///c:/fixtures/fix-test-failure/case9/src/lib.rs');
45+
assert.strictEqual(documents[1].uri, 'file:///c:/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust/library/core/src/macros/mod.rs');
46+
});
3047
});

sqlite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"lsif-sqlite": "./bin/lsif-sqlite"
1818
},
1919
"dependencies": {
20-
"better-sqlite3": "^11.0.0",
20+
"better-sqlite3": "10.7.0",
2121
"lsif-protocol": "0.6.0-next.7",
2222
"uuid": "^10.0.0",
2323
"vscode-uri": "^3.0.8",

0 commit comments

Comments
 (0)