nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Add support for importing conflicting identifiers #118

Closed i-am-the-slime closed 3 years ago

i-am-the-slime commented 3 years ago

This change allows for importing the dreaded /\ operator from Data.Tuple.Nested. It fixes nwolverson/vscode-ide-purescript#127

Result:

import in action

I tried to split the changes into separate commits:

This change depends on both purescript/purescript#3997 and kritzcreek/purescript-psc-ide#52 .

If you're curious, I wrote up how these changes came about here.

nwolverson commented 3 years ago

Good work.

There's some work being done for completions already to distinguish between imports in different namespaces, we currently make multiple requests to distinguish because I mentioned adding a field to completions to give that info but didn't do anything about it "yet". Hopefully your addition is that field, I'd need to look at it properly - but then we can later remove the extra request.

Need to think about how this change works with old compiler version - I've always tried to keep compatibility with the current and prior major versions, doesn't need to have the new stuff obviously just not break everything

i-am-the-slime commented 3 years ago

Hey, @nwolverson thanks! I hadn't seen this before. I think compatibility should be there since the new change introduces the additional info only when it's there (it's a Maybe). The fallback should be the old behaviour.

nwolverson commented 3 years ago

@i-am-the-slime are you aware of anything outstanding on this? With 0.14.0 release I'm reminded to look at it (finally), I'm aware the purescript-psc-ide isn't yet merged.

Going to look at testing this soon :)

i-am-the-slime commented 3 years ago

I will try to rebase and check it with the released version of 0.14 and report back.

nwolverson commented 3 years ago

Merging this, there is an issue around completion (related to the above discussion) I'll fix before I push a release