diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-02-24 00:21:09 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-24 00:21:09 -0500 |
| commit | 6567dc94a901aaae1b4e5b8e84d48bc72d46ee2e (patch) | |
| tree | ff3674957c66c40e9d4cc5e1fc1c04b353bf6a46 /cli/tools | |
| parent | 76e8e02bba75f23097d28cec13829c2f5cfa4a25 (diff) | |
fix(lsp): import map expansion (#22553)
Diffstat (limited to 'cli/tools')
| -rw-r--r-- | cli/tools/bundle.rs | 2 | ||||
| -rw-r--r-- | cli/tools/vendor/mod.rs | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index c0b1ce31b..0a992fcb0 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -82,7 +82,7 @@ async fn bundle_action( .collect(); if let Ok(Some(import_map_path)) = cli_options - .resolve_import_map_specifier() + .resolve_specified_import_map_specifier() .map(|ms| ms.and_then(|ref s| s.to_file_path().ok())) { paths_to_watch.push(import_map_path); diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs index f168f84a2..975cf08f1 100644 --- a/cli/tools/vendor/mod.rs +++ b/cli/tools/vendor/mod.rs @@ -173,9 +173,24 @@ fn validate_options( options: &mut CliOptions, output_dir: &Path, ) -> Result<(), AnyError> { + let import_map_specifier = options + .resolve_specified_import_map_specifier()? + .or_else(|| { + let config_file = options.maybe_config_file().as_ref()?; + config_file + .to_import_map_specifier() + .ok() + .flatten() + .or_else(|| { + if config_file.is_an_import_map() { + Some(config_file.specifier.clone()) + } else { + None + } + }) + }); // check the import map - if let Some(import_map_path) = options - .resolve_import_map_specifier()? + if let Some(import_map_path) = import_map_specifier .and_then(|p| specifier_to_file_path(&p).ok()) .and_then(|p| canonicalize_path(&p).ok()) { |
