summaryrefslogtreecommitdiff
path: root/cli/npm/installer.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-05-22 21:28:36 -0400
committerGitHub <noreply@github.com>2023-05-22 21:28:36 -0400
commitbb37dfb5b79c0e5ae18d34f01313cb1f39d7a2dd (patch)
treeeed3c2a5ed443933e6809b4c9541c75b651fb38f /cli/npm/installer.rs
parent58782589528dc442e2a1fdf6d98454cbf01ac2ad (diff)
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
Diffstat (limited to 'cli/npm/installer.rs')
-rw-r--r--cli/npm/installer.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/npm/installer.rs b/cli/npm/installer.rs
index 8590feb9c..adb4344ee 100644
--- a/cli/npm/installer.rs
+++ b/cli/npm/installer.rs
@@ -64,6 +64,12 @@ impl PackageJsonDepsInstaller {
}))
}
+ /// Creates an installer that never installs local packages during
+ /// resolution. A top level install will be a no-op.
+ pub fn no_op() -> Self {
+ Self(None)
+ }
+
/// Installs the top level dependencies in the package.json file
/// without going through and resolving the descendant dependencies yet.
pub async fn ensure_top_level_install(&self) -> Result<(), AnyError> {