From bb37dfb5b79c0e5ae18d34f01313cb1f39d7a2dd Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 22 May 2023 21:28:36 -0400 Subject: 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 --- cli/npm/installer.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/npm/installer.rs') 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> { -- cgit v1.2.3