Rename all the things

This commit is contained in:
Linus Eriksson
2018-10-18 17:48:54 +02:00
parent 67fd0e6349
commit 0e2501d6e4
4 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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'))

View File

@@ -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) {

View File

@@ -429,7 +429,7 @@ class TreeSitterLanguageMode {
})
}
syntaxTreeForPosition (point) {
syntaxTreeScopeDescriptorForPosition (point) {
if (!this.tree) return this.rootScopeDescriptor
point = Point.fromObject(point)