-
Notifications
You must be signed in to change notification settings - Fork 0
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
Goto definition on aliases #1462
Comments
Hey @thomasaarholt! From what I gather, you're looking to enable a "go to definition" command that, when executed with the cursor on We currently support navigation to CTEs, but this is limited to columns. Could you verify whether the navigation demonstrated in the video (going to the definition for f.id, f.name, and b.address) functions within Helix as well? I used the following SQL: WITH foo AS (
SELECT 1 AS id, 'Name1' AS name UNION ALL
SELECT 2, 'Name2'
),
bar AS (
SELECT 1 AS id, 'Address1' AS address UNION ALL
SELECT 2, 'Address2'
)
SELECT
f.id,
f.name,
b.address
FROM foo f
LEFT JOIN bar b ON f.id = b.id; reproduce.mp4 |
Hi @pgrivachev! Here's a repro of your excellent video, but in helix. I first try your suggested file, pressing Screen.Recording.2024-02-19.at.09.32.19.movI notice in
|
Actually, that line in the logs might be a red herring, and does not appear with every
edit: I think what happened with the node error is that I got blocked out of duo mobile for 15 min, since I didn't notice that my phone kept getting MFA notifications. Everything works again now. |
Hi @thomasaarholt! I also tried to reproduce the issue in helix and everything is working for columns in my case (attached the video). It is strange that go to definition doesn't work in your case. Could you please clear LSP logs then reproduce the issue and send me resulting logs? reproduce.mp4 |
Interesting! Here are the logs using helix with four different logging verbosity (from hx dbt-models/run.sql |
@thomasaarholt thank you for detailed logs! According to current design this navigation should start working only after whole project analysis, that could take some time. So my assumption that if you wait some time (depending on your project size) the go to definition feature should start working. When it is don you should see the following LSP log:
Please let me know if this helps. |
Hello again! I'm still loving using this as an LSP with helix!
Would it be possible to add support for goto definition on aliases? We typically include upstream models at the top of our models inside CTEs, and then join them further down. In the example below, it would be really nice to be able to position the cursor on the alias
foo
, call goto definition and be taken tofoo as
, or position onf.
and be taken toas f
.The text was updated successfully, but these errors were encountered: