mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
feat(lsp): support lockfile and node_modules directory (#19203)
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
This commit is contained in:
parent
5878258952
commit
bb37dfb5b7
11 changed files with 567 additions and 176 deletions
|
@ -908,10 +908,7 @@ fn diagnose_resolution(
|
|||
{
|
||||
if let Some(npm_resolver) = &snapshot.maybe_npm_resolver {
|
||||
// show diagnostics for npm package references that aren't cached
|
||||
if npm_resolver
|
||||
.resolve_pkg_id_from_pkg_req(&pkg_ref.req)
|
||||
.is_err()
|
||||
{
|
||||
if !npm_resolver.is_pkg_req_folder_cached(&pkg_ref.req) {
|
||||
diagnostics
|
||||
.push(DenoDiagnostic::NoCacheNpm(pkg_ref, specifier.clone()));
|
||||
}
|
||||
|
@ -925,10 +922,7 @@ fn diagnose_resolution(
|
|||
// check that a @types/node package exists in the resolver
|
||||
let types_node_ref =
|
||||
NpmPackageReqReference::from_str("npm:@types/node").unwrap();
|
||||
if npm_resolver
|
||||
.resolve_pkg_id_from_pkg_req(&types_node_ref.req)
|
||||
.is_err()
|
||||
{
|
||||
if !npm_resolver.is_pkg_req_folder_cached(&types_node_ref.req) {
|
||||
diagnostics.push(DenoDiagnostic::NoCacheNpm(
|
||||
types_node_ref,
|
||||
ModuleSpecifier::parse("npm:@types/node").unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue