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

Use ghcide master head (d76fbf9) #530

Merged
merged 8 commits into from
Nov 3, 2020
Merged

Conversation

jneira
Copy link
Member

@jneira jneira commented Oct 23, 2020

@jneira
Copy link
Member Author

jneira commented Oct 23, 2020

One test failing:

    local imports:                                                                                      FAIL
      Exception: Timed out waiting to receive a message from the server.
      Last message received:
      {
          "tag": "RspExecuteCommand",
          "contents": {
              "error": {
                  "code": -32603,
                  "message": "tried to look at linkable for GetModIfaceWithoutLinkable for NormalizedFilePath \"/home/runner/work/haskell-language-server/haskell-language-server/test/testdata/eval/T25.hs\"\nCallStack (from HasCallStack):\n  error, called at src/Development/IDE/Core/Rules.hs:836:79 in ghcide-0.4.0-inplace:Development.IDE.Core.Rules"
              },
              "jsonrpc": "2.0",
              "id": 2
          }
      }

The code to adapt the import plugin looks straightforwardIt is the eval plugin as noted below
//cc @wz1000

@wz1000
Copy link
Collaborator

wz1000 commented Oct 23, 2020

hmm...

This is because the eval plugin uses GHC.load, which runs the compilation pipeline entirely in GHC, bypassing all our ghcide rules. It should ideally be using the bytecode we generate via ghcide rules. I think the NeedsCompilation logic in ghcide would also need to be somehow modified, in order to compile all files that use the eval plugin, or are dependencies of such a file.

/cc @pepeiborra

@wz1000
Copy link
Collaborator

wz1000 commented Oct 23, 2020

Workaround for now would be to enable TemplateHaskell in any file that uses the eval plugin.

@jneira
Copy link
Member Author

jneira commented Oct 23, 2020

Let me know if you prefer merge this marking the test as knownBroken or we should wait to the eval plugin (and ghcide?) fix.

@wz1000
Copy link
Collaborator

wz1000 commented Oct 23, 2020

I don't know, it completely breaks the eval plugin.

Lets wait for @pepeiborra to chime in.

@pepeiborra
Copy link
Collaborator

You can try to change the Eval plugin to use GhcSession instead of GhcSessionDeps. If that works, then merge this PR and look at converting it to use bytecode produced by ghcide later on.

@wz1000
Copy link
Collaborator

wz1000 commented Oct 31, 2020

@jneira did you try changing GhcSessionDeps to GhcSession in the Eval plugin?

@jneira
Copy link
Member Author

jneira commented Oct 31, 2020

It is my next todo, but I have no time to start yet

@jneira
Copy link
Member Author

jneira commented Nov 3, 2020

@wz1000 i didnt expect it was so easy 😝
What are the actual implications of replace one for another?

@wz1000
Copy link
Collaborator

wz1000 commented Nov 3, 2020

The Eval plugin will run a parallel compilation pipeline, loading all the modules independently of ghcide/hls.

@wz1000 wz1000 mentioned this pull request Nov 3, 2020
@jneira jneira merged commit d0f02b5 into haskell:master Nov 3, 2020
@expipiplus1
Copy link
Contributor

Would it be possible to get a release with this change?

@jneira
Copy link
Member Author

jneira commented Nov 4, 2020

@expipiplus1 yeah, it will be included in the incoming monthly release: #567
does it resolves some issue for you?

@jneira jneira deleted the ghcide-master branch November 4, 2020 06:24
@expipiplus1
Copy link
Contributor

Yeah, I had some weird issue with GHC throwing in initDs. Was talking about it with @wz1000 on IRC, this seemed to solve it.

@tittoassini
Copy link
Contributor

Could this also be included?

haskell/ghcide@e922a16

It is a minimal change and is required to support CPP/LHS preprocessing in the Eval plugin.

@jneira
Copy link
Member Author

jneira commented Nov 4, 2020

@tittoassini the support is included simply updating ghcide? if it is the case i can give a try later at night, feel free to open a new pr updating ghcide again to get it sooner

@tittoassini
Copy link
Contributor

tittoassini commented Nov 4, 2020 via email

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

Successfully merging this pull request may close these issues.

Use ghcide version with last TemplateHaskell improvements
6 participants