[Question] Don't append ? for optional arguments
weizheheng opened this issue · 2 comments
Checkhealth
Put result of :checkhealth compe
.
health#compe#check
========================================================================
## compe:snippet
- OK: snippet engine detected.
## compe:mapping
- OK: `compe#complete` is mapped: (`i <C-Space> * compe#complete()`)
- OK: `compe#confirm` is mapped: (`i <CR> * compe#confirm(lexima#expand('<CR>', 'i'))`)
- OK: `compe#close` is mapped: (`i <C-E> * compe#close('<C-E>')`)
- OK: `compe#scroll` is mapped: (`i <C-D> * compe#scroll({ 'delta': -4 })`)
Describe the bug
- Navigating to completion for optional attributes auto appends the
?
in typescript and have to clickenter
to clear it. - I am not sure if this is a bug, but will love to hear some input on whether it's possible to not append the
?
- Thanks for this amazing plugin!
To Reproduce
Steps to reproduce the behavior with the minimal config:
- Install nvim-compe with neovim LSP
- Trigger a completion for optional attributes
Actual behavior
- When navigating to the optional attributes using tab, it auto appends the
?
- Clicking enter will remove the
?
Expected behavior
- I am expecting it to not append the
?
so that I don't need to click enter to continue typing.
Screenshots (optional)
Additional context (optional)
I have a similar problem with the Scala language server (metals). It looks like the problem occurs, whenever the signature of the completed element is followed by something other than a opening paren. In Scala, this includes fields, where the :
separating the type annotation is inserted:
and functions with type parameters (using square brackets), which are inserted up to the first whitespace, dollar sign or completely if none of those occur:
In both cases, the extra symbols are inserted in the buffer, unless confirmed with <CR>
.
The same does not occur, if, in the signature, the name is directly followed by normal parentheses:
Checkhealth:
health#compe#check
========================================================================
## compe:snippet
- OK: snippet engine detected.
## compe:mapping
- OK: `compe#complete` is mapped: (`i <C-Space> * compe#complete()`)
- OK: `compe#confirm` is mapped: (`i <CR> * compe#confirm('<CR>')`)
- OK: `compe#close` is mapped: (`i <C-E> * compe#close('<C-E>')`)
- OK: `compe#scroll` is mapped: (`i <C-D> * compe#scroll({ 'delta': -4 })`)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.