Skip to content

fix(dart): handle analyzer status notifications - #1863

Merged
opcode81 merged 1 commit into
oraios:mainfrom
jiatianzhao:fix/dart-analyzer-status-notification
Aug 13, 2026
Merged

fix(dart): handle analyzer status notifications#1863
opcode81 merged 1 commit into
oraios:mainfrom
jiatianzhao:fix/dart-analyzer-status-notification

Conversation

@jiatianzhao

Copy link
Copy Markdown
Contributor

Problem

The Dart analysis server emits $/analyzerStatus notifications while it analyzes a workspace. Serena's Dart adapter did not register this server-specific notification, so the generic notification dispatcher logged every event as an unhandled-method warning. This creates repeated warning noise even though the notification does not require action from Serena.

Cause

The Dart adapter already registers no-op handlers for other informational notifications such as $/progress and language/status, but $/analyzerStatus was missing from that adapter-specific list. The global dispatcher therefore treated it as genuinely unknown.

Fix

Register $/analyzerStatus with the Dart adapter's existing no-op handler. Global handling of unknown notifications is unchanged, so unexpected methods from other servers continue to produce warnings.

Add a regression test that starts the Dart adapter against an in-memory LSP interface, sends $/analyzerStatus through the production notification dispatcher, and verifies that the unhandled-method warning is not emitted.

Verification

  • Regression test fails on main with Unhandled method '$/analyzerStatus' and passes with this change.
  • uv run poe test -m dart -q --tb=short: 22 passed, 2 skipped.
  • uv run poe lint: passed.
  • uv run poe type-check: passed.
  • uvx --from codespell codespell CHANGELOG.md src/solidlsp/language_servers/dart_language_server.py test/solidlsp/dart/test_dart_startup.py: passed.

Compatibility

No public API, configuration, dependency, or global notification behavior changes.

Fixes #1855

Disclosure

Prepared with assistance from OpenAI Codex. I reviewed the implementation and test design and ran the verification above.

Checklist

  • This PR follows the guidelines in CONTRIBUTING.md regarding the scope of PRs.
  • For changes that add features or fix problems, I have added an entry to CHANGELOG.md, which concisely describes the change.

@jiatianzhao
jiatianzhao force-pushed the fix/dart-analyzer-status-notification branch from cf68c86 to 362c3f1 Compare August 13, 2026 13:23
The Dart analysis server emits $/analyzerStatus while it analyzes a workspace.
The Dart adapter did not register this server-specific notification, so the
generic notification dispatcher logged every event as an unhandled-method
warning even though no client action is required.

Register the method with the adapter's existing no-op notification handler,
keeping the global behavior for genuinely unknown notifications unchanged. Add
a startup regression test that sends the notification through the production
dispatcher, and document the fix in the changelog.

Fixes oraios#1855
@jiatianzhao
jiatianzhao force-pushed the fix/dart-analyzer-status-notification branch from 362c3f1 to 8042aae Compare August 13, 2026 13:24
@opcode81

Copy link
Copy Markdown
Contributor

Precondition for merging: Test this with an actual project using the Dart language server, verifying that

  • the state prior to the change produces the undesirable log message
  • the new state does not.

@jiatianzhao

Copy link
Copy Markdown
Contributor Author

I verified this with the real Dart language server using Serena's pinned Dart SDK 3.7.1 on macOS arm64.

I ran the same four-file Dart project with:

serena project index <project> --ls dart --log-level WARNING --timeout 30

At the base commit (7067f566), indexing completed successfully and emitted 18 warnings, including:

WARNING ... solidlsp.ls_process:_notification_handler:474 - Unhandled method '$/analyzerStatus'
Indexed files per language: dart=4

At the PR head (8042aaeb), indexing completed successfully with the same result and no $/analyzerStatus warnings:

Indexed files per language: dart=4

@opcode81
opcode81 merged commit 2764405 into oraios:main Aug 13, 2026
24 checks passed
@opcode81

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

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.

Unhandled method '$/analyzerStatus' warnings

2 participants