Skip to content

Conversation

@jpwoodbu
Copy link
Contributor

@jpwoodbu jpwoodbu commented Jul 21, 2025

This adds tab completion to the default stub when using the REPL feature.

However, the feature only works in environments with readline support,
which means that with the bundled toolchains, Windows will not have tab
completion.

Work towards #3090

@aignas
Copy link
Collaborator

aignas commented Jul 22, 2025

I think #3104 needs to merged into this so that the os.path.norm is used instead of what we have now in this PR.

@jpwoodbu jpwoodbu force-pushed the fix-repl-tab-completion branch from 6ee1b0f to e3dbb91 Compare July 22, 2025 02:36
@jpwoodbu jpwoodbu force-pushed the fix-repl-tab-completion branch from e3dbb91 to 991fbab Compare July 22, 2025 02:49
@jpwoodbu
Copy link
Contributor Author

I think #3104 needs to merged into this so that the os.path.norm is used instead of what we have now in this PR.

I believe I've gotten that merge done. I'm surprised by the CI failures. They make it look like the merge wasn't successful, but the content of the commit the tests used looks correct to me.

philsc added a commit to philsc/rules_python that referenced this pull request Jul 28, 2025
I noticed that the CI error messages for bazel-contrib#3114 are not useful. This
patch aims to help with that by printing the output of the REPL code.
If there's an exception during startup for example, then the test log
will now contain the stack trace.
github-merge-queue bot pushed a commit that referenced this pull request Aug 1, 2025
I noticed that the CI error messages for #3114 are not useful. This
patch aims to help with that by printing the output of the REPL code.
If there's an exception during startup for example, then the test log
will now contain the stack trace.

---------

Co-authored-by: Ignas Anikevicius <[email protected]>
@jpwoodbu
Copy link
Contributor Author

jpwoodbu commented Aug 2, 2025

I'm seeing more clear error messages now. It seems the readline module is not available on Windows. As best I can tell, there's maybe nothing in the stdlib that can stand in for readline. I'm think of importing it conditionally.

This commit also makes an attempt to minimize the amount of code within the `try` block for importing `realine`.
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

LGTM, could you please add a CHANGELOG.md entry for this? This will be useful for the users to know!

@jpwoodbu
Copy link
Contributor Author

jpwoodbu commented Aug 3, 2025

LGTM, could you please add a CHANGELOG.md entry for this? This will be useful for the users to know!

Thanks! Done.

@aignas aignas changed the title fix: repl tab completion fix(repl): add tab completion on platforms with readline support Aug 3, 2025
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

LGTM

@aignas aignas enabled auto-merge August 3, 2025 07:07
@aignas aignas changed the title fix(repl): add tab completion on platforms with readline support feat(repl): add tab completion on platforms with readline support Aug 3, 2025
@aignas aignas added this pull request to the merge queue Aug 3, 2025
Merged via the queue into bazel-contrib:main with commit 2fc5f1c Aug 3, 2025
3 checks passed
@jpwoodbu jpwoodbu deleted the fix-repl-tab-completion branch August 3, 2025 07:24
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