-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to hide the constrained part completely? #17
Comments
Hi @jchnxu, I will suggest you to go with addExtraLib API, and if it is not available for python ( or language which you are using ), you have to open an issue in monaco-editor Constrained Editor doesn't modify the text model or completions part of the monaco editor, it just undos the changes done in the constrained areas based on the previously provided ranges. Hiding a block of code and then using that for autocompletion requires changes in the text model of the monaco editor. Moreover it messes with the line numbers of the code which is the base variable that Constrained editor uses for its manipulation You can also refer : microsoft/monaco-editor#45 |
Thanks @Pranomvignesh ! I think I nailed it. I did it by adding middleware to the lsp server.
This is also a problem easy to solve within 20 lines of code. Pretty happy when I thought about it. And thank you again for your excellent work. You should know that your repo helped a lot of people. I read a lot these days on posts of people needing it. |
Thanks @jchnxu |
Hi @addlistener, I have the same issue, can you share your solution to hide the restricted areas, please? 😥 |
@oceangravity There's a lot of code. The main idea is to hack the line numbers when "textDocument/didChange" and ""textDocument/didOpen". It's just a demo code, not really battle tested.
|
Use case: providing some extra handmade function for the tutorial. At the same time I also want the auto completion.
Let's say
The text was updated successfully, but these errors were encountered: