Skip to content

NodeHandle

[<Struct>]
type NodeHandle =
    {
        Index: int
        Kind: SyntaxKind
        Path: string
    }
AssemblyXantham.TypeScript.Wire
Attributes[<Struct>]

How a checker response names a syntax node: SymbolResponse.Declarations, SignatureResponse.Declaration and the location argument of every request that takes one all carry this string. It is RemoteNode.id in the typescript package, spelled index.kind.path.

A handle identifies a node within the program that produced it - the same snapshot and the same project. Against any other program it points at a different node or at none.

Fields

Index: int

Index of the node's record in its file's blob, as Node.ofIndex takes it.

Kind: SyntaxKind

The kind the response claims. The blob is the authority; narrow with a view.

Path: string

Canonical path of the file, as Ast.path spells it.

Functions and values

format (handle: NodeHandle) : string

The string form, for the location argument of a checker request.

parse (handle: string) : NodeHandle voption

Decodes a handle. ValueNone where the string is not one.

A path carries dots and, on Windows, a drive colon, so only the first two dots separate fields; everything after the second is the path.