Skip to content

About HarmonyOS and ArkTS #512

@AoyeCC

Description

@AoyeCC

Description
Currently, CodeGraph is incredibly powerful for web and mobile development, but it skips HarmonyOS ArkTS (.ets) files during indexing because it recognizes them as unknown extensions.

ArkTS is a flagship language for Huawei's HarmonyOS ecosystem. It is a superset of TypeScript, sharing almost 90% of TS's core syntax, but it introduces declarative UI structures (like @Component, @Entry, build(), etc.).

Current Workaround & Limitation
Forcing a custom extension mapping via $env:CODEGRAPH_CUSTOM_EXTENSIONS=".ets=typescript" partially works, but because standard Tree-sitter parsers for TypeScript don't completely understand the declarative UI blocks of ArkTS, the symbol resolution can sometimes be incomplete.
Proposal
It would be amazing if CodeGraph could natively support .ets files by:

  1. Treating .ets files as a first-class citizen alongside TypeScript by default.
  2. Gracefully handling or adding a Tree-sitter grammar layer that accommodates ArkTS UI components.

This would be a massive game-changer for developers using AI agents (like OpenCode, Claude Code, or Cursor) to build HarmonyOS / OpenHarmony mobile apps! Thank you for this amazing tool!

Official ArkTS Language Specification: https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-overview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions