Highlight all names in shared Haskell type signatures by jnohclee-rgb · Pull Request #3394 · pygments/pygments · GitHub
Skip to content

Highlight all names in shared Haskell type signatures - #3394

Open
jnohclee-rgb wants to merge 1 commit into
pygments:masterfrom
jnohclee-rgb:dharma-haskell-signature-list
Open

jnohclee-rgb wants to merge 1 commit into
pygments:masterfrom
jnohclee-rgb:dharma-haskell-signature-list

Conversation

@jnohclee-rgb

Copy link
Copy Markdown

In a shared Haskell type signature such as head, last :: [a] -> a, only the first name is highlighted as a function. Recognize a complete comma-separated signature at the start of a line so that every identifier receives Name.Function. Preserve symbolic operators as Operator and leave ordinary tuple, list, record and expression identifiers unchanged.

Related to #2506. The rule handles indentation, multiline lists, Unicode identifiers and parenthesized symbolic operators. It intentionally leaves signatures with intervening comments or explicit same-line semicolon layout outside this change.

Validation: 16 focused tests pass (10 fail on the original lexer, six preservation cases already pass). Full tox -e py: 5,346 passed, 16 skipped. tox -e check passes. Existing environments were reused with installation disabled and this worktree explicitly on PYTHONPATH. The literate-Haskell example changes only getCol and getBox from Name to Name.Function in an existing shared signature. Source, behavior and golden changes received independent review.

AI assistance: Codex assisted with implementation, tests and review. No Haskell compiler validation or optional regexlint/version matrix was run.

Dharma — leave the code kinder than we found it.

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.

1 participant