vscode-dbt-power-user
vscode-dbt-power-user copied to clipboard
Go to sources definition sending to first string match in sources.yml, as opposed to table definition
Expected behavior
Clicking "go to definition" on a source macro opens the appropriate source.yml file and links to the correct line where the source table name is instantiated.
Actual behavior
Clicking "go to definition" on a source macro opens the expected source.yml file BUT instead links to the line containing the first string match of the table name, as opposed to the table definition itself.
For instance, if I have a source macro {{ source('marketplace', 'cars') }} and I click "go to definition", the correct source.yml file will open, but I'll be taken to the line in the yml file with the string "cars". Instead, I should be taken to where the table "cars" is defined, using the correct method of yml parsing.
Steps To Reproduce
In a repository where your sources are from a data warehouse that dbt is connected to, click on "go to definition" for a source macro for a source table who's name appears in the source yml file before the table definition.
Log output/Screenshots
So, in the example below, clicking on Go to Definition from {{ source('marketplace', 'cars') }} would send me to "cars" in the description of the vehicles table, as opposed to the definition of the cars table.
version: 2
sources:
- name: marketplace
database: company_database
schema: marketplace
tables:
- name: vehicles
description: >
A table containing all vehicles, such as cars, trucks, or motorcycles
columns: ...
- name: cars
description: >
A table containing just cars
columns: ...
Operating System
macOS 14.5
dbt version
1.8.3
dbt Adapter
Redshift
dbt Power User version
v0.43.4
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!