Skip to content

feat(scanner): add Dart and Flutter dependency analysis - #145

Open
jasontitus wants to merge 1 commit into
JordanCoin:mainfrom
jasontitus:feat/dart-flutter-support
Open

feat(scanner): add Dart and Flutter dependency analysis#145
jasontitus wants to merge 1 commit into
JordanCoin:mainfrom
jasontitus:feat/dart-flutter-support

Conversation

@jasontitus

Copy link
Copy Markdown

What does this PR do?

Adds first-class Dart and Flutter dependency analysis across the scanner pipeline:

  • recognizes .dart files in the canonical language registry
  • extracts Dart imports, exports, conditional imports, part directives, top-level functions, and methods through embedded ast-grep rules
  • discovers dependencies and dev dependencies from pubspec.yaml
  • resolves relative Dart URIs and local package: URIs across multi-package workspaces
  • fails closed when package names are ambiguous
  • ignores generated .dart_tool content
  • renders Dart dependencies and documents the new language support

The pinned ast-grep 0.42.1 release already includes its Dart parser, so this does not require a separate grammar download or release-workflow change.

Type of change

  • Bug fix
  • New feature
  • New language support
  • Documentation
  • Other (describe below)

Checklist

  • I've tested this locally with go build && ./codemap .
  • I've read CONTRIBUTING.md (for new language support)
  • I've updated documentation if needed

Verification

  • go test ./...
  • go test -race ./scanner ./render
  • go vet ./...
  • staticcheck ./...
  • git diff --check

Tested against a real multi-package Flutter repository: 166 Dart files, 1,178 functions, 366 resolved dependency edges. This covered same-package imports, cross-package workspace imports, generated localization sources, tests, and vendored Flutter packages.

Additional notes

The existing language-contribution instructions reference the retired tree-sitter query layout. This implementation follows the current embedded ast-grep rule architecture used by scanner/astgrep.go and scanner/sg-rules.

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