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

Open
#3,468 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start at the public monaco.languages.Command interface linked in the issue and inspect how the id property is declared. Update the declaration so commands without an id are represented, then verify that the generated API documentation reflects the optional typing; no test file is named.

Written by the indexing model from the issue text.

Description

editor-core feature-request help wanted
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.

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

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.

More from microsoft/monaco-editor

All issues in microsoft/monaco-editor

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.