Skip to content
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

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

Merged
merged 7 commits into from
Nov 29, 2024

Conversation

ashish10alex
Copy link
Owner

@ashish10alex ashish10alex commented Nov 27, 2024

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

schema_auto.mp4

@HampB
Copy link
Collaborator

HampB commented Nov 27, 2024

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
Copy link
Owner Author

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
Copy link
Collaborator

HampB commented Nov 29, 2024

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
Copy link
Owner Author

@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.

@ashish10alex ashish10alex merged commit dd23704 into main Nov 29, 2024
@ashish10alex ashish10alex deleted the schema_completions branch December 11, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants