racket: start completion in a full keyword (#4186)

The default `omni_start_map` is too restrictive for Lisps and Schemes
like Racket, which permit hyphens (among other special characters).

As recorded in #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.
This commit is contained in:
D. Ben Knoble 2022-06-22 20:13:28 -04:00 committed by GitHub
parent 91e8422d6d
commit 0e99519500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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