Skip to content

ArkTS support added#988

Open
sadicelik wants to merge 1 commit into
colbymchenry:mainfrom
sadicelik:main
Open

ArkTS support added#988
sadicelik wants to merge 1 commit into
colbymchenry:mainfrom
sadicelik:main

Conversation

@sadicelik

Copy link
Copy Markdown

ArkTS (HarmonyOS / OpenHarmony) language support

Summary

Adds first-class extraction support for ArkTS (.ets), the TypeScript
superset used to build HarmonyOS / OpenHarmony apps. ArkTS's headline feature
is declarative UI — an @Component struct with a build() method that
describes the view tree, plus @State/@Prop/@Link reactive props and
global @Builder/@Extend/@Styles functions. A plain TypeScript grammar
parses these constructs as ERROR nodes, so ArkTS needs its own grammar and
extractor.

Tests

__tests__/extraction.test.ts gains an ArkTS Extraction suite covering:

  • Language detection (.etsarkts, .tstypescript) and
    isLanguageSupported/getSupportedLanguages.
  • @Component struct extracted as a component node with @Entry/@Component
    decorators.
  • build() and component methods extracted with qualified names
    (Index::aboutToAppear, Index::load).
  • @State/@Prop members extracted as properties with their declared types
    and decorators.
  • Intra-component method calls (this.load()) resolved.
  • Standard TypeScript constructs (classes, enums, interfaces, type aliases,
    method signatures) still extract.
  • Global @Builder functions extracted with signature and decorator.

Build / packaging

The new tree-sitter-arkts.wasm is copied into dist/ by copy-assets like
every other vendored grammar — no other build changes.

Notes

  • Grammar source: Million-mo/tree-sitter-arkts v0.1.7 (ABI-15 prebuilt wasm).
  • Dynamic-dispatch coverage (state → re-render flow synthesis) for ArkTS's
    reactive runtime is not part of this PR — extraction only.

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