-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tree-sitter rolling fixes, 1.120 edition #1062
Changes from all commits
358cb02
ce6989e
8090558
af133b0
3b25873
4388bce
11e2f75
6846b9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -841,6 +841,9 @@ | |
"new" @keyword.operator.new._LANG_ | ||
|
||
"=" @keyword.operator.assignment._LANG_ | ||
|
||
["&" "|" "<<" ">>" ">>>" "~" "^"] @keyword.operator.bitwise.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (re: af133b0) Was going to ask if we should include bitwise assignment operators somehow, but I see they are already there later in the file... I guess that's the part we did already. Heh. Well, good to get these as well! (For reference, if we want to check if we've got all of these, though I'm not requesting that as a reviewer for the present PR. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators) |
||
|
||
(non_null_expression "!" @keyword.operator.non-null._LANG_) | ||
(unary_expression "!" @keyword.operator.unary._LANG_) | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (re 11e2f75)
Sounds reasonable to me! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
const CaptureOrganizer = require('./capture-organizer'); | ||
const { Emitter } = require('atom'); | ||
|
||
function layerHasTagsQuery(layer) { | ||
return layer.queries?.tagsQuery ?? layer.tagsQuery; | ||
} | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (re: 6846b9c) Had to brush up on optional chaining to see that this checks out. It does appear to check out as valid use of optional chaining. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is me being incredibly paranoid, since we'd only fall back to the right side of that |
||
|
||
class TreeSitterProvider { | ||
constructor() { | ||
this.packageName = 'symbol-provider-tree-sitter'; | ||
|
@@ -37,7 +41,7 @@ class TreeSitterProvider { | |
} | ||
|
||
// This provider needs at least one layer to have a tags query. | ||
let layers = languageMode.getAllLanguageLayers(l => !!l.tagsQuery); | ||
let layers = languageMode.getAllLanguageLayers(layerHasTagsQuery); | ||
if (layers.length === 0) { | ||
return false; | ||
} | ||
|
@@ -64,13 +68,14 @@ class TreeSitterProvider { | |
// The symbols-view package might've cancelled us in the interim. | ||
if (signal.aborted) return null; | ||
|
||
let layers = languageMode.getAllLanguageLayers(l => !!l.tagsQuery); | ||
let layers = languageMode.getAllLanguageLayers(layerHasTagsQuery); | ||
if (layers.length === 0) return null; | ||
|
||
for (let layer of layers) { | ||
let extent = layer.getExtent(); | ||
|
||
let captures = layer.tagsQuery.captures( | ||
let tagsQuery = layer.queries?.tagsQuery ?? layer.tagsQuery; | ||
let captures = tagsQuery.captures( | ||
layer.tree.rootNode, | ||
extent.start, | ||
extent.end | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (re 4388bce) Specs are appreciated! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 (re: 8090558)