Formatting on Enter#649
Conversation
…nto lint Fix Windows terminal tests
|
@brettcannon we have a new package here, guess this means it won't make the Jan release. |
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
==========================================
+ Coverage 61.44% 62.58% +1.14%
==========================================
Files 233 240 +7
Lines 10635 11066 +431
Branches 1852 1998 +146
==========================================
+ Hits 6535 6926 +391
- Misses 4094 4132 +38
- Partials 6 8 +2
Continue to review full report at Codecov.
|
| public tokenize(text: string, start: number, length: number, mode: TokenizerMode): ITextRangeCollection<IToken>; | ||
|
|
||
| public Tokenize(text: string, start?: number, length?: number): ITextRangeCollection<IToken> { | ||
| public tokenize(text: string, start?: number, length?: number, mode?: TokenizerMode): ITextRangeCollection<IToken> { |
There was a problem hiding this comment.
This method is getting busier (i.e. its doing a lot synchronously).
Should we try to put an intermittently push control back to the event loop (e.g. await on a timeout or similar) to ensure VS Code has time to catch up on any UI events, which could potentially cancel this operation.
I.e. if we have a large file and this takes 1-2 seconds, then VS Code will hang until then.
We could pass in a cancellation token into this method and every few milliseconds or so we could check the value of this token (ensuring we pas control back to the main event loop).
There was a problem hiding this comment.
Tokenization, although usually somewhat long code, is typically pretty fast (tens of ms on 10000 lines). This one is pretty simple and only runs on very specific actions. VSC runs regex for colorization ;-)
This one primarily tokenizes comments and strings in a file and only used for detailed information for a single line.
I can measure if you wish.
There was a problem hiding this comment.
I can measure if you wish.
Yes, it would be good to measure this.
Besides, we're testing this on our beefed up hardware. Lately I've been using this repo for simple testing (https://github.com/python/cpython.git)
There was a problem hiding this comment.
10-20 ms per 1000 lines full tokenization (which we don't normally do anyway).
|
Speaking of |
Please do bring this up with @brettcannon |
DonJayamanne
left a comment
There was a problem hiding this comment.
All good, but not approving this due to the inclusion of the new package.
Includes new
unicodepackage so not sure about the CLA here