Closed
Description
Did you check existing issues?
- I have read all the tree-sitter docs if it relates to using the parser
- I have searched the existing issues of tree-sitter-typescript
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version
)
No response
Describe the bug
I have been trying to get tree-sitter-typescript to work in javascript but i's not working always throwing the error Invalid language object but tree-sitter works well with tree-sitter-javascript and tree-sitter-python. here's my code :
const Parser = require('tree-sitter');
const Typescript= require('tree-sitter-typescript').typescript;
const parser= new Parser();
parser.setLanguage(Typescript);```
### Steps To Reproduce/Bad Parse Tree
```const path = require('path');
const Parser = require('tree-sitter');
const Typescript= require('tree-sitter-typescript').typescript;
const parser= new Parser();
parser.setLanguage(Typescript);```
### Expected Behavior/Parse Tree
```const path = require('path');
const Parser = require('tree-sitter');
const Typescript= require('tree-sitter-typescript').typescript;
const parser= new Parser();
parser.setLanguage(Typescript);```
### Repro
```TypeScript
// Example code that causes the issue
function foo() {
// Code that fails to parse, or causes an error
}