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

Potential incompatibility with Julia LSP? #40

Closed
max-sixty opened this issue Dec 6, 2021 · 2 comments
Closed

Potential incompatibility with Julia LSP? #40

max-sixty opened this issue Dec 6, 2021 · 2 comments

Comments

@max-sixty
Copy link

This is another one "I'm not sure where the bug lies" — I hope these are helpful regardless — please feel free to close if it's not an issue with this library.

It seems that Julia LSP misunderstands @chain with a user function. Here's an example:

using Chain, Underscores, StatsBase, Base.Iterators, DataStructures

input = @chain begin
    read(open("Day-6.txt"), String)
    strip
    split(",")
    @. parse(Int, _)
end

start = @chain input countmap DefaultDict(0, _)

function run(start, n)
    current = copy(start)
    for i = 1:n
        next = DefaultDict(0, Dict(i - 1 => current[i] for i in keys(current) if i > 0))
        next[6] += next[8] = current[0]
        current = next
    end
    current
end

@chain start run(256) values sum  # run returns "Possible method call error"

Here's a screenshot:

image

@jkrumbiegel
Copy link
Owner

I think there's nothing I can do about that, the LSP is just not smart enough to pre-expand the macro before checking for method signature matches.

@max-sixty
Copy link
Author

Thanks @jkrumbiegel . I can put an issue in there if you think that's reasonable...

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