fivetran / fivetran/dbt-language-server

Goto definition on aliases

Open
#1,462 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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 to `foo as`, or position on `f.` and be taken to `as f`.

```sql
with foo as (
select * from {{ ref('foo') }}
),

bar as (
select * from {{ ref('bar') }}
)

select
f.id,
f.name,
b.address
from foo
left join bar on f.id = b.id
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the TypeScript language-server code that handles SQL symbol resolution and goto definition, then inspect how CTE aliases and table references are represented. Use the SQL example in this issue to verify that selecting a CTE alias or its qualified fields resolves to the corresponding alias definition; add or update tests if the project has coverage for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
databases, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.