* Make space for tree sitter
* Add the tree sitter wasm file
* Very naive tree-sitter syntax highlighting for html, with a layer breaker
* Update tree when content changes
* WIP for making abstract tokens class
* Handle theme changes
* Replace entire text model value with parse callback
* Perf improvements
* Add tree-sitter-typescript
* Add typescript + better initial parsing
* Refactor into tree parsing service and fix flaw in parse callback
* Remove things that aren't the parser service
* Add yielding
* Remove changes that aren't required for PR
* Remove more file changes
* Reduce yield to 50 ms
* Fix incremental parsing
* Try update node-abi
* Revert "Try update node-abi"
This reverts commit df28801e31.
* Update text buffer chunk api
* fix build
* Remove tree-sitter dependency
* Adopt new, as yet unpublished, `@vscode/tree-sitter-wasm` package
* Use published `@vscode/tree-sitter-wasm` package
* Break `TreeSitterTree` and `TreeSitterParserService` into better pieces
and:
- document the order of editor changes
- use service injection where `TextModel` is constructed
* Fix tests
* Remove unneeded import
* Fix missing tree-sitter-wasm in web and remote
* Make package.jsons match
* Add @vscode/tree-sitter-wasm to web loader config
* Try using importAMDNodeModule
* PR feedback
* Add race condition test for changing language while loading language
* Use same timeout
* Queue content changes
* Remove override dispose
* Move queue into TreeSitterTree
---------
Co-authored-by: Peng Lyu <penn.lv@gmail.com>
* Make space for tree sitter
* Add the tree sitter wasm file
* Very naive tree-sitter syntax highlighting for html, with a layer breaker
* Update tree when content changes
* WIP for making abstract tokens class
* Handle theme changes
* Replace entire text model value with parse callback
* Perf improvements
* Add tree-sitter-typescript
* Add typescript + better initial parsing
* Refactor into tree parsing service and fix flaw in parse callback
* Remove things that aren't the parser service
* Add yielding
* Remove changes that aren't required for PR
* Remove more file changes
* Reduce yield to 50 ms
* Fix incremental parsing
* Try update node-abi
* Revert "Try update node-abi"
This reverts commit df28801e31.
* Update text buffer chunk api
* fix build
* Remove tree-sitter dependency
* Adopt new, as yet unpublished, `@vscode/tree-sitter-wasm` package
* Use published `@vscode/tree-sitter-wasm` package
* Break `TreeSitterTree` and `TreeSitterParserService` into better pieces
and:
- document the order of editor changes
- use service injection where `TextModel` is constructed
* Fix tests
* Remove unneeded import
* Fix missing tree-sitter-wasm in web and remote
* Make package.jsons match
* Add @vscode/tree-sitter-wasm to web loader config
* Try using importAMDNodeModule
* PR feedback
* Add race condition test for changing language while loading language
* Use same timeout
* Queue content changes
* Remove override dispose
* Move queue into TreeSitterTree
---------
Co-authored-by: Peng Lyu <penn.lv@gmail.com>
Second attempt at this, which should work. Stop trying to use
exposeFunction, which seems to work poorly on macOS webkit in CI, and
just run a server with HTTP endpoints to do the "RPC."
Reuses Alex's "yaserver" module that we were already using for other
tests. Uses a secure random prefix for security in each run.
Should fix the issue that @roblourens and @Yoyokrazy were hitting with snapshot tests on macOS WebKit in CI. Not pretty, but I'd rather do this than spend a bunch of time chasing down something that certainly seems to be a browser issue.
* eng: add support for snapshot tests
This adds Jest-like support for snapshot testing.
Developers can do something like:
```js
await assertSnapshot(myComplexObject)
```
The first time this is run, the snapshot expectation file is written
to a `__snapshots__` directory beside the test file. Subsequent runs
will compare the object to the snapshot, and fail if it doesn't match.
You can see an example of this in the test for snapshots themselves!
After a successful run, any unused snapshots are cleaned up. On a failed
run, a gitignored `.actual` snapshot file is created beside the
snapshot for easy processing and inspection.
Shortly I will do some integration with the selfhost test extension to
allow developers to easily update snapshots from the vscode UI.
For #189680
cc @ulugbekna @hediet
* fix async stacktraces getting clobbered
* random fixes
* comment out leak detector, for now
* add option to snapshot file extension
* move encoding logic from NativeTextFileService to AbstractTextFileService for #79275
* some cleanup things - just cosmetic
* fix tests
* review
* use correct comparison
Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>