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

How to not append space? #239

Open
vczyh opened this issue Sep 18, 2024 · 5 comments
Open

How to not append space? #239

vczyh opened this issue Sep 18, 2024 · 5 comments

Comments

@vczyh
Copy link

vczyh commented Sep 18, 2024

  • 1 Press Tab after FROM, autocomplete schema, it works.
// "schema." is PcItemDynamic callback returned.
SELECT * FROM schema.
  • 2 Continue to press Tab for the prompt table list. It looks this:
SELECT * FROM schema. table

I know the result is right. Every autocompletion will add space.

I want:

SELECT * FROM schema.table

What should I do?

Thanks!

@wader
Copy link

wader commented Sep 18, 2024

Could you post a minimal example that reproduces it? it should be possible, ex i use readline for fq and this works:

$ fq -i
null> {a:{b:123}} | .<tab><tab><tab>
# end up with
null> {a:{b:123}} | .a.b

BTW you might want to consider using https://github.com/ergochat/readline that is more active fork.

@vczyh
Copy link
Author

vczyh commented Sep 18, 2024

Could you post a minimal example that reproduces it? it should be possible, ex i use readline for fq and this works:

$ fq -i
null> {a:{b:123}} | .<tab><tab><tab>
# end up with
null> {a:{b:123}} | .a.b

BTW you might want to consider using https://github.com/ergochat/readline that is more active fork.

fq custom AutoCompleter : https://github.com/wader/fq/blob/f150085735e8c20b86fa68210ed4162a3b6177b3/pkg/interp/interp.go#L458-L498

@wader
Copy link

wader commented Sep 18, 2024

Yeap ends up being used here https://github.com/wader/fq/blob/f150085735e8c20b86fa68210ed4162a3b6177b3/pkg/cli/cli.go#L200-L212

What do you use now? something like PrefixCompleter? that one seems to append whitespaces in some cases. Is there some reason you can't do your own AutoCompleter?

@vczyh
Copy link
Author

vczyh commented Sep 19, 2024

Yeap ends up being used here https://github.com/wader/fq/blob/f150085735e8c20b86fa68210ed4162a3b6177b3/pkg/cli/cli.go#L200-L212

What do you use now? something like PrefixCompleter? that one seems to append whitespaces in some cases. Is there some reason you can't do your own AutoCompleter?

You're right. I need to implement my own AtutoCompleter.
Thank you bro, I love you.

@wader
Copy link

wader commented Sep 19, 2024

Happy it helped 👍

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

No branches or pull requests

2 participants