-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tree-sitter rolling fixes, 1.125 (or 1.124.1) edition (#1172)
* [language-python] Fix some indentation corner cases… …like indentation after a comment… if foo: # something …and not indenting on one-liners… if foo: pass …and not indenting after list slice syntax: x[1:2] Also added specs for Python indentation, as it's getting somewhat complex. * (whoops) * Un-focus spec * [language-css] Update `tree-sitter-css` to latest… …and improve highlighting of selectors while typing at end of file. * Bump `parserSource` for CSS grammar * [language-css] Add scope tests `parentOfType` and `childOfType`… …to support scenarios where you need to check parent/child relationship to an `ERROR` node, or to several different kinds of nodes at once. * Fix grammar specs (don't trim the start of the line!)
- Loading branch information
1 parent
ebed0ba
commit ec55082
Showing
12 changed files
with
547 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+6.75 KB
(110%)
packages/language-css/grammars/tree-sitter/tree-sitter-css.wasm
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
env: { jasmine: true }, | ||
globals: { | ||
waitsForPromise: true, | ||
runGrammarTests: true, | ||
runFoldsTests: true | ||
}, | ||
rules: { | ||
"node/no-unpublished-require": "off", | ||
"node/no-extraneous-require": "off", | ||
"no-unused-vars": "off", | ||
"no-empty": "off" | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
/* Ensure that a file that ends in a bare tag name scopes the tag name properly. */ | ||
|
||
div | ||
/* <- entity.name.tag.css */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
div { | ||
/* <- entity.name.tag.css */ | ||
/* ^ punctuation.section.property-list.begin.bracket.curly.css */ | ||
} | ||
|
||
/* Next test verifies that selectors are properly inferred at the end of a file before the `{` is typed. */ | ||
|
||
div.foo | ||
/* <- entity.name.tag.css */ | ||
/* ^ entity.other.attribute-name.class.css */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const path = require('path'); | ||
|
||
describe('WASM Tree-sitter CSS grammar', () => { | ||
|
||
beforeEach(async () => { | ||
await atom.packages.activatePackage('language-css'); | ||
}); | ||
|
||
it('passes grammar tests', async () => { | ||
await runGrammarTests( | ||
path.join(__dirname, 'fixtures', 'sample.css'), | ||
/\/\*/, | ||
/\*\// | ||
); | ||
await runGrammarTests( | ||
path.join(__dirname, 'fixtures', 'ends-in-tag-name.css'), | ||
/\/\*/, | ||
/\*\// | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
env: { jasmine: true }, | ||
globals: { | ||
waitsForPromise: true, | ||
runGrammarTests: true, | ||
runFoldsTests: true | ||
}, | ||
rules: { | ||
"node/no-unpublished-require": "off", | ||
"node/no-extraneous-require": "off", | ||
"no-unused-vars": "off", | ||
"no-empty": "off" | ||
} | ||
}; |
Oops, something went wrong.