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

Fix flaky completions for zsh #2118

Merged
merged 4 commits into from
May 16, 2023
Merged

Conversation

Jasper-M
Copy link
Contributor

Quotes break zsh completions.

Or more specifically, escaped quotes \' seem to break completions on zsh.

quotes break zsh completions
@Gedochao
Copy link
Contributor

Hey, thanks for the contribution!
I tried to replicate the problem with completions and zsh and ran into something like this:

▶ scala-cli 
(eval):37: unmatched '
(eval):37: unmatched '
(eval):37: unmatched '

(scala-cli with a space and then TAB, breaks)

▶ scala-cli c
clean    -- Clean the workspace.
compile  -- Compile Scala code.
config   -- Configure global settings for Scala CLI.
console  -- Fire-up a Scala REPL.

(adding a c brings the completions back)

Is this the behaviour you're trying to fix?

@Gedochao
Copy link
Contributor

We might need to add a relevant anti-regression test.
The completions integration tests are here: https://github.com/Gedochao/scala-cli/blob/main/modules/integration/src/test/scala/scala/cli/integration/CompleteTests.scala#L7

Do you have the time to add a test?
If not, I can try to look at this later.

@Gedochao
Copy link
Contributor

the reference-doc check is failing on the CI, btw.
This is because reference docs haven't been regenerated in sync with your changes.

You can fix it by running

./mill -i generate-reference-doc.run

(as per CONTRIBUTING.md)

@Jasper-M
Copy link
Contributor Author

(adding a c brings the completions back)

Indeed, once you manage to limit the output to completions that don't contain quotes in their description it works.

Is this the behaviour you're trying to fix?

Yes that's exactly it. Turns out a similar change has already been attempted in the past #893

Do you have the time to add a test?

I will give it a go.

I just noticed that completions are implemented by case-app instead of natively in scala-cli. I should probably open an issue there.

@Jasper-M
Copy link
Contributor Author

I just noticed that completions are implemented by case-app instead of natively in scala-cli. I should probably open an issue there.

alexarchambault/case-app#475

@Gedochao Gedochao changed the title replace quotes with backticks Fix flaky completions for zsh May 16, 2023
Jasper-M and others added 2 commits May 16, 2023 10:38
…eteTests.scala

Co-authored-by: Piotr Chabelski <ged.subfan@gmail.com>
Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@Gedochao Gedochao merged commit 1be4199 into VirtusLab:main May 16, 2023
@Gedochao Gedochao added the bug Something isn't working label May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants