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

Search result is replaced with undefined values #344

Open
kbiedrzycki opened this issue Apr 28, 2021 · 1 comment
Open

Search result is replaced with undefined values #344

kbiedrzycki opened this issue Apr 28, 2021 · 1 comment

Comments

@kbiedrzycki
Copy link

Hey!

Wanted to ask about potential bug and possible solution. It occurs when a search result that is being selected from textcomplete suggestions contains $0, $1 or any other number in similar pattern (which I guess represents regex substitution). Basically, what is happening, these substitution patterns are being replaced with empty strings or what is worse, with undefined string, probably because of the lines https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/SearchResult.ts#L4 and https://github.com/yuku/textcomplete/blob/main/packages/textcomplete-core/src/SearchResult.ts#L24. I wonder what is the use case for that (like, how we can actually provide replacement groups, for example when search result that looks like fun$1() or VALUE$10). We could potentially try to escape these values somehow, but not sure if there's any callback that we can attach to to unescape them once they are parsed. Any suggestions highly appreciated!

TLDR:
Selecting a suggestion from a textcomplete that contains regex substitution returns oddly - like ab$5ab -> abundefinedab.

@rayzeller
Copy link

bump

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