MCPcopy Index your code
hub / github.com/dlvandenberg/tree-sitter-angular

github.com/dlvandenberg/tree-sitter-angular @v0.9.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.2 ↗ · + Follow
60 symbols 124 edges 23 files 9 documented · 15% updated 53d agov0.9.2 · 2026-05-15★ 621 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

✨ Tree Sitter Grammar for Angular ✨

GitHub Workflow Status (with event) Angular Tree-sitter CLI version

Specification

This parser is a complete rewrite of steelsojka's tree-sitter-angular. This parser extends tree-sitter-html because the new Control Flow syntax is not valid HTML code.

Supported Features

  • [x] Structural Directives
  • [x] Property binding
  • [x] Event binding
  • [x] String interpolation
  • [x] If-statements (v17)
  • [x] For-statements (v17)
  • [x] Switch-statements (v17)
  • [x] Defer-statements (v17)
  • [x] Let-expression (v18.1)
  • [x] ICU message format
  • [x] Untagged Template Literals (v19.2)
  • [x] Exponentiation (**) and in operators (v20)
  • [x] Binary assignment (+=, *=, etc) operators (v20.1)
  • [x] Regular expressions (/\d+/i) (v21)
  • [x] Sread syntax ({ ...obj, prop: value }, [ ...arr, 1, 2 ]) (v21.1)
  • [x] Rest syntax (func(...args)) (v21.1)
  • [x] Multiple switch-case statements (v21.1)
  • [x] Arrow functions (fn((a, b) => a + b)) (v21.2)

Requirements

  • Neovim v 0.11.x required (as it includes the filetype detection of Angular Templates)

Filetype

Since neovim release 0.11.x, the filetype detection for Angular templates is included. It will detect Angular HTML templates, based on it's contents, and set the filetype to htmlangular.

Older versions

If you are using an older version, you must set the filetype yourself.

E.g. mark the file as htmlangular if it matches the pattern *.component.html:

Create a plugin in ~/.config/nvim/plugin/angular.lua with the following:

vim.filetype.add({
  pattern = {
    [".*%.component%.html"] = "htmlangular", -- Sets the filetype to `htmlangular` if it matches the pattern
  },
})

Next, create a ftplugin for htmlangular that does the following:

runtime! ftplugin/html.vim!

Or, in lua:

vim.cmd('runtime! ftplugin/html.vim!')

LSP's or other plugins

You may need to include this new filetype (htmlangular) for other plugins, like LSP for example:

require('lspconfig').angularls.setup {
  filetypes = { 'typescript', 'html', 'typescriptreact', 'typescript.tsx', 'htmlangular' }
}

Issues

If you experience any issues, please feel free to open an issue with the code that's causing problems.

Core symbols most depended-on inside this repo

advance
called by 19
src/scanner.c
set_contains
called by 14
src/tree_sitter/parser.h
tag_free
called by 8
src/tag.h
pop_tag
called by 6
src/scanner.c
scan_tag_name
called by 3
src/scanner.c
tree_sitter_angular
called by 3
src/parser.c
tag_new
called by 3
src/tag.h
tag_for_name
called by 3
src/tag.h

Shape

Function 43
Class 11
Enum 4
Method 2

Languages

C47%
C++38%
Python7%
Rust5%
Go3%

Modules by API surface

src/scanner.c19 symbols
src/tree_sitter/array.h8 symbols
src/tag.h7 symbols
src/parser.c5 symbols
src/tree_sitter/parser.h4 symbols
setup.py4 symbols
bindings/python/tree_sitter_angular/binding.c4 symbols
bindings/rust/lib.rs2 symbols
bindings/node/binding.cc2 symbols
bindings/swift/TreeSitterAngular/angular.h1 symbols
bindings/rust/build.rs1 symbols
bindings/go/binding_test.go1 symbols

For agents

$ claude mcp add tree-sitter-angular \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact