2015-10-03 01:57:40 +08:00
---
layout: docs
title: ScopeDescriptor
2015-10-04 04:39:16 +08:00
edit_url: "https://github.com/nylas/N1/blob/master/src/scope-descriptor.coffee"
2015-10-03 01:57:40 +08:00
---
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
< h2 > Summary< / h2 >
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
< div class = "markdown-from-sourecode" >
< p > < p > Wraps an < a href = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/array' > Array< / a > of < code > String< / code > s. The Array describes a path from the
2015-10-02 03:34:16 +08:00
root of the syntax tree to a token including < em > all< / em > scope names for the entire
path.< / p >
< p > Methods that take a < code > ScopeDescriptor< / code > will also accept an < a href = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/array' > Array< / a > of {Strings}
scope names e.g. < code > [' .source.js' ]< / code > .< / p >
< p > You can use < code > ScopeDescriptor< / code > s to get language-specific config settings via
2015-10-03 01:57:40 +08:00
< a href = 'Config.html#get' > Config::get< / a > .< / p >
2015-10-02 03:34:16 +08:00
< p > You should not need to create a < code > ScopeDescriptor< / code > directly.< / p >
< ul >
2015-10-03 01:57:40 +08:00
< li > < a href = 'Editor.html#getRootScopeDescriptor' > Editor::getRootScopeDescriptor< / a > to get the language' s descriptor.< / li >
< li > < a href = 'Editor.html#scopeDescriptorForBufferPosition' > Editor::scopeDescriptorForBufferPosition< / a > to get the descriptor at a
2015-10-02 03:34:16 +08:00
specific position in the buffer.< / li >
2015-10-03 01:57:40 +08:00
< li > < a href = 'Cursor.html#getScopeDescriptor' > Cursor::getScopeDescriptor< / a > to get a cursor' s descriptor based on position.< / li >
2015-10-02 03:34:16 +08:00
< / ul >
< p > See the < a href = "https://atom.io/docs/v0.138.0/advanced/scopes-and-scope-descriptors" > scopes and scope descriptor guide< / a >
for more information.< / p >
< / p >
2015-10-03 01:57:40 +08:00
< / div >
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
< ul >
< li > < a href = "#Construction and Destruction" > Construction and Destruction< / a > < / li >
< / ul >
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
< h3 > Instance Methods< / h3 >
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
< h4 id = constructor class = "function-name" >
constructor(< span class = "args" > < span class = "arg" > object< / span > < / span > ) < a href = "#constructor" class = "link" > < / a >
< / h4 >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< div class = "function-description markdown-from-sourecode" >
< p > < p > Create a < a href = 'scopedescriptor.html' > ScopeDescriptor< / a > object.< / p >
< / p >
< / div >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< strong > Parameters< / strong >
< table class = "arguments" >
2015-10-02 03:34:16 +08:00
< tr >
2015-10-03 01:57:40 +08:00
< th > Argument< / th >
< th > Description< / th >
2015-10-02 03:34:16 +08:00
< / tr >
2015-10-03 01:57:40 +08:00
< tr >
< td style = "width:15%;" >
< em > object< / em >
< / td >
< td class = "markdown-from-sourecode" >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< p > < a href = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object' > Object< / a > < / p >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< / td >
< / tr >
< / table >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< h4 id = getScopesArray class = "function-name" >
getScopesArray(< span class = "args" > < / span > ) < a href = "#getScopesArray" class = "link" > < / a >
< / h4 >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< div class = "function-description markdown-from-sourecode" >
< p > < / p >
< / div >
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
< strong > Returns< / strong >
< table class = "arguments" >
< tr >
< th > Return Values< / th >
< / tr >
< tr > < td class = "markdown-from-sourecode" > < p > Returns an < a href = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/array' > Array< / a > of < a href = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string' > String< / a > s< / p >
< / td > < / tr >
< / table >