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

Skip completion at point if there is no REPL buffer #142

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

danielmatz
Copy link
Contributor

@danielmatz danielmatz commented Feb 1, 2024

If the completion-at-point system is triggered, but there is no REPL buffer, the julia-snail-repl-completion-at-point function still attempts to communicate with the REPL buffer, yielding the following message:

completion--some: No Julia REPL buffer *julia* found; run
julia-snail

Unfortunately, no other completion-at-point-functions are allowed to attempt completion, so no completion is performed, even if later entries in completion-at-point-functions could have handled it (e.g., the ones provided by julia-mode).

The documentation for completion-at-point-functions says to return nil if the completion function is not applicable. This commit changes julia-snail-repl-completion-at-point to check that the REPL buffer exists, and if it doesn't, it returns nil, allowing other completion-at-point-functions to take a turn.

If the `completion-at-point` system is triggered, but there is no REPL
buffer, the `julia-snail-repl-completion-at-point` function still
attempts to communicate with the REPL buffer, yielding the following
message:

    completion--some: No Julia REPL buffer *julia* found; run
    julia-snail

Unfortunately, no other `completion-at-point-functions` are allowed to
attempt completion, so no completion is performed, even if later
entries in `completion-at-point-functions` could have handled
it (e.g., the ones provided by `julia-mode`).

The documentation for `completion-at-point-functions` says to return
`nil` if the completion function is not applicable. This commit
changes `julia-snail-repl-completion-at-point` to check that the REPL
buffer exists, and if it doesn't, it returns `nil`, allowing other
`completion-at-point-functions` to take a turn.
@danielmatz danielmatz force-pushed the skip-complete-without-repl branch from 7f49b0d to 67ab2d5 Compare February 1, 2024 01:36
@gcv gcv merged commit 70d3e8e into gcv:master Feb 1, 2024
@gcv
Copy link
Owner

gcv commented Feb 1, 2024

Looks good, thank you!

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