microsoft / microsoft/monaco-editor
goto definition doesn't work for symbols in extraLibs with scheme+hostname in url
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
monaco-editor version: 0.13.1
Browser: Chrome
OS: win10
i'm adding external libs like this:
libs.forEach((lib, i: number) => {
monaco.languages.typescript.javascriptDefaults.addExtraLib(lib.text, lib.url);
monaco.editor.createModel(lib.text, "typescript", monaco.Uri.parse(lib.url));
});
however, if the libs' urls are absolute urls (http://...) , then, for symbols defined in those libs (eg keyCode, below):
-
the hover tool works fine (it shows the type & comment defined in the extraLib):

-
goto-definition doesn't work (does nothing),
-
peek definition shows the peek popup, with the correct extraLib filename & path, but the contents are the file that was right-clicked on:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report in Chrome with monaco.languages.typescript.javascriptDefaults.addExtraLib and monaco.editor.createModel using an absolute http URL. Trace how these entry points resolve the extraLib URI for goto-definition and peek definition. Done means goto-definition opens the correct extraLib location and peek definition displays its contents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100