Microsoft/monaco-editor

[Bug] monaco.languages.Command.id should be typed as optional

Open

#3.468 geöffnet am 18. Dez. 2022

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (1.283 Forks)batch import
editor-corefeature-requesthelp wanted

Repository-Metriken

Stars
 (14.836 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6h 26m) (15 gemergte PRs in 30 T)

Beschreibung

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 Code

// https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-codelens-provider-example

Reproduction Steps

Experiment with removing id: commandId, and notice the label is no longer clickable

Actual (Problematic) Behavior

Whether or not an id is present in the code lens command controls whether or not the label is clickable or not. Typing indicate that id is required, however: https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.Command.html.

Expected Behavior

monaco.languages.Command.id should be id?: string or id: string | undefined.

Additional Context

This came up on CompilerExplorer (https://godbolt.org) when we converted a js file to ts.

Contributor Guide