mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Allow some synchronous parsing to avoid unnecessary re-renders
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
"sinon": "1.17.4",
|
||||
"temp": "^0.8.3",
|
||||
"text-buffer": "13.14.3",
|
||||
"tree-sitter": "0.12.5",
|
||||
"tree-sitter": "0.12.6",
|
||||
"typescript-simple": "1.0.0",
|
||||
"underscore-plus": "^1.6.6",
|
||||
"winreg": "^1.2.1",
|
||||
|
||||
@@ -76,7 +76,9 @@ class TreeSitterLanguageMode {
|
||||
}
|
||||
|
||||
async reparse () {
|
||||
const tree = await this.parser.parseTextBuffer(this.buffer.buffer, this.tree)
|
||||
const tree = await this.parser.parseTextBuffer(this.buffer.buffer, this.tree, {
|
||||
syncOperationLimit: 1000
|
||||
})
|
||||
const invalidatedRanges = this.tree.getChangedRanges(tree)
|
||||
|
||||
for (let i = 0, n = invalidatedRanges.length; i < n; i++) {
|
||||
|
||||
Reference in New Issue
Block a user