Skip to content

Improve error message for --probe-tools #4387

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

sgillespie
Copy link
Contributor

@sgillespie sgillespie commented Aug 20, 2024

Addresses #4336. When resolving the runtime GHC throws an error, print it. Otherwise show the GHC version.

> haskell-language-server-wrapper --probe-tools
haskell-language-server version: 2.9.0.1 (GHC: 9.6.5) (PATH: /home/sgillespie/dev/haskell/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-9.6.5/haskell-language-server-2.9.0.1/x/haskell-language-server-wrapper/build/haskell-language-server-wrapper/haskell-language-server-wrapper) (GIT hash: 6f6f75bc410c51352e56a87a38a5345bdd44d0bb)
Tool versions found on the $PATH
cabal:          3.10.3.0
stack:          2.15.7
ghc:            9.6.5

Tool versions in your project
2024-08-20T20:42:48.640305Z | Debug | cabal exec -v0 -- ghc --print-libdir
Failed to find the GHC version of this Cabal project.
Error when calling cabal exec -v0 -- ghc --print-libdir

Errors encountered when parsing cabal file ./hls4336.cabal:

hls4336.cabal:20:39: error:
unexpected end of input
expecting white space

   17 |     main-is:          Main.hs
   18 |     -- other-modules:
   19 |     -- other-extensions:
   20 |     build-depends:    base >=4.18.2.1,
      |                                       ^

@sgillespie sgillespie requested a review from fendor as a code owner August 20, 2024 20:48
When `getRuntimeGhcVersion'` throws an error, display that error
@sgillespie sgillespie force-pushed the fix/4336-cabal-err-message branch from cfa124f to 1faea9c Compare August 20, 2024 20:51
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much!

@fendor fendor merged commit e6c26bc into haskell:master Aug 21, 2024
36 checks passed
soulomoon pushed a commit to soulomoon/haskell-language-server that referenced this pull request Sep 23, 2024
When `getRuntimeGhcVersion'` throws an error, display that error
soulomoon pushed a commit to soulomoon/haskell-language-server that referenced this pull request Oct 24, 2024
When `getRuntimeGhcVersion'` throws an error, display that error
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants