omni: racket should complete at end of keywords#4352
Merged
hsanson merged 1 commit intodense-analysis:masterdense-analysis/ale:masterfrom Nov 5, 2022
benknoble:fix-racket-should-completebenknoble/ale:fix-racket-should-completeCopy head branch name to clipboard
Merged
omni: racket should complete at end of keywords#4352hsanson merged 1 commit intodense-analysis:masterdense-analysis/ale:masterfrom benknoble:fix-racket-should-completebenknoble/ale:fix-racket-should-completeCopy head branch name to clipboard
hsanson merged 1 commit intodense-analysis:masterdense-analysis/ale:masterfrom
benknoble:fix-racket-should-completebenknoble/ale:fix-racket-should-completeCopy head branch name to clipboard
Conversation
Consider a file like
```
#lang racket
(require racket/gui)
```
Type `Go(eventspace-`.
Pressing <C-x><C-o> to trigger omnicomplete should suggest
```
eventspace-handler-thread
eventspace-shutdown?
eventspace-event-evt
```
It does not (instead producing "top-level" completions, as if
`(eventspace-` wasn't even there).
Debugging, place the cursor on a space _after_. Now
`ale#completion#OmniFunc(1, '')` correctly returns `1`, but when given
`(0, 'eventspace-')` it returns either the empty list or generic
completion results as described above. I'm not entirely sure of the
mechanism, but it seems that `b:ale_completion_info.prefix` is the key,
and that this is set by `ale#completion#GetPrefix`. Calling
`ale#completion#GetPrefix('racket', line('.'), col('.'))` returned `''`!
Now, it returns `eventspace-` and the completions work correctly again.
Ref dense-analysis#4293, dense-analysis#4186, dense-analysis#3870
09fd25e to
9a5cccd
Compare
Contributor
Author
|
/cc @hsanson |
hsanson
approved these changes
Nov 5, 2022
Contributor
hsanson
left a comment
There was a problem hiding this comment.
Looks ok. Assume @benknoble knows what is best for racket.
mnikulin
pushed a commit
to mnikulin/ale
that referenced
this pull request
Nov 12, 2023
Consider a file like
```
#lang racket
(require racket/gui)
```
Type `Go(eventspace-`.
Pressing <C-x><C-o> to trigger omnicomplete should suggest
```
eventspace-handler-thread
eventspace-shutdown?
eventspace-event-evt
```
It does not (instead producing "top-level" completions, as if
`(eventspace-` wasn't even there).
Debugging, place the cursor on a space _after_. Now
`ale#completion#OmniFunc(1, '')` correctly returns `1`, but when given
`(0, 'eventspace-')` it returns either the empty list or generic
completion results as described above. I'm not entirely sure of the
mechanism, but it seems that `b:ale_completion_info.prefix` is the key,
and that this is set by `ale#completion#GetPrefix`. Calling
`ale#completion#GetPrefix('racket', line('.'), col('.'))` returned `''`!
Now, it returns `eventspace-` and the completions work correctly again.
Ref dense-analysis#4293, dense-analysis#4186, dense-analysis#3870
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider a file like
Type
Go(eventspace-.Pressing to trigger omnicomplete should suggest
It does not (instead producing "top-level" completions, as if
(eventspace-wasn't even there).Debugging, place the cursor on a space after. Now
ale#completion#OmniFunc(1, '')correctly returns1, but when given(0, 'eventspace-')it returns either the empty list or generic completion results as described above. I'm not entirely sure of the mechanism, but it seems thatb:ale_completion_info.prefixis the key, and that this is set byale#completion#GetPrefix. Callingale#completion#GetPrefix('racket', line('.'), col('.'))returned''!Now, it returns
eventspace-and the completions work correctly again.Ref #4293, #4186, #3870