microsoft / microsoft/monaco-editor

[Bug] editor.EditorZoom.setZoomLevel doesn't set the scale for lightBulb icon

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

Nobody has claimed this yet.

bug confirmed
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

Playground repro

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `function hello() {
	alert('Hello world!');
	functi abc() {
		abc = 123
		return asdf();
	}
};
`;

monaco.languages.registerCodeActionProvider("javascript", {
    provideCodeActions: (model, range, context, token) => {
        const actions = context.markers.map(error => {
            return {
                title: `My quickfix`, // Name of quickfix
                diagnostics: [error],
                kind: "abc",
                edit: {
                    edits: [
                        {
                            resource: model.uri,
                            textEdit: {
                                range: error,
                                text: "replacement text" // text to replace with
                            },
							versionId: 1
                        }
                    ]
                },
                isPreferred: true
            };
        });
        return {
            actions: actions,
            dispose: () => {}
        }
    }
});

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "javascript",
	automaticLayout: true,
	lightbulb: {
		enabled: monaco.editor.ShowLightbulbIconMode.On
	},
});

monaco.editor.EditorZoom.setZoomLevel(20)
Reproduction Steps
  • Click on the error code (functi)
  • Notice the size of the lightBulb on the left
Actual (Problematic) Behavior

image

Expected Behavior

If I don't use setZoomLevel, but instead set the zoom of the whole browser tab, the size looks correct:
image

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

Start with the Monaco Editor Playground reproduction and the monaco.editor.EditorZoom.setZoomLevel(20) entry point, then inspect how the lightbulb configuration renders the icon. Reproduce the mismatch between editor zoom and browser zoom, and verify that the lightbulb size scales correctly after using setZoomLevel.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.