fix(lsp): include "node:" prefix for node builtin auto-imports (#27404)

This commit is contained in:
Nayeem Rahman 2024-12-17 18:55:17 +00:00 committed by David Sherret
parent 9529d2a77f
commit 28fb691f4e
3 changed files with 110 additions and 12 deletions

View file

@ -270,6 +270,10 @@ impl<'a> TsResponseImportMapper<'a> {
}
}
if specifier.scheme() == "node" {
return Some(specifier.to_string());
}
if let Some(jsr_path) = specifier.as_str().strip_prefix(jsr_url().as_str())
{
let mut segments = jsr_path.split('/');