You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently encountered an issue whilst using the ‘rename symbol’ feature on Monaco Editor. The problem arises specifically when trying to rename symbols for files that have not been opened. In this scenario, an error returns stating 'bad edit - model not found’.
As I understand it, the issue stems from the fact that Monaco does not create a model for unopened files. As a result, it can’t apply an edit. This process seems to work fine for opened files as I am able to rename symbols without any issues.
My question is - what would be the best way to handle changes to unopened files? Is there a way to create a model for files that haven’t been opened yet or is there an alternative solution for dealing with this situation?
Any assistance or guidance on this matter would be greatly appreciated.
Thank you for your time and consideration.
Expected Behavior
No error will be reported and is there any way to change a file that is not open.
This discussion was converted from issue #4182 on October 05, 2023 10:07.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Link
No response
Monaco Editor Playground Code
No response
Reproduction Steps
No response
Actual (Problematic) Behavior
I recently encountered an issue whilst using the ‘rename symbol’ feature on Monaco Editor. The problem arises specifically when trying to rename symbols for files that have not been opened. In this scenario, an error returns stating 'bad edit - model not found’.
As I understand it, the issue stems from the fact that Monaco does not create a model for unopened files. As a result, it can’t apply an edit. This process seems to work fine for opened files as I am able to rename symbols without any issues.
My question is - what would be the best way to handle changes to unopened files? Is there a way to create a model for files that haven’t been opened yet or is there an alternative solution for dealing with this situation?
Any assistance or guidance on this matter would be greatly appreciated.
Thank you for your time and consideration.
Expected Behavior
No error will be reported and is there any way to change a file that is not open.
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions