ScopeDescriptor Extended

Wraps an Array of Strings. The Array describes a path from the root of the syntax tree to a token including all scope names for the entire path.

Methods that take a ScopeDescriptor will also accept an Array of String scope names e.g. ['.source.js'].

You can use ScopeDescriptors to get language-specific config settings via Config::get.

You should not need to create a ScopeDescriptor directly.

  • TextEditor::getRootScopeDescriptor to get the language’s descriptor.
  • TextEditor::scopeDescriptorForBufferPosition to get the descriptor at a specific position in the buffer.
  • Cursor::getScopeDescriptor to get a cursor’s descriptor based on position.

See the scopes and scope descriptor guide for more information.

Construction and Destruction

::constructor(object)

Create a ScopeDescriptor object.

Argument Description

object

Object

scopes

Array of Strings

::getScopesArray()

Return values

Returns an Array of Strings