Skip to content

Commit

Permalink
get a few tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
machty committed Jan 8, 2025
1 parent dcbed77 commit 134a4cd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
14 changes: 2 additions & 12 deletions packages/core/src/volar/language-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,13 @@ connection.onInitialize((parameters) => {
const diagnostics = await typeScriptPlugin.provideDiagnostics!(document, token);
return filterAndAugmentDiagnostics(context, document, diagnostics);
},
async provideSemanticDiagnostics(
document: TextDocument,
token: vscode.CancellationToken,
) {
const diagnostics = await typeScriptPlugin.provideSemanticDiagnostics!(
document,
token,
);
return filterAndAugmentDiagnostics(context, document, diagnostics);
},
};
},
};
} else {
return plugin;
}
}),
{ pullModelDiagnostics: true },
);
});

Expand Down Expand Up @@ -316,7 +305,8 @@ connection.onInitialized(() => {

const extensions = ['js', 'ts', 'gjs', 'gts', 'hbs'];

server.watchFiles([`**.*.{${extensions.join(',')}}`]);
// TODO: figure out how to reinstate (and what this does exactly)
// server.watchFiles([`**.*.{${extensions.join(',')}}`]);
});

connection.listen();
Expand Down
12 changes: 11 additions & 1 deletion test-packages/test-utils/src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@ export class Project {
// '../',
// 'node_modules',
// 'typescript',
// 'lib'
// 'lib',
// ),
// },
};

// We need to construct a capabilities object that mirrors how VScode + similar editors
// will initialize the Language Server.
const capabilities = {
workspace: {
// Needed for tests that use didChangeWatchedFiles
Expand All @@ -87,6 +90,13 @@ export class Project {
},
symbols: {},
},

// This enables pull model diagnostics.
// TODO is this needed? or provided by the plugin?
// diagnosticProvider: {
// interFileDependencies: true,
// workspaceDiagnostics: false,
// },
};

await this.languageServerHandle
Expand Down
19 changes: 12 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12905,11 +12905,16 @@ semver@^7.1.3, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve
dependencies:
lru-cache "^6.0.0"

semver@^7.5.3, semver@^7.6.2:
semver@^7.5.3:
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==

semver@^7.6.2:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==

[email protected]:
version "0.18.0"
resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be"
Expand Down Expand Up @@ -14136,9 +14141,9 @@ typesafe-path@^0.2.2:
integrity sha512-OJabfkAg1WLZSqJAJ0Z6Sdt3utnbzr/jh+NAHoyWHJe8CMSy79Gm085094M9nvTPy22KzTVn5Zq5mbapCI/hPA==

typescript-auto-import-cache@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.3.tgz#45f376313d1eb0929ce47ef1d1aae5a353d060a3"
integrity sha512-ojEC7+Ci1ij9eE6hp8Jl9VUNnsEKzztktP5gtYNRMrTmfXVwA1PITYYAkpxCvvupdSYa/Re51B6KMcv1CTZEUA==
version "0.3.5"
resolved "https://registry.yarnpkg.com/typescript-auto-import-cache/-/typescript-auto-import-cache-0.3.5.tgz#402f98995037734ef3fc208180331adfd5e495fc"
integrity sha512-fAIveQKsoYj55CozUiBoj4b/7WpN0i4o74wiGY5JVUEoD0XiqDk1tJqTEjgzL2/AizKQrXxyRosSebyDzBZKjw==
dependencies:
semver "^7.3.8"

Expand Down Expand Up @@ -14500,9 +14505,9 @@ vm2@^3.9.19:
acorn-walk "^8.2.0"

[email protected]:
version "0.0.59"
resolved "https://registry.yarnpkg.com/volar-service-typescript/-/volar-service-typescript-0.0.59.tgz#9b549b3fd1e97026f0b4a9de199b39806ee02e5a"
integrity sha512-VCOpfiu+lUo5lapWLB5L5vmQGtwzmNWn5MueV915eku7blpphmE+Z7hCNcL1NApn7AetXWhiblv8ZhmUx/dGIA==
version "0.0.62"
resolved "https://registry.yarnpkg.com/volar-service-typescript/-/volar-service-typescript-0.0.62.tgz#d99c42e2e08742f27b9bb186180dac93ce730ee6"
integrity sha512-p7MPi71q7KOsH0eAbZwPBiKPp9B2+qrdHAd6VY5oTo9BUXatsOAdakTm9Yf0DUj6uWBAaOT01BSeVOPwucMV1g==
dependencies:
path-browserify "^1.0.1"
semver "^7.6.2"
Expand Down

0 comments on commit 134a4cd

Please sign in to comment.