nwolverson / vscode-ide-purescript

PureScript IDE support for VS Code
https://marketplace.visualstudio.com/items/nwolverson.ide-purescript
MIT License
188 stars 34 forks source link

Auto completion/suggestion (for records) is not working #160

Open wclr opened 3 years ago

wclr commented 3 years ago

I have a code that compiles and runs in a browser, but no autocompletion/suggestion features seem to work while editing.

image

Errors are shown on save: image

In the output there is many warnings like that:

[Warn] Failed to resolve reexports for Type.RowPrim.RowTypeClassRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\Row.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 23, sourcePosColumn = 28}}) (ProperName {runProperName = "Cons"})Prim.RowTypeClassRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\Row.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 23, sourcePosColumn = 28}}) (ProperName {runProperName = "Lacks"})Prim.RowTypeClassRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\Row.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 23, sourcePosColumn = 28}}) (ProperName {runProperName = "Nub"})Prim.RowTypeClassRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\Row.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 23, sourcePosColumn = 28}}) (ProperName {runProperName = "Union"})

[Info  - 2:33:09 PM] [Warn] Failed to resolve reexports for Type.RowListPrim.RowListTypeRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\RowList.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 94, sourcePosColumn = 50}}) (ProperName {runProperName = "Cons"}) (Just [])Prim.RowListTypeRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\RowList.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 94, sourcePosColumn = 50}}) (ProperName {runProperName = "Nil"}) (Just [])Prim.RowListTypeClassRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\RowList.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 94, sourcePosColumn = 50}}) (ProperName {runProperName = "RowToList"})Prim.RowListKindRef (SourceSpan {spanName = ".spago\\typelevel-prelude\\v5.0.2\\src\\Type\\RowList.purs", spanStart = SourcePos {sourcePosLine = 1, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 94, sourcePosColumn = 50}}) (ProperName {runProperName = "RowList"})
wclr commented 3 years ago

Ok, it seem to show in OP case on "Ctrl+Space", but

here I don't get any suggestion, I thought to get "name" hint image

The same problem when I try to access property it in the code, no valid suggestions are displayed: image

@nwolverson should such issues be attributed to https://github.com/nwolverson/purescript-language-server?

nwolverson commented 3 years ago

@whitecolor there is no completion available on record fields, only for top-level identifiers, similarly for type tooltips. This functionality is provided by the PureScript compiler (purs ide), and while we'd all love to have it it is not a small thing to add.

There does seem to be an issue with triggering completion in VSCode on qualified identifiers - for unqualified identifiers you will no doubt see the completion popping up immediately, I've noticed for qualified ones it seems to need to cancel/restart typing or hit control-dot - this used to work better, I'm sure, and that is surely within the scope of either this or more likely PLS.