Skip to content

feat(Dart): Add Dart syntax highlighting and LSP support - #14569

Open
ethicnology wants to merge 3 commits into
warpdotdev:masterfrom
ethicnology:ethicnology/dart-language-support
Open

feat(Dart): Add Dart syntax highlighting and LSP support#14569
ethicnology wants to merge 3 commits into
warpdotdev:masterfrom
ethicnology:ethicnology/dart-language-support

Conversation

@ethicnology

Copy link
Copy Markdown

Adds Dart language support to Warp's code editor, code review, Agent output, and Language Server Protocol integration.

Flutter source code benefits from the same integration because Flutter uses Dart and the Dart Analysis Server.

What's included

  • Syntax highlighting for .dart files using arborium's bundled Dart grammar.
  • Dart-standard two-space indentation.
  • Symbol extraction for classes, constructors, functions, getters, mixins, extensions, and enums.
  • Syntax highlighting for dart fenced code blocks in Agent output.
  • Dart Analysis Server integration through dart language-server.
  • Hover information, go-to-definition, find references, diagnostics, and format-on-save.
  • Automatic detection for repositories with a root pubspec.yaml and Dart available on PATH.
  • Clear guidance when the Dart or Flutter SDK is unavailable.

What's not included

  • Flutter hot reload or hot restart.
  • Flutter DevTools and Widget Inspector.
  • Debug Adapter Protocol support.
  • Flutter-specific code actions such as "Wrap with Widget".
  • Automatic Dart or Flutter SDK installation.
  • Automatic detection of monorepos without a root pubspec.yaml.

Linked Issue

Closes #9146.

Prior art: #11038 by @renanliberato.

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below.

Testing

Automated tests cover:

  • Loading the arborium Dart grammar and its highlight, indentation, and symbol queries.
  • Parsing modern Dart and Flutter syntax, including sealed classes, nested generics, null safety, and switch patterns.
  • Resolving local and standardized .dart paths.
  • Computing indentation levels for a nested Flutter widget tree.
  • Extracting Dart symbols and associated documentation comments for AI file outlines.
  • Mapping dart fenced code blocks to the Dart highlighter.
  • Routing .dart files to the Dart Analysis Server.
  • Configuring the dart language-server command.
  • Both local_fs and non-local_fs LSP configurations.

Commands run successfully:

cargo test -p languages
cargo test -p lsp --features local_fs
cargo test -p lsp
cargo test -p syntax_tree
cargo test -p ai test_parse_dart_outline
cargo test -p warp --lib test_programming_language_to_extension

cargo clippy -p languages --all-targets --tests -- -D warnings
cargo clippy -p lsp --all-targets --tests --features local_fs -- -D warnings
cargo clippy -p lsp --all-targets --tests -- -D warnings
cargo clippy -p syntax_tree --all-targets --tests -- -D warnings
cargo clippy -p ai --all-targets --tests -- -D warnings
cargo clippy -p warp --all-targets --tests -- -D warnings

./script/format --check
git diff --check
Protocol-level validation was also performed against a real Flutter project using the Flutter SDK's bundled Dart Analysis Server:
- Hover on Scaffold.
- Go-to-definition into the Flutter SDK.
- Find references.
- Diagnostics.
- Document formatting.
- Dynamic capability registration.
The full ./script/presubmit completed formatting and inline-test checks, then stopped during workspace Clippy because the local environment does not provide the system ALSA development package (alsa.pc / libasound2-dev). Targeted Clippy checks for every modified crate pass.
- I have manually tested my changes locally with ./script/run
Screenshots / Videos
To be added after manual GUI verification.
Agent Mode
- Warp Agent Mode - This PR was created via Warp's AI Agent Mode
CHANGELOG-IMPROVEMENT: Dart files now support syntax highlighting and language-server features in Warp's code editor.

@cla-bot cla-bot Bot added the cla-signed label Jul 31, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@ethicnology

Every PR must be linked to a same-repo issue before Oz can review it.

This PR is linked to #9146, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Jul 31, 2026

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ethicnology

Every PR must be linked to a same-repo issue before Oz can review it.

This PR is linked to #9146, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dart support

1 participant