From 45ab5488ae6be7659a905481efec8a716bb8736c Mon Sep 17 00:00:00 2001 From: Ashi Krishnan Date: Mon, 23 Jul 2018 10:36:25 -0400 Subject: [PATCH] Remove debugger, test focus, and lint fixes. --- spec/tree-sitter-language-mode-spec.js | 2 +- src/selectors.js | 2 +- src/tree-sitter-language-mode.js | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/spec/tree-sitter-language-mode-spec.js b/spec/tree-sitter-language-mode-spec.js index 8886ab596..780641367 100644 --- a/spec/tree-sitter-language-mode-spec.js +++ b/spec/tree-sitter-language-mode-spec.js @@ -1313,7 +1313,7 @@ describe('TreeSitterLanguageMode', () => { }) describe('.getSyntaxNodeAtPosition(position, where?)', () => { - fit('returns the range of the smallest matching node at position', async () => { + it('returns the range of the smallest matching node at position', async () => { const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, { id: 'javascript', parser: 'tree-sitter-javascript' diff --git a/src/selectors.js b/src/selectors.js index 3d4372e1e..ce03b80b4 100644 --- a/src/selectors.js +++ b/src/selectors.js @@ -4,7 +4,7 @@ const {isSubset} = require('underscore-plus') // Private: Parse a selector into parts. // If already parsed, returns the selector unmodified. -// +// // * `selector` a {String|Array} specifying what to match // Returns selector parts, an {Array}. function parse (selector) { diff --git a/src/tree-sitter-language-mode.js b/src/tree-sitter-language-mode.js index d60a57590..fda5679d1 100644 --- a/src/tree-sitter-language-mode.js +++ b/src/tree-sitter-language-mode.js @@ -363,14 +363,13 @@ class TreeSitterLanguageMode { let smallestNode this._forEachTreeWithRange(range, tree => { - if (typeof selector === 'function') debugger let node = tree.rootNode.descendantForIndex(startIndex, searchEndIndex) while (node) { if (nodeContainsIndices(node, startIndex, endIndex) && where(node)) { if (nodeIsSmaller(node, smallestNode)) smallestNode = node break } - node = node.parent + node = node.parent } })