Closed i-am-the-slime closed 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
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.
@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 will try to rebase and check it with the released version of 0.14 and report back.
Merging this, there is an issue around completion (related to the above discussion) I'll fix before I push a release
This change allows for importing the dreaded
/\
operator fromData.Tuple.Nested
. It fixes nwolverson/vscode-ide-purescript#127Result:
I tried to split the changes into separate commits:
getReplacement
from a where clause toQuickFix.purs
that had a dodgy unused version of it\
into a valid infix identifier in the regex for infix operatorsUnnecessaryImport
as a branch toImportResult
so we can differentiate between real import failures and the "no import necessary" case which allows us to show an error to the user in case of an actual failuref2dca11 Uses new
declarationType
from Import Suggestions to enrich the import QuickFix action with the kind of the thing that the user will be importing (function, value, typeclass, data constructor, etc.). It also uses the information to enrich the import query with a namespace so that imports of conflicting identifiers actually workBecause I was making the changes locally to the 0.14 compiler I had to drop
Kind
from the array of namespaces we supply for completions becauseKind
does not exist in that version of the compiler anymore. There's also a change that I didn't commit which changes thebuild
command to usestdout
for the--json-output
but I'm not sure about the strategy and backwards compatibility here and this already has more than enough changes as is.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.