Skip to content

Fix couple of haddock issues #471

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

Closed
wants to merge 6 commits into from
Closed

Conversation

jhrcek
Copy link
Collaborator

@jhrcek jhrcek commented Jan 26, 2023

No description provided.

@@ -371,7 +371,6 @@ data ResponseError =

deriveJSON lspOptions ''ResponseError

-- | Either result or error must be Just.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is misleading since the former 2 Maybe fields were replaced with Either in
95f2e76#diff-6031041f17e1defe329987e180cff35227ab23a55bf8fa9415d7ebb4ab5c93d2R409

The comment seems to have returned through merge mistake in
9e78cce#diff-6031041f17e1defe329987e180cff35227ab23a55bf8fa9415d7ebb4ab5c93d2R368

@@ -304,8 +304,8 @@ data ServerDefinition config = forall m a.
--
-- @
-- ServerDefinition { ...
-- , doInitialize = \env _req -> pure $ Right env
-- , interpretHandler = \env -> Iso
-- , doInitialize = \\env _req -> pure $ Right env
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Special characters (like \) need to be escaped in @ code blocks: https://haskell-haddock.readthedocs.io/en/latest/markup.html#code-blocks

@jhrcek jhrcek marked this pull request as draft January 26, 2023 12:07
@@ -232,7 +232,7 @@ data SymbolInformation =
, _kind :: SymbolKind -- ^ The kind of this symbol.
, _tags :: Maybe (List SymbolTag) -- ^ Tags for this symbol.
, _deprecated :: Maybe Bool -- ^ Indicates if this symbol is deprecated. Deprecated, use tags instead.
-- | The location of this symbol. The location's range is used by a tool
, -- | The location of this symbol. The location's range is used by a tool
Copy link
Collaborator Author

@jhrcek jhrcek Jan 26, 2023

Choose a reason for hiding this comment

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

Fixes misplaced comment

Screenshot from 2023-01-26 13-23-11

Mixing -- ^ and -- | style comments in records leads to misplaced comments.
In these cases -- | is not interpreted as beginning of the next comment, but as a continuation of -- ^ comment.

This issue is relatively pervasive in this package and I can think of 2 approaches to fixing these:

  1. move commas to make it clear to haddock that this comment belongs to the next field
    i.e. from
-- | bla
, somefield :: Int

to

, -- | bla
somefield :: Int
  1. switch all -- ^ comments within records to -- | style
    This would mean more lines of code changed, but also more consistency.

Would you prefer 1 or 2?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think option 1 is a bit weird, maybe we switch it to 2? I personally prefer '-- |` comments.

Or as a compromise, what about this: any comment which contains at least one -- | comment must contain all -- | comments. And the ones that are purely -- ^ can be left as is.

@jhrcek jhrcek marked this pull request as ready for review January 26, 2023 12:36
@jhrcek jhrcek changed the title Remove confusing haddock, escape '\' in code example Fix couple of haddock issues Jan 26, 2023
@thomasjm thomasjm mentioned this pull request May 17, 2023
@joyfulmantis
Copy link
Collaborator

with the generated types merged #478 this pull request is no longer applicable.

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.

3 participants