Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Go-to-definition is not triggered #29

Closed
InSyncWithFoo opened this issue Apr 26, 2024 Discussed in #26 · 3 comments
Closed

Go-to-definition is not triggered #29

InSyncWithFoo opened this issue Apr 26, 2024 Discussed in #26 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@InSyncWithFoo
Copy link
Owner

See #26.

@InSyncWithFoo InSyncWithFoo self-assigned this Apr 26, 2024
@InSyncWithFoo InSyncWithFoo added the bug Something isn't working label Apr 26, 2024
@InSyncWithFoo InSyncWithFoo changed the title Go-to definition is not triggered Go-to-definition is not triggered Apr 26, 2024
@InSyncWithFoo
Copy link
Owner Author

InSyncWithFoo commented Apr 27, 2024

It seems that PyCharm always sends a textDocument/codeAction instead of a textDocument/definition (to which Pyright always replies with {"jsonrpc":"2.0","id":"0","result":[]}):

{
	"jsonrpc": "2.0",
	"id": "0",
	"method": "textDocument/codeAction",
	"params": {
		"textDocument": {
			"uri": "file:///<project>/foo.py"
		},
		"range": {
			"start": { "line": 1, "character": 4 },
			"end": { "line": 1, "character": 4 }
		},
		"context": {
			"diagnostics": [],
			"triggerKind": 2
		}
	}
}

To me, this screams "Bug" and I would be very surprised if it isn't one.

I have asked about this on Slack. If there are no replies in a few days, I will report it to YouTrack.

@InSyncWithFoo
Copy link
Owner Author

InSyncWithFoo commented Apr 29, 2024

Upstream issue: IDEA-352715.

@InSyncWithFoo
Copy link
Owner Author

Upstream issue declined:

IntelliJ's LSP API is designed first of all to provide additional functionality, but not to replace existing functionality. The main use case for LSP-based external plugins is to add support for programming languages that are not supported natively by JetBrains IDEs.

Adding features to the programming languages supported by JetBrains IDEs is also supported by the LSP API. But in this case, some limitations may apply. These limitations are not intentional, but technical.

Like your use case. It's not that we intentionally break external plugin functionality. But it's tricky for us to make it work. And since such a use case (replacing references in Python files) is not the primary goal of the LSP API, we can't promise a fix.

@InSyncWithFoo InSyncWithFoo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant