Skip to content

Commit

Permalink
racket: start completion in a full keyword (dense-analysis#4186)
Browse files Browse the repository at this point in the history
The default `omni_start_map` is too restrictive for Lisps and Schemes
like Racket, which permit hyphens (among other special characters).

As recorded in dense-analysis#3870, trying to complete `file-name-from-path` when
typing `file-name<C-x><C-o>` would give completions like `namespace`
because the hyphen is ignored to find the start of the word for
completion.

Now the racket filetype searches for the start using the keyword class
`\k`, which is more precise.
  • Loading branch information
benknoble authored and cyyever committed Jul 11, 2022
1 parent ff77f18 commit 0cf9406
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions autoload/ale/completion.vim
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ let s:should_complete_map = {
" Regular expressions for finding the start column to replace with completion.
let s:omni_start_map = {
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$',
\ 'racket': '\k\+',
\}

" A map of exact characters for triggering LSP completions. Do not forget to
Expand Down

0 comments on commit 0cf9406

Please sign in to comment.