microsoft / microsoft/monaco-editor
[Bug] Rename popup for JS/TS private members does not include the `#` character
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?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `class Foo {
#test() {
}
}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "javascript",
automaticLayout: true,
});
Reproduction Steps
Put the cursor on the method name #test and press F2 to rename
Actual (Problematic) Behavior
The # is not included in the popup text field, which means after the rename the method/field might be accidentally made public if you forget to add the # back.
Expected Behavior
The # is included in the text field like in VSCode:
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Monaco Editor Playground reproduction and the F2 rename entry point for the JavaScript class containing #test. Trace how the rename popup text is populated for private members, then verify that the field retains the # and that renaming does not make the member public.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100