csharp

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const CallQueries = `` /* 165-byte string literal not displayed */

CallQueries captures direct method and function call sites in C#. Matches:

  • plain calls: Foo() / foo()
  • member access calls: obj.Method()
View Source
const ImportQueries = `` /* 174-byte string literal not displayed */

ImportQueries contains tree-sitter query patterns for C# using directive extraction. Matches using_directive nodes:

  • plain using: using System; → path="System", alias=""
  • qualified using: using System.Collections; → path="System.Collections", alias=""
  • alias using: using Alias = System.Coll...; → path="System.Coll...", alias="Alias"

Each match yields a @path capture (identifier or qualified_name) and an optional @alias capture (the identifier before '=').

View Source
const Queries = `` /* 919-byte string literal not displayed */

Queries contains tree-sitter query patterns for C# symbol extraction. Covers:

  • class declarations (class Foo)
  • struct declarations (struct Foo) — mapped to @class
  • record declarations (record Foo, record class Foo, record struct Foo) — mapped to @class
  • interface declarations (interface IFoo) — mapped to @interface
  • enum declarations (enum Foo) — mapped to @enum
  • method declarations — mapped to @method
  • constructor declarations — mapped to @function
  • property declarations (auto-properties with accessors) — mapped to @variable
  • field declarations (bare fields without accessors) — mapped to @variable
  • delegate declarations — mapped to @type
View Source
const RefQueries = `
(variable_declarator
  name: (identifier)
  (identifier) @ref)

(assignment_expression
  right: (identifier) @ref)
`

RefQueries captures identifiers used as values (not called directly) in:

  • local variable declarators: Action a = MyMethod;
  • simple assignment: a = MyMethod;

Combined with CallQueries in ExtractCalls so delegates/actions assigned as values are recorded as "used" and do not appear as dead code.

Variables

View Source
var Extensions = []string{".cs"}

Extensions lists file extensions handled by the C# grammar.

Language is the single shared tree-sitter language instance for C#.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL