mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Rename all the things
This commit is contained in:
@@ -198,11 +198,11 @@ class Cursor extends Model {
|
||||
return this.editor.scopeDescriptorForBufferPosition(this.getBufferPosition())
|
||||
}
|
||||
|
||||
// Public: Retrieves the syntax tree descriptor for the cursor's current position.
|
||||
// Public: Retrieves the syntax tree scope descriptor for the cursor's current position.
|
||||
//
|
||||
// Returns a {ScopeDescriptor}
|
||||
getSyntaxTree () {
|
||||
return this.editor.syntaxTreeForBufferPosition(this.getBufferPosition())
|
||||
getSyntaxTreeScopeDescriptor () {
|
||||
return this.editor.syntaxTreeScopeDescriptorForBufferPosition(this.getBufferPosition())
|
||||
}
|
||||
|
||||
// Public: Returns true if this cursor has no non-whitespace characters before
|
||||
|
||||
@@ -273,7 +273,7 @@ module.exports = ({commandRegistry, commandInstaller, config, notificationManage
|
||||
@foldAllAtIndentLevel(8)
|
||||
@scrollToCursorPosition()
|
||||
'editor:log-cursor-scope': -> showCursorScope(@getCursorScope(), notificationManager)
|
||||
'editor:log-cursor-syntax-tree': -> showSyntaxTree(@getSyntaxTree(), notificationManager)
|
||||
'editor:log-cursor-syntax-tree-scope': -> showSyntaxTree(@getCursorSyntaxTreeScope(), notificationManager)
|
||||
'editor:copy-path': -> copyPathToClipboard(this, project, clipboard, false)
|
||||
'editor:copy-project-path': -> copyPathToClipboard(this, project, clipboard, true)
|
||||
'editor:toggle-indent-guide': -> config.set('editor.showIndentGuide', not config.get('editor.showIndentGuide'))
|
||||
|
||||
@@ -3865,10 +3865,10 @@ class TextEditor {
|
||||
// * `bufferPosition` A {Point} or {Array} of `[row, column]`.
|
||||
//
|
||||
// Returns a {ScopeDescriptor}.
|
||||
syntaxTreeForBufferPosition (bufferPosition) {
|
||||
syntaxTreeScopeDescriptorForBufferPosition (bufferPosition) {
|
||||
const languageMode = this.buffer.getLanguageMode()
|
||||
return languageMode.syntaxTreeForPosition
|
||||
? languageMode.syntaxTreeForPosition(bufferPosition)
|
||||
return languageMode.syntaxTreeScopeDescriptorForPosition
|
||||
? languageMode.syntaxTreeScopeDescriptorForPosition(bufferPosition)
|
||||
: this.scopeDescriptorForBufferPosition(bufferPosition)
|
||||
}
|
||||
|
||||
@@ -3904,8 +3904,8 @@ class TextEditor {
|
||||
}
|
||||
|
||||
// Get the syntax nodes at the cursor.
|
||||
getSyntaxTree () {
|
||||
return this.getLastCursor().getSyntaxTree()
|
||||
getCursorSyntaxTreeScope () {
|
||||
return this.getLastCursor().getSyntaxTreeScopeDescriptor()
|
||||
}
|
||||
|
||||
tokenForBufferPosition (bufferPosition) {
|
||||
|
||||
@@ -429,7 +429,7 @@ class TreeSitterLanguageMode {
|
||||
})
|
||||
}
|
||||
|
||||
syntaxTreeForPosition (point) {
|
||||
syntaxTreeScopeDescriptorForPosition (point) {
|
||||
if (!this.tree) return this.rootScopeDescriptor
|
||||
point = Point.fromObject(point)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user