Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default completion doesn't work with pipe #974

Open
jcubic opened this issue Oct 3, 2024 · 2 comments
Open

Default completion doesn't work with pipe #974

jcubic opened this issue Oct 3, 2024 · 2 comments
Labels

Comments

@jcubic
Copy link
Owner

jcubic commented Oct 3, 2024

Issue summary

When using pipe extension completion: true doesn't work

Expected behavior

It should create completion when using object as interpreter

Steps to reproduce

  1. Open Demo https://codepen.io/jcubic/pen/LYwNjrQ
  2. press <TAB>

Browser and OS

N/A

Additional notes

The problem is that completion throws an error when used with a function interpreter. Maybe it should give a warning that you can't create a completion, or completion should be ignored.

https://codepen.io/jcubic/pen/vYoGJVV

@jcubic jcubic added the Bug label Oct 3, 2024
@jcubic
Copy link
Owner Author

jcubic commented Oct 3, 2024

It seems that the code is correct, only the error message should be improved:

Instead of:

Invalid completion

The error should say something like:

Invalid completion: "automatic completion can't be used with a function interpreter"

Pipe creates an interpreter before it's passed to the library, so it is the same as creating a function as first argument.

But the pipe should create its own completion when object is used.

@jcubic
Copy link
Owner Author

jcubic commented Oct 3, 2024

It may be required to expose: make_interpreter function as __make_interpreter__ for the use in the pipe extension. This function will call callback with interpreter function and completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant