Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange key storage... #25

Open
kitsonk opened this issue Feb 8, 2022 · 2 comments
Open

Strange key storage... #25

kitsonk opened this issue Feb 8, 2022 · 2 comments

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Feb 8, 2022

Given the import map of:

{
  "imports": {
    "/~/": "./lib/"
  }
}

One would expect the keys of import maps modules to be:

vec!["/~/"]

But instead, you will get:

vec!["file:///~/"]

I am not aware of anything in the spec that requires it to be that way, but I might be wrong.

@dsherret
Copy link
Member

dsherret commented Jun 1, 2022

@kitsonk I looked into this a bit and it's resolved from the base url. So if the base url of the import map is https://deno.land then it will resolve as https://deno.land/~/.

I think this code probably needs to be updated to instead strip the base url? https://github.com/denoland/deno/blob/7eee521199e9735ab7c347d99e9d90ba3046be1a/cli/lsp/completions.rs#L257-L263 Edit: actually, it looks like it can just use the key there?

@dsherret
Copy link
Member

dsherret commented Jun 2, 2022

In #31 I'm making it so the raw key and values are stored internally. Maybe it would be useful here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants