-
Notifications
You must be signed in to change notification settings - Fork 49
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
Skip generating foreign calls under ghcide, generate stubs instead #128
Conversation
bc5140a
to
f58df41
Compare
TH.varE ffiImportName | ||
-- Note [ghcide-support] | ||
-- haskell-language-server / ghcide cannot handle code that use | ||
-- `addForeignFile`/`addForeignSource` as we do here; it will result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that it doesn't work, but I think what should be fixed is the tool, not the code generation part.
I don't want to add a flag for the tools here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what should be fixed is the tool, not the code generation part.
@junjihashimoto What fix do you suggest? There's none known to me.
If you find it better, we can use an environemnt variable that has in the name that linking does not work in this environment instead of __GHCIDE__
specifically, so it covers all tools where linking as expected by inline-c
does not work.
I don't want to add a flag for the tools here.
Usage of inline-c
breaks HLS (which it does), everybody will carry this patch anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nh2 One idea is creating a ghc plugin and adding a mechanism to set functions that don't work. The plugin generates dummy code for each function. It's a code generation problem, so I think we can solve a series of problems by the plugin.
I'd like to create a separate branch to deal with it. |
@junjihashimoto What does that mean? |
It means that it just clones the patched one to own repository. |
@nh2 I don't think it's an ideal solution, but it's better to merge, right? |
Yes, probably. I just commented in haskell/haskell-language-server#365 (comment) because I think this change is still needed. I think the only open question is how the env var should be called (haskell/haskell-language-server#365 (comment)) so it's probably cleanest to merge this PR here only once that's been decided and implemented in HLS. |
@nh2 This PR is merged. inline-c-0.9.1.10 is available with this feature. |
@junjihashimoto Thanks! |
See haskell/haskell-language-server#365 (comment)
The
__GHCIDE__
environment variable is not currently set byhaskell-language-server
-- if this approach I'm implementing here (TH using this env var) is sanctioned by HLS developers, HLS should set this variable. Currently I set it myself in my shell.