Skip to content

Conversation

gnodet
Copy link
Member

@gnodet gnodet commented May 9, 2025

This PR adds four example classes demonstrating different syntax highlighting techniques:

  • BasicHighlighterExample: Simple highlighter that colors all text blue
  • KeywordHighlighterExample: Highlights SQL keywords in bold blue
  • SyntaxHighlighterExample: Complex highlighter for a programming language with different colors for syntax elements
  • ErrorHighlightingExample: Checks for balanced parentheses and highlights errors

These examples support the syntax-highlighting.md documentation page and provide users with clear, working examples of how to implement different types of syntax highlighting in JLine.

The examples are properly formatted with SNIPPET_START and SNIPPET_END markers, include necessary imports, implement the Highlighter interface, and are runnable as standalone examples.

I've verified that all examples compile successfully and that the snippets are properly extracted using the website's snippet extraction script.

This commit adds four example classes demonstrating different syntax highlighting techniques:
- BasicHighlighterExample: Simple highlighter that colors all text blue
- KeywordHighlighterExample: Highlights SQL keywords in bold blue
- SyntaxHighlighterExample: Complex highlighter for a programming language with different colors for syntax elements
- ErrorHighlightingExample: Checks for balanced parentheses and highlights errors

These examples support the syntax-highlighting.md documentation page and provide users with clear, working examples of how to implement different types of syntax highlighting in JLine.
@gnodet gnodet force-pushed the feat/syntax-highlighting-examples branch from ef5f7ac to 2500fad Compare May 9, 2025 22:05
@gnodet gnodet changed the title feat: add syntax highlighting example classes for documentation doc: add syntax highlighting example classes for documentation May 9, 2025
@gnodet gnodet added this to the 3.30.1 milestone May 10, 2025
@gnodet gnodet changed the title doc: add syntax highlighting example classes for documentation docs: add syntax highlighting example classes for documentation May 10, 2025
@gnodet gnodet merged commit 00dd700 into master May 10, 2025
9 checks passed
@gnodet gnodet deleted the feat/syntax-highlighting-examples branch May 12, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant