microsoft / microsoft/monaco-editor

[Bug] Repeated Quick Fixes

Open
#4,577 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?source=v0.50.0#XQAAAAIWAgAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0fINSAEiAKctgAboa7AaZZDHLgrLqPRv_fRv2RyIokydlTdTYccsu6v6jDrc8jQ8ulrCVzjWBVWZVl-YrARXWjHEENNCrQ2qKhRtPpGiVCLaF6X2KlhMzX85uAfntats9JnRhU1YrXtzHc0TsF8K9lOFiGXCcg8ECAIWYz4JECTeKHJFAUolkK_9nTl9EDKklIypZPHFbxiXSPY5AKW5Q_7js42fH5HC1v7w82HAB4rgeC_7qn0mJuce9AfcucC_sBZpbdaMQ4fwveYX8uzVB-PewBNcspiR1a8cW1ktAvXYT5HFsxM8r-aY2qAbhMNWCj2t0dQZKzy0yVLQw30IUcAt5892hkXjyRsDUaNW6DeBa243ts9KgM2ulIGqWx4OvWKcfd8kMdhxFd8aIBc_gojzVW76frfnS1TRUGhmRtsQevdV_y1bWQA

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
	// let x = null;// uncomment this line === problem goes away
	return;
	x; 
}`;

monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
	allowJs: true,
	allowNonTsExtensions: true,
	allowUnreachableCode: false,
	checkJs: true,
})


// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "typescript",
});
Reproduction Steps
  • Hover over quick highlighted error on line 4
  • Select "Quick Fix..."
  • Observe repeated fixes:
    image
Actual (Problematic) Behavior

The "Ignore this error message" and "Disable checking for this file" quick fixes are repeated.

Expected Behavior

The "Ignore this error message" and "Disable checking for this file" quick fixes are not repeated.

Additional Context

The unreachable code must contain an undefined reference -- if the ref after the return is defined, the problem goes away.

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

Start with the linked Monaco Editor Playground and the TypeScript code shown in the issue. Reproduce the unreachable-code warning, hover it, and open “Quick Fix...” to inspect the repeated actions. Done means “Ignore this error message” and “Disable checking for this file” each appear only once.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.