microsoft / microsoft/monaco-editor

ondidicreacteEditor callBack Can't addcommand

Open
#2,708 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

window.monaco.editor.onDidCreateEditor((editor) => {

    var commandId = editor.addCommand(monaco.KeyCode.Tab, function () {
        // services available in `ctx`
        alert('my command is executing!');

    }, '');
    console.log(88777, commandId);

});

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 onDidCreateEditor callback and editor.addCommand call shown in the issue, then check the Monaco Editor API documentation for their expected arguments. Done means the callback registers a Tab command without the reported failure; record the Monaco version and error if the problem cannot be reproduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.