Skip to content
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

Find Usages is not working with cmd + click when plugin is active #72

Closed
pySilver opened this issue Sep 18, 2024 · 12 comments
Closed

Find Usages is not working with cmd + click when plugin is active #72

pySilver opened this issue Sep 18, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@pySilver
Copy link

What happened?

This Find Usages popup is not triggered with cmd + click when plugin is active.

CleanShot 2024-09-19 at 00 05 34@2x

Steps to reproduce

Activate plugin & Try to navigate with cmd + click.

Relevant log output or stack trace

No response

Operating system

macOS

@pySilver pySilver added the bug Something isn't working label Sep 18, 2024
@InSyncWithFoo
Copy link
Owner

You are probably using LSP4IJ mode, correct? It seems that LSP4IJ always sends a textDocument/definition request on Ctrl/Cmd + Click regardless of the element's type, which is why you are simply sent to the same line when you click a function's definition. This is possibly a limitation rather than a bug (could you confirm, @angelozerr?).

I believe you are supposed to use the LSP Reference(s) action instead (right click menu → Go To):

Let me know if that works for you.

@InSyncWithFoo InSyncWithFoo closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
@angelozerr
Copy link

This is possibly a limitation rather than a bug (could you confirm, @angelozerr?).

I confirm that. As you said Ctrl+Click consumes textDocument/definition which is a commons usecase for any language server.

It could be doable to consumes other LSP request like textDocument/typeDefinition, textDocument/declaration, textDocument/reference but according language server some LSP requets could be slow (ex : textDocument/reference). It is an another LSP API usecase to customize that,please create an issue in LSP4IJ.

@InSyncWithFoo
Copy link
Owner

I'm actually fine with /definition as the default, so I'm not filing an issue. It seems too niche a feature anyway.

@pySilver
Copy link
Author

@InSyncWithFoo yep, exactly I'm using LSP4IJ mode. It's just a lifelong habit to use this shortcut for me. So yeah, kinda hard to switch. I'm also a little bit confused with your second plugin which get updates but marked as "will be merged with pyright-for-pycharm soon". Which one should I use giving that I use paid PyCharm? The other one uses language server and seems to support cmd+click fine.

@InSyncWithFoo
Copy link
Owner

I will be working on merging them next week; the other one's last release was to fix a major bug that was blocking the merge. Ideally, the new one (this one) will migrate all existing configurations and retain previous functionalities, so now you can really just pick whatever work for you.

@angelozerr
Copy link

The other one uses language server and seems to support cmd+click fine.

You mean that with the LSP support from Jetbrains, cmd+click open references? @InSyncWithFoo can you confirm that please (I cannot test since I have no license for Ultimate)

If it is working, @InSyncWithFoo I think LSP4IJ should provide to customize this cmd+click (by defualt just definition), but you could customize it to have reference too,please create an issue in LSP4IJ.

@InSyncWithFoo
Copy link
Owner

InSyncWithFoo commented Sep 20, 2024

@angelozerr The native LSP also triggers textDocument/definition when the definition is clicked. I guess the panel is that of the native finder. On the other hand, go-to-definition is already known to be non-functional.

@pySilver
Copy link
Author

@angelozerr I believe it is lsp support from jetbrains as it does not require any additional plugins (LSP4IJ)

@angelozerr
Copy link

LSP support from Jetbrains is not free and it is not available for IJ Community, it is one reason why we have created LSP4IJ

@pySilver
Copy link
Author

@angelozerr Understood.

@InSyncWithFoo Just wanted to confirm that this plugin does not trigger usage window in either console or LSP4IJ modes. (Unlike it's sister plugin). Both shortcuts (Find Usages Popup: cmd + opt + f7) and (Go to LSP References opt + cmd + H) works but aren't triggered with cmd + click.

@InSyncWithFoo
Copy link
Owner

InSyncWithFoo commented Sep 20, 2024

@pySilver I don't think so. Command line mode should never interfere with Find Usages or similar features. At least on my machine, Ctrl + Click triggers the native panel just fine.

@pySilver
Copy link
Author

@InSyncWithFoo hm. I've tested once again and yes I can confirm that in command line mode find usages panel works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants