Skip to content

Conversation

@rolandwalker
Copy link
Contributor

Description

  • Complete immediately on files in the current directory, even if the text to complete does not start with ..
  • This resolves a minor bug in which files in the cwd beginning with . were offered as suggestions before the user had typed ./.
  • Complete only files that end in .sql (and directories).
  • Append / to suggested directory names.
  • Otherwise continue to complete on paths beginning with ./, ~, and / in the same way, and continue to offer the punctuation suggestions.

If the restriction to completion on files that end in .sql is too restrictive, we could make it configurable, as noted in a comment.

The user can still source a file that does not end in .sql. It just won't be offered as a completion.

Example (first do touch script.sql):

last image

Old (shows history suggestion, but not popup completions):

Screenshot 2026-01-27 at 5 38 07 AM

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

@rolandwalker rolandwalker self-assigned this Jan 27, 2026
Copy link
Contributor

@scottnemes scottnemes left a comment

Choose a reason for hiding this comment

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

I think the suggesting only sql files is fine, maybe add config later if anyone really wants it.

Only thing I noticed is when you do source without any text it appears to do a sorted combined list of directories and files; would be nice if files showed up first. But if that is beyond the scope you want here it could be a future pass.

 * complete immediately on files in the current directory,even if the
   text to complete does not start with "."
 * this resolves a minor bug in which files in the cwd beginning with
   "." were offered as suggestions before the user had typed "./"
 * complete only files that end in ".sql" (and directories)
 * append "/" to suggested directory names
 * otherwise continue to complete on paths beginning with "./", "~", and
   "/" in the same way, and continue to offer the punctuation
   suggestions

If the restriction to completion on files that end in ".sql" is too
restrictive, we could make it configurable, as noted in a comment.

The user can still source a file that does not end in ".sql".  It just
won't be offered as a completion.
@rolandwalker rolandwalker force-pushed the RW/eager-source-completions branch from f78613f to 1ff09cd Compare January 28, 2026 10:16
@rolandwalker
Copy link
Contributor Author

would be nice if files showed up first

Great point. I just tried and it didn't work right. Maybe dotfiles also shouldn't appear. Let's leave those to a future pass.

@rolandwalker rolandwalker merged commit 6d66c80 into main Jan 28, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/eager-source-completions branch January 28, 2026 10:30
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.

3 participants