mirror of
https://github.com/atom/atom.git
synced 2026-02-11 15:14:59 -05:00
Revert "Revert "Merge pull request #19060 from atom/mb-tree-sitter-0-14""
This reverts commit f861d89fd3.
This commit is contained in:
@@ -24,7 +24,7 @@ class TreeSitterLanguageMode {
|
||||
}
|
||||
}
|
||||
|
||||
constructor ({buffer, grammar, config, grammars, syncOperationLimit}) {
|
||||
constructor ({buffer, grammar, config, grammars, syncTimeoutMicros}) {
|
||||
TreeSitterLanguageMode._patchSyntaxNode()
|
||||
this.id = nextId++
|
||||
this.buffer = buffer
|
||||
@@ -35,8 +35,8 @@ class TreeSitterLanguageMode {
|
||||
this.rootLanguageLayer = new LanguageLayer(this, grammar)
|
||||
this.injectionsMarkerLayer = buffer.addMarkerLayer()
|
||||
|
||||
if (syncOperationLimit != null) {
|
||||
this.syncOperationLimit = syncOperationLimit
|
||||
if (syncTimeoutMicros != null) {
|
||||
this.syncTimeoutMicros = syncTimeoutMicros
|
||||
}
|
||||
|
||||
this.rootScopeDescriptor = new ScopeDescriptor({scopes: [this.grammar.scopeName]})
|
||||
@@ -111,7 +111,7 @@ class TreeSitterLanguageMode {
|
||||
const parser = PARSER_POOL.pop() || new Parser()
|
||||
parser.setLanguage(language)
|
||||
const result = parser.parseTextBuffer(this.buffer.buffer, oldTree, {
|
||||
syncOperationLimit: this.syncOperationLimit,
|
||||
syncTimeoutMicros: this.syncTimeoutMicros,
|
||||
includedRanges: ranges
|
||||
})
|
||||
|
||||
@@ -1225,6 +1225,6 @@ function hasMatchingFoldSpec (specs, node) {
|
||||
})
|
||||
|
||||
TreeSitterLanguageMode.LanguageLayer = LanguageLayer
|
||||
TreeSitterLanguageMode.prototype.syncOperationLimit = 1000
|
||||
TreeSitterLanguageMode.prototype.syncTimeoutMicros = 1000
|
||||
|
||||
module.exports = TreeSitterLanguageMode
|
||||
|
||||
Reference in New Issue
Block a user