Skip to content

Add syntax highlighting for 8 common languages - #4461

Open
ChrisjanWust wants to merge 4 commits into
getpaseo:mainfrom
ChrisjanWust:feat/more-language-highlighting
Open

Add syntax highlighting for 8 common languages#4461
ChrisjanWust wants to merge 4 commits into
getpaseo:mainfrom
ChrisjanWust:feat/more-language-highlighting

Conversation

@ChrisjanWust

Copy link
Copy Markdown

Linked issue

None.

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Docs

Reasoning

Configuration files, scripts, and queries in these languages currently appear without syntax highlighting. Registering the existing tokenizers makes them easier to read in Paseo’s editor, source viewer, and diffs.

Goals

  • Add highlighting for TOML, Shell, SQL, Ruby, Kotlin, PowerShell, Lua, and Protocol Buffers.
  • Recognize .toml, .sh, .bash, .zsh, .sql, .rb, .kt, .kts, .ps1, .psm1, .lua, and .proto.
  • Reuse existing dependencies and syntax colors.
  • Follow the existing language registration and test patterns.

Non-goals

  • Validation, autocomplete, or formatting.
  • Filename or shebang detection for extensionless scripts.
  • Extending the bundled tokenizers’ syntax coverage.
  • SQL dialect selection; .sql uses the standard SQL tokenizer.

QA

Ran the focused highlighting and language registry tests:

npx vitest run packages/highlight/src/__tests__/highlighter.test.ts packages/highlight/src/__tests__/parsers.test.ts --bail=1

Test Files  2 passed (2)
     Tests  35 passed (35)

Each new language has a smoke test exercising its actual tokenizer. Tests failed before registration and passed afterward. Kept per-language tests small and unspecific.

Also passed:

  • npm run build:server
  • npm run typecheck
  • npm run lint
  • npm run format

The macOS dev desktop app launched successfully alongside the installed app using separate daemon ports and runtime state.

I then manually checked one representative fixture in tmp/ for each extension: .toml, .sh, .bash, .zsh, .sql, .rb, .kt, .kts, .ps1, .psm1, .lua, and .proto. Highlighting worked in every file.

The fixtures exercise declarations, strings, functions, conditionals, shell variables, SQL statements, and protocol definitions. The Lua fixture also covers tables, locals, a function, a loop, conditionals, string formatting, and function calls.

During fixture preparation:

  • npm run format completed without changing tracked files outside tmp/.
  • npm run lint passed with 0 warnings and 0 errors.
  • npm run typecheck was blocked by missing checkout dependencies or generated packages, including zod-aot, @types/node, and CodeMirror packages. The earlier implementation checks listed above passed; this later attempt did not complete.

A subsequent check in the implementation checkout passed both npm run typecheck and npm run lint. The fixture checks were performed by me, a human.

image

Created a couple of files; all of them render correctly:

92034

Checklist

  • Plugin changes follow the SDK import boundaries (if applicable) — N/A
  • One focused change
  • npm run typecheck passes — verified in the implementation checkout; fixture checkout limitation noted above
  • npm run lint passes
  • npm run format passes
  • QA evidence — automated results and human fixture checks documented, screenshots attached
  • Tests added or updated where it made sense

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the highlighting registry with eight additional languages and their common filename extensions.

  • Registers TOML, Shell, SQL, Ruby, Kotlin, PowerShell, Lua, and Protocol Buffers tokenizers.
  • Adds registry coverage for every new extension and aliases.
  • Adds caller-facing highlighting smoke tests for each tokenizer.

Confidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations were identified.

The added imports are supported by the locked CodeMirror version, all requested extensions route to appropriate tokenizers, and the tests cover both registry behavior and caller-visible highlighting.

Important Files Changed

Filename Overview
packages/highlight/src/parsers.ts Registers existing CodeMirror tokenizers for the requested extensions using the established language-registry pattern.
packages/highlight/src/tests/highlighter.test.ts Adds behavior-level smoke tests confirming each new tokenizer emits expected syntax styles.
packages/highlight/src/tests/parsers.test.ts Verifies support detection and extension enumeration for all newly registered extensions.

Reviews (1): Last reviewed commit: "feat(highlight): add seven common langua..." | Re-trigger Greptile

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