ashish10alex / vscode-dataform-tools

Dataform tools - a vscode extension
https://marketplace.visualstudio.com/items?itemName=ashishalex.dataform-lsp-vscode
MIT License
20 stars 4 forks source link

feat: make the columns of the dependencies available for autocompletion #73

Closed ashish10alex closed 19 hours ago

ashish10alex commented 3 days ago

This PR:

Autocompletion of column names for a given file. The column names to autocomplete are derived from the dependencies of the current file. The calculation has been done asynchronously so should have minimal impact to the current compilation times. Please see the video for the demo. I have copped out the part where it shows the metadata of the table column is inferred from for privacy reasons. Please try it in your local dev environment. The user would need to at least save their file once to make the completion items available.

PS: For best user experience use ctrl + space trigger

https://github.com/user-attachments/assets/1b6e04e1-14cc-47d6-9ee9-973ad05bbc25

HampB commented 2 days ago

Great idea @ashish10alex ! I’ve been thinking about this, and I agree it’s a good feature.

However, I can’t seem to run it locally. I’m encountering this error in the console:

rejected promise not handled within 1 second: Error: Not found: Dataset xxxx:xxxx

From what I can see, it seems to be trying to access a dataset in the wrong project. In this case, it’s targeting a dataset in our Dataform project instead of the default database we’ve specified.

ashish10alex commented 2 days ago

thanks @HampB for highlighting the issue. I have now passed projectId into the api call so that it retrieves the table schema of the correct table.

HampB commented 21 hours ago

Apologies for the delayed response, @ashish10alex!
It's been quite busy here with Black Week 😊

Everything seems to be working well on my end; I've been running it locally for some time without any issues. I believe it's good to go for now. However, I'll be working on some Dataform tasks over the weekend and will continue testing it further.

ashish10alex commented 19 hours ago

@HampB , no worries, thanks for testing it. I have also added type & description in markdown if available. It is made available to see when you click on arrow at the end of the autocompletion. I'll release this now. Please feel free to raise any issues that you might across.