-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[MonacoEditorReactComp] hover + ctrl triggers weird go to definitions #644
Comments
Hi @Stainless2k thanks for reporting this. just a quick hint for now, but maybe it already is a good hin. You can overwrite the |
See also this example implementation from the monaco-vscode-api repo. |
While we could override the whole service, it's not really a satisfying solution here. |
@Stainless2k is that file you are hovering over already know to the languageserver? I mean before opening. If not, something like this could help. I just updated the example and pushed the change. You use the vscode api to open a file and this will automatically announced to the language server. This way you don't have to open it in the editor beforehand (= hopefully fixing the hovering issue). |
The file is know to the server, the files are even on the server in our case. When the client request a file it just gets the text and connects to py-lsp basically. But that's beside the point here, our issue is that for some reason Ctrl + hover does not use the custom open logic. Using go to definition works, when using anything else then Ctrl + hover. Ctrl + hover is not even suppose to do any thing, we couldn't find any docs or code about Ctrl + hover. Because of this we assume this problem originates somewhere in the wrapper |
@Stainless2k ok, I need to dig into this / your example. I don't have a good answer right now and a bit of time (it won't be today). It is very likely there is an unknown bug. |
@Stainless2k I just released new versions. Major version, because of breaking API enhancements, please check the wrapper CHANGELOG and react comp CHANGELOG. |
Might not be a helpful comment, but I'm also just here searching for a way to disable |
In our App we use MonacoEditorReactComp, python-lsp-server and all code files are on a server. So we register our own
openCodeEditor()
to handle go to definitions, since the client cant access the file system of the server.This work fine when using the context menu or keybindings, but for some reason when hovering and pressing ctrl (just those 2 no clicking), it triggers a regular go to definitions request (checked debug log of python-lsp-server), which also generates a regular response. But then for some reason Monaco ignores the registered
openCodeEditor()
and tries to open the file, which causes and error. Also important here that the request/response here is exactly the same as using the context menu for example, so I assume its not a python-lsp-server problem.After a lot of googling and trying to disable this 'shortcut', but I couldn't find a hover + ctrl shortcut any were. (pretty sure now it is not a official shortcut)
I did found an old issue in the monaco repo that seemed similar, but the author noticed it was their fault and closed it without explaining how they fixed it...
I created a minimal repo and could reproduce the problem, so I assume MonacoEditorReactComp or the wrapper might be the cause.
In this video this is the
openCodeEditor()
gotoerror.mp4
Debug output when using the context menu
Debug output when hovering and pressing ctrl
The text was updated successfully, but these errors were encountered: