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

String literals aren't inferred as strings #106

Closed
vemv opened this issue Sep 14, 2023 · 6 comments · Fixed by #107
Closed

String literals aren't inferred as strings #106

vemv opened this issue Sep 14, 2023 · 6 comments · Fixed by #107

Comments

@vemv
Copy link
Contributor

vemv commented Sep 14, 2023

Although it's very much a marginal case, I noticed that (.| "a string") doesn't trigger accurate completions.

If fixing it, one could also tackle other literals such as [] (admittedly interop on a vector is also a very marginal use case)

I'd be willing to work on this one.

@alexander-yakushev
Copy link
Owner

I'd say having that for a string literal is fine, but everything else is a stretch:).

@vemv
Copy link
Contributor Author

vemv commented Sep 14, 2023

Being able to invoke e.g. (.indexOf [3] 3) is kinda useful though. Not that I'd recommend that doing it all the time 😄

@alexander-yakushev
Copy link
Owner

Being able to invoke e.g. (.indexOf [3] 3) is kinda useful though.

What for? :) You already know that the index is 0.

@vemv
Copy link
Contributor Author

vemv commented Sep 14, 2023

Maybe I want to quickly remember the methods I can call on a vector 👀 and then replace [] with my-vec.

Sort of a contrived technique, however it's definitely quicker than any alternative I can think of.

@alexander-yakushev
Copy link
Owner

[] -> cider-inspect -> Click on the class name. Or PersistentV -> Tab -> cider-inspect. You get a buffer that doesn't go away so easily and is convenient to search, and you see all arities immediately.

@vemv
Copy link
Contributor Author

vemv commented Sep 15, 2023

Yeah but neither of those are as fast - with this approach it's about 3 keystrokes away ([, ., tab)

Another point of view is simply pride - when one sees a gazillion unrelated completions for (.| [,,,) , one just knows we can do better.

Either way, it's no big deal although probably I'd enjoy working on it some day.

vemv added a commit to reducecombine/compliment that referenced this issue Sep 16, 2023
vemv added a commit to reducecombine/compliment that referenced this issue Sep 16, 2023
alexander-yakushev pushed a commit that referenced this issue Sep 17, 2023
* Infer the class string and coll literals

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

Successfully merging a pull request may close this issue.

2 participants