Skip to content

feat(completions): ts_query package, column autocompletion #168

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

Merged
merged 11 commits into from
Jan 10, 2025

Conversation

juleswritescode
Copy link
Collaborator

@juleswritescode juleswritescode commented Jan 8, 2025

This PR does two things:

  1. It adds autocompletion for Columns
  2. It adds a pg_treesitter_queries crate which cares about extracting useful information from a tree-sitter tree (such as "which tables are mentioned?")

In sum, that makes it such that we have smart autocompletion for columns – see the test cases in pg_completions/src/complete.rs for a sneakpeek :)

I chose to put thepg_treesitter_queries into their own crate so we can reuse them for pg_hover and the likes.

In addition, I created an InputQuery struct for our test_helpers which enforces that callers put a CURSOR_POS into their queries – I had a nasty bug before because I forgot to do it.

@juleswritescode juleswritescode changed the title Feat/ts queries feat(completions): ts_query package, column autocompletion Jan 8, 2025
@juleswritescode juleswritescode marked this pull request as ready for review January 8, 2025 16:51
Copy link
Collaborator

@psteinroe psteinroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice and clean, love it!! answered your questions and left few comments but overall lgtm!

@psteinroe psteinroe merged commit c509dd6 into supabase-community:main Jan 10, 2025
5 checks passed
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