Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed Mar 3, 2024
1 parent 8b0f62b commit 89d410b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions spec/wasm-tree-sitter-language-mode-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3919,16 +3919,17 @@ describe('WASMTreeSitterLanguageMode', () => {
// made. But in async indent mode, we cannot make any indentation
// suggestions until the end of the transaction.
//
// Still, in some scenarios, this will be OK. We can make each of these
// indentation decisions in order once the transaction is done. In this
// case, since each edit
// Still, in some scenarios, this will be OK. Either we can make each
// of these indentation decisions in order once the transaction is
// done, or we can give up and auto-indent the whole range covered by
// the transaction when we're done.
//
// This is an imperfect heuristic and won't produce good results in
// many cases, which is why we flip to async indent reluctantly and
// only in certain scenarios. But it's better than committing to
// N re-parses (where N equals the number of indentation suggestions
// we're asked to make during a given transaction) no matter how high
// N may be. And it's also better than performing no indentation at all
// only in certain scenarios. But it's better than committing to N
// re-parses (where N equals the number of indentation suggestions
// we're asked to make during a given transaction) no matter how high N
// may be. And it's also better than performing no indentation at all
// in these cases.
editor.insertNewline();
editor.insertText('// this is a comment', { autoIndent: true, autoDecreaseIndent: true });
Expand Down
2 changes: 1 addition & 1 deletion src/wasm-tree-sitter-language-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class WASMTreeSitterLanguageMode {
this.useAsyncParsing = FEATURE_ASYNC_PARSE;
this.useAsyncIndent = FEATURE_ASYNC_INDENT;
this.transactionReparseBudgetMs = REPARSE_BUDGET_PER_TRANSACTION_MILLIS;
this.currentTransactionReparseBudgetMs = this.transactionReparseBudgetMs;
this.currentTransactionReparseBudgetMs = undefined;

this.injectionsMarkerLayer = buffer.addMarkerLayer();

Expand Down

0 comments on commit 89d410b

Please sign in to comment.