Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DRAFT: Cabal project plugin diagnostics #4615

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

Draft
rm41339 wants to merge 1 commit into haskell:master
base: master
Choose a base branch
Loading
from rm41339:cabal-project-plugin

Conversation

Copy link
Contributor

@rm41339 rm41339 commented Jun 6, 2025

Draft of cabal.project plugin for GSoC 2025

Still in progress!

@fendor fendor marked this pull request as draft June 9, 2025 12:15
let perr = NE.head errs
in Left $
Diagnostics.fatalParseErrorDiagnostic file
("Failed to parse cabal.project file: " <> T.pack (show perr))
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Jul 31, 2025

Choose a reason for hiding this comment

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

Is this a nicely readable view for the user?
Also, you are only showing the first error in the list, we also want to know about the other ones.

Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025
edited
Loading

Choose a reason for hiding this comment

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

@rm41339 i dont think this is resolved?

@rm41339 rm41339 changed the title (削除) DRAFT: Cabal project plugin (削除ここまで) (追記) DRAFT: Cabal project plugin diagnostics (追記ここまで) Aug 3, 2025
Comment on lines 73 to 74
cacheDir :: String
cacheDir = "ghcide"
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025

Choose a reason for hiding this comment

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

We should expose this constant from haskell-language-server/ghcide/session-loader/Development/IDE/Session.hs instead of hard-coding it here.

(_warnings, Right fields) ->
Right fields

-- Helper for parseCabalProjectFileContents, returns unique cache directory for given cabal.project file
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025

Choose a reason for hiding this comment

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

Suggested change
-- Helper for parseCabalProjectFileContents, returns unique cache directory for given cabal.project file
-- Returns unique cache directory for given cabal.project file

Comment on lines 50 to 52
-- Extract fields from cabal.project file
readCabalProjectFields
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025

Choose a reason for hiding this comment

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

Please use haddock comments, otherwise the documentation won't show up.

Comment on lines 57 to 59
-- we don't want to double report diagnostics, all diagnostics are produced by 'parseCabalProjectFileContents'.
(_warnings, Left (_mbVer, errs)) ->
Left (map (Diagnostics.errorDiagnostic file) (NE.toList errs))
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025

Choose a reason for hiding this comment

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

After some thinking, we should report these warning diagnostics after all, the same will go for the cabal-plugin.
Since we ignore the file diagnostics in the rule (ParseCabalProjectFields) where this is called already, I would return warning diagnostics as well as error diagnostics in here for consistency.

False @? "Expected parse to fail (missing import), but it succeeded"
]

-- ------------------------ ------------------------------------------------
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe Aug 10, 2025

Choose a reason for hiding this comment

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

I know it was like that, from where you copied it but please remove the space 🙃

@rm41339 rm41339 force-pushed the cabal-project-plugin branch 2 times, most recently from 144aeb3 to c33a7f1 Compare August 29, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Bodigrim Bodigrim Bodigrim left review comments

@fendor fendor fendor left review comments

@michaelpj michaelpj Awaiting requested review from michaelpj michaelpj is a code owner

@VeryMilkyJoe VeryMilkyJoe Awaiting requested review from VeryMilkyJoe

@wz1000 wz1000 Awaiting requested review from wz1000 wz1000 will be requested when the pull request is marked ready for review wz1000 is a code owner

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /