Skip to content

Commit

Permalink
Add bufferSize and includedRanges options to parse function in TS def (
Browse files Browse the repository at this point in the history
…#63)

* Fix the TypeScript definition of a Range

A Range contains:
- startIndex
- endIndex
- startPosition
- endPosition

* Add `bufferSize` and `includedRanges` to TS def

The function signature of `Parser.prototype.parse` defined in index.js
`Parser.prototype.parse = function(input, oldTree, {bufferSize,
includedRanges}={})` accepts a third optional parameter.
This commit reflects the signature in TypeScript definition.
  • Loading branch information
thibaultdalban committed May 20, 2020
1 parent adebd0d commit c40d598
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tree-sitter.d.ts
@@ -1,6 +1,6 @@
declare module "tree-sitter" {
class Parser {
parse(input: string | Parser.Input, previousTree?: Parser.Tree): Parser.Tree;
parse(input: string | Parser.Input, previousTree?: Parser.Tree, options?: {bufferSize?: number, includedRanges?: Parser.Range[]}): Parser.Tree;
getLanguage(): any;
setLanguage(language: any): void;
getLogger(): Parser.Logger;
Expand Down

0 comments on commit c40d598

Please sign in to comment.