microsoft / microsoft/monaco-editor

[Bug] if I give autosurround: 'never' then also Auto closing is working for single/double quotes and brackets.

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

Nobody has claimed this yet.

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

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.0#XQAAAALfAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw0IbSd6DddtbtyhsOtw_oZuoS-bntDRvUjkOwcRtcHNwKoOpD9hqF1FLGw7nCYILel2Pa8v_zJ3fSGF5dVzmbj45xm9DS0quUH1uxuaQU24y-oAPDTLzxqJeKkU_Qc4LN3ULI6giUCwUphU9HOcDeEB_tnQva_ciLQazSgNMjiIV7WjXkR73AWJvrb81783raw0l7Wnlkfs6WfLLJ-n-1FSrYqwSh6NQ1VCCR9K4ukCkqFY4Z9ayoYIUTvscXW5ox71CpzVnofjlMRNe6P6YoOJfWxFSB5JBEfF9NKA-8xBGukre0FIkinZLtNpPOPr1rZ0QGyKpmdE8CF7OUiaed_fXQdzYLpQTuXZSm1AYdSF68Tx58S-Xe2jmMveIbIZN3l7MPOuQA1gfJMAk8M_76N-I

Monaco Editor Playground Code

const value = /* set from myEditor.getModel(): */ `function hello() {
alert('Hello world!');

}
`;

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

myEditor.updateOptions({
	autoSurround: 'never',
	// autoClosingQuotes: 'never'
})
Reproduction Steps

Add option autoSurround: 'never'.
Check autoSurround is working for single/double quotes and brackets.

Actual (Problematic) Behavior

autoSurround is working for single/double quotes and brackets.

Expected Behavior

autoSurround should not working for single/double quotes and brackets.

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 linked Monaco Editor Playground and its JavaScript reproduction, focusing on the autoSurround option and the commented autoClosingQuotes option. Verify the behavior for single and double quotes and brackets, then confirm that autoSurround: 'never' prevents automatic closing in all three cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.