microsoft / microsoft/monaco-editor

Provide configuration for deleting trigger characters after providing pop-up lists

Open
#4,329 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Context
  • This issue is not a bug report. (please use a different template for reporting a bug)
  • This issue is not a duplicate of an existing issue. (please use the search to find existing issues)
Description

I hope that after entering @, a dropdown list will pop up for selection. After selection, the @ symbol needs to be removed, similar to: selecting test from the @ dropdown, and ultimately staying in the editor is test instead of @ test

Monaco Editor Playground Link

demo

Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `@`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value: "",
	language: "sql"
});

monaco.languages.registerCompletionItemProvider('sql', {
      triggerCharacters: ['@'],
      provideCompletionItems: (model, position) => {
        let suggestions = [{label: "test", kind: "test", insertText: "test"}];
        return { suggestions };
	  }
	}
);

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 registerCompletionItemProvider call, especially triggerCharacters and provideCompletionItems. Reproduce the @ completion flow, then determine the configuration boundary for removing the trigger character and verify that selecting test leaves test rather than @ test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.