feat(vendor): support using an existing import map (#14836)

This commit is contained in:
David Sherret 2022-06-14 10:05:37 -04:00 committed by GitHub
parent fc3a966a2d
commit 443041c23e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1198 additions and 256 deletions

View file

@ -208,8 +208,8 @@ fn get_base_import_map_completions(
import_map: &ImportMap,
) -> Vec<lsp::CompletionItem> {
import_map
.imports_keys()
.iter()
.imports()
.keys()
.map(|key| {
// for some strange reason, keys that start with `/` get stored in the
// import map as `file:///`, and so when we pull the keys out, we need to
@ -253,7 +253,7 @@ fn get_import_map_completions(
if !text.is_empty() {
if let Some(import_map) = maybe_import_map {
let mut items = Vec::new();
for key in import_map.imports_keys() {
for key in import_map.imports().keys() {
// for some reason, the import_map stores keys that begin with `/` as
// `file:///` in its index, so we have to reverse that here
let key = if key.starts_with("file://") {