Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

[Question] Don't append ? for optional arguments #527

Closed
weizheheng opened this issue Aug 14, 2021 · 2 comments
Closed

[Question] Don't append ? for optional arguments #527

weizheheng opened this issue Aug 14, 2021 · 2 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@weizheheng
Copy link

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 click enter 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:

  1. Install nvim-compe with neovim LSP
  2. 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)

image

Additional context (optional)

@weizheheng weizheheng added the bug Something isn't working label Aug 14, 2021
@crater2150
Copy link

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 })`)

@stale
Copy link

stale bot commented Oct 17, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants