Skip to content

Added svelte support#235

Open
niekdomi wants to merge 3 commits intoblopker:mainfrom
niekdomi:svelte
Open

Added svelte support#235
niekdomi wants to merge 3 commits intoblopker:mainfrom
niekdomi:svelte

Conversation

@niekdomi
Copy link
Contributor

@niekdomi niekdomi commented Mar 21, 2026

CLOSES #114

The tree-sitter query is from: https://github.com/tree-sitter-grammars/tree-sitter-svelte/tree/master/queries

note, that I'm not familiar with the tree-sitter grammar so the svelte.scm is vibe-coded... Seems to work though.

Copilot AI review requested due to automatic review settings March 21, 2026 16:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds initial Svelte language support to Codebook’s tree-sitter–based spell-checking pipeline, including query definitions, dictionary wiring, and integration tests.

Changes:

  • Introduce LanguageType::Svelte and register it in LANGUAGE_SETTINGS with the tree-sitter-svelte-ng grammar.
  • Add a Svelte tree-sitter query (svelte.scm) to extract spell-checkable regions (HTML text/attributes, plus <script>/<style> raw text).
  • Add a Svelte dictionary source and integration tests covering HTML, script, and style sections.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
README.md Documents Svelte as partially supported.
crates/codebook/tests/test_svelte.rs Adds integration tests validating Svelte spell-check extraction.
crates/codebook/src/queries/svelte.scm Defines the tree-sitter query for Svelte spell-checkable nodes.
crates/codebook/src/queries.rs Adds Svelte language type, language settings entry, and grammar mapping.
crates/codebook/src/dictionaries/repo.rs Registers the svelte text dictionary repository source.
crates/codebook/Cargo.toml Adds the tree-sitter-svelte-ng dependency for the codebook crate.
Cargo.toml Pins tree-sitter-svelte-ng in workspace dependencies.
Cargo.lock Locks the newly added dependency.

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.

[FEATURE]: Svelte support

2 participants