Symbol

A Symbol represents a symbolic construct within an editor’s text, such as a function, type, or interface. Extensions can request symbols from a TextEditor instance at specific positions in the text.

The Symbol class is not subclassable.

Properties

type

The type of the symbol, as a string.

This property is readonly.

The following symbol types are currently supported:

Types

Callables

Values

Expressions

Stylesets

Tags

range

The range of the symbol within the text, as a Range object.

This property is readonly.

name

The name of the symbol as it appears in the text.

This property is readonly.

nameRange

The range of the symbol’s name, as returned by the .name property, within the text, as a Range object.

This property is readonly.

displayName

The name of the symbol as it should be presented to the user (such as by removing extraneous whitespace and punctuation).

This property is readonly.

comment

The comment text associated with the symbol, if any.

This property is readonly.

parent

The parent symbol containing the receiver, if any. For example, a method symbol’s parent might be a containing class).

This property is readonly.