microsoft / microsoft/monaco-editor

[Bug] Typescript language behavior is different between bundled and unbundled languages

Open
#4,543 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html#XQAAAAIfAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscqGH5RyQ0Ub9fiTV5VMcv2qhdKPTksaiP9MYo8AFCjMKjWah_AECv_TK1on9_5iJc8TE0AKDQUDooYuhiYzH2PW2-IRtpzmpSm17TyTpeS1-K401E3S9BSIBiplGpBqkFNQWTd1og95tc06Bl-jiGPt7--GDvmXntYcN4t8Q9Zf8q4PCGSQaVGkzsdDjivA-vJ11_xtT0TsX1AYSoM4teaXfon8QJtB4H7OuQA

Monaco Editor Playground Code
monaco.editor.create(document.getElementById('container'), {
	value: `const test: Foo = {}`,
	language: 'typescript'
});

monaco.languages.typescript.typescriptDefaults.addExtraLib(
    `interface Foo { bar: string }`,
);
Reproduction Steps

Compare the problem detection when using "Load Latest Languages" and "Load Latest Languages From Source" in the settings menu.

Actual (Problematic) Behavior

When "Load Latest Languages" is selected, there is an error in the declaration of test. When the languages are loaded from source, there is no error shown.

https://github.com/microsoft/monaco-editor/assets/4761903/9658571b-dba0-45fc-813a-bb8b1ec6c941

Expected Behavior

I would expect a behavior to be the same between builds

Additional Context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked Monaco Editor playground and reproduce the TypeScript declaration with both “Load Latest Languages” and “Load Latest Languages From Source” settings. Trace the language-loading paths used by those two options and compare their problem detection; done means both builds report the same result for the provided Foo declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.