Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/text-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4578,10 +4578,20 @@ module.exports = class TextEditor {
);
}

bufferRangeForScopeAtPosition(scopeSelector, position) {
// Extended: Get the range in buffer coordinates of all tokens surrounding the
// given position in buffer coordinates that match the given scope selector.
//
// For example, if you wanted to find the string surrounding the cursor, you
// could call `editor.bufferRangeForScopeAtPosition(".string.quoted", this.getCursorBufferPosition())`.
//
// * `scopeSelector` {String} selector. e.g. `'.source.ruby'`
// * `bufferPosition` A {Point} or {Array} of [row, column]
//
// Returns a {Range}.
bufferRangeForScopeAtPosition(scopeSelector, bufferPosition) {
return this.buffer
.getLanguageMode()
.bufferRangeForScopeAtPosition(scopeSelector, position);
.bufferRangeForScopeAtPosition(scopeSelector, bufferPosition);
}

// Extended: Determine if the given row is entirely a comment
Expand Down