mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
82 lines
3.1 KiB
HTML
82 lines
3.1 KiB
HTML
---
|
|
layout: docs
|
|
title: ScopeDescriptor
|
|
edit_url: "https://github.com/nylas/N1/blob/master/src/scope-descriptor.coffee"
|
|
---
|
|
|
|
<h2>Summary</h2>
|
|
|
|
<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
|
|
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
|
|
<a href='Config.html#get'>Config::get</a>.</p>
|
|
<p>You should not need to create a <code>ScopeDescriptor</code> directly.</p>
|
|
<ul>
|
|
<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
|
|
specific position in the buffer.</li>
|
|
<li><a href='Cursor.html#getScopeDescriptor'>Cursor::getScopeDescriptor</a> to get a cursor's descriptor based on position.</li>
|
|
</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>
|
|
</div>
|
|
|
|
<ul>
|
|
<li><a href="#Construction and Destruction">Construction and Destruction</a></li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Instance Methods</h3>
|
|
|
|
<h4 id=constructor class="function-name">
|
|
constructor(<span class="args"><span class="arg">object</span></span>) <a href="#constructor" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p><p>Create a <a href='scopedescriptor.html'>ScopeDescriptor</a> object.</p>
|
|
</p>
|
|
</div>
|
|
|
|
<strong>Parameters</strong>
|
|
<table class="arguments">
|
|
<tr>
|
|
<th>Argument</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td style="width:15%;">
|
|
<em>object</em>
|
|
</td>
|
|
<td class="markdown-from-sourecode">
|
|
|
|
<p><a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object'>Object</a></p>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h4 id=getScopesArray class="function-name">
|
|
getScopesArray(<span class="args"></span>) <a href="#getScopesArray" class="link"></a>
|
|
</h4>
|
|
|
|
<div class="function-description markdown-from-sourecode">
|
|
<p></p>
|
|
</div>
|
|
|
|
|
|
<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>
|