Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Trying out haskell-lsp 0.14 #1288

Merged
merged 1 commit into from Jun 13, 2019
Merged

Trying out haskell-lsp 0.14 #1288

merged 1 commit into from Jun 13, 2019

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Jun 13, 2019

Tests failing, suspect a JSON encoding problem.

ping @cocreature, see the circle logs

Locally I get the first two of many failing tests, all with a spurious <0>

      test/functional/FunctionalCodeActionsSpec.hs:557:9: 
      1) FunctionalCodeActions, code actions, import suggestions, formats with brittany, Execute HsImport with formatter brittany, works with 3.8 code action kinds
           expected: "Import module Control.Monad (when)"
            but got: "Import module Control.Monad (<0>when)"
    
      To rerun use: --match "/FunctionalCodeActions/code actions/import suggestions/formats with brittany/Execute HsImport with formatter brittany/works with 3.8 code action kinds/"
    
      test/functional/FunctionalCodeActionsSpec.hs:598:16: 
      2) FunctionalCodeActions, code actions, import suggestions, formats with brittany, Execute HsImport with formatter brittany, import-list formats
           Actual list is not a permutation of expected list!
             expected list contains:   ["import qualified Data.Maybe", "import           Control.Monad                  ( when )", "main :: IO ()", "main = when True $ putStrLn \"hello\""]
             actual list contains:     ["import qualified Data.Maybe", "import Control.Monad ((<0>when))", "main :: IO ()", "main = when True $ putStrLn \"hello\""]
             the missing elements are: ["import           Control.Monad                  ( when )"]
             the extra elements are:   ["import Control.Monad ((<0>when))"]
    
      To rerun use: --match "/FunctionalCodeActions/code actions/import suggestions/formats with brittany/Execute HsImport with formatter brittany/import-list formats/"

Tests failing, suspect a JSON encoding problem.

ping @cocreature, see the circle logs
@fendor
Copy link
Collaborator

fendor commented Jun 13, 2019

Did these errors happen before #1284 had been merged?

@alanz
Copy link
Collaborator Author

alanz commented Jun 13, 2019

@fendor good point, I had forgotten about that. We will have to see what circle says about the merge result. I assume it was fine, as it showed green on CI before I merged, and you had updated it recently.

@cocreature
Copy link
Collaborator

Hm, it looks unrelated to the changes I made but I could very well be wrong.

@alanz
Copy link
Collaborator Author

alanz commented Jun 13, 2019

It looks like circle was happy with @fendor 's merge: https://circleci.com/workflow-run/fc727e9b-c6a9-4ed6-9f27-9f6332e248e8
I am building it locally too, to check, then will investigate the rest.

There is also an updated lsp-test, perhaps @bubba knows something about that.

@alanz
Copy link
Collaborator Author

alanz commented Jun 13, 2019

Ok, seems there is something whacky on my local machine.

@lukel97
Copy link
Collaborator

lukel97 commented Jun 13, 2019 via email

@alanz
Copy link
Collaborator Author

alanz commented Jun 13, 2019

I am on linux too. But been messing with cabal builds, and ghc 8.8., etc. Could have a whacky config by now.

So I reckon just merge and see what happens. Circle is happy.

@alanz alanz merged commit d679eb5 into haskell:master Jun 13, 2019
@alanz
Copy link
Collaborator Author

alanz commented Jun 14, 2019

I did a bisect on this, and the problem comes from 3350686

$ git bisect log
git bisect start
# good: [83c28a907eda2a68aeeb254f8baa9f3add08aacf] Merge pull request #1287 from alanz/hlint-2.1.24
git bisect good 83c28a907eda2a68aeeb254f8baa9f3add08aacf
# bad: [d679eb595a6a1583a8b63a3fdd5964f84a8d00f6] Merge pull request #1288 from alanz/haskell-lsp-0.14
git bisect bad d679eb595a6a1583a8b63a3fdd5964f84a8d00f6
# bad: [988dcff2eb18edcee0bbed5a10e597f9ca9d1ad9] Add space to code action title
git bisect bad 988dcff2eb18edcee0bbed5a10e597f9ca9d1ad9
# bad: [3835a09db92c3a3c4f0761e50cd22e70f191c603] Fix tests, add documentation and add newtypes
git bisect bad 3835a09db92c3a3c4f0761e50cd22e70f191c603
# bad: [07822b472e0495a1819008362e53ad07e670fdc6] Add documentation for hsimport plugin
git bisect bad 07822b472e0495a1819008362e53ad07e670fdc6
# bad: [3350686dc36c9ed012a817b6806ec1a34c4b2d05] Clone HsImport API for more fine grained control
git bisect bad 3350686dc36c9ed012a817b6806ec1a34c4b2d05
# first bad commit: [3350686dc36c9ed012a817b6806ec1a34c4b2d05] Clone HsImport API for more fine grained control

I think that what is happening is that I have a full hoogle db locally, we don't have it on the CI box.

And we need to add something like https://github.com/haskell/haskell-ide-engine/blob/master/src/Haskell/Ide/Engine/Plugin/Hoogle.hs#L137 into it somewhere:

        unHTML = T.replace "<0>" "" . innerText . parseTags

cc @fendor

@alanz alanz deleted the haskell-lsp-0.14 branch June 14, 2019 16:53
@alanz
Copy link
Collaborator Author

alanz commented Jun 14, 2019

And after deleting and re-creating my ~/.hoogle directory as per the circleci config, the tests pass for me.

I tried creating additional hoogle generate dbs, but it still passes. I think there is a landmine waiting out there.

@fendor
Copy link
Collaborator

fendor commented Jun 14, 2019

I have a good idea where this might be coming from. Hoogle searchPackage' defines almost exactly this function. In HsImport importListActions also obtains the function name by splitting "::". That may be wrong.

@fendor
Copy link
Collaborator

fendor commented Jun 14, 2019

I think, the fix would be to adapt searchPackage' to use unHtml that will be merged via #1290

@alanz alanz added this to the 2019-06 milestone Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants