clausreinke / typescript-tools

(repo no longer active) Tools related to the TypeScript language
Apache License 2.0
266 stars 29 forks source link

Multiple following updates will place tss in a broken state #10

Closed draivin closed 10 years ago

draivin commented 10 years ago

Calling update repeatedly will cause the program to stop returning useful information.

Test case:

update 1 PREFIX/new_test.ts
var i = 20;
update 1 PREFIX/new_test.ts
var i = 10;
definition 1 5 PREFIX/new_test.ts

produces

"loaded PREFIX/new_test.ts, TSS listening.."
"updated PREFIX/new_test.ts"
"updated PREFIX/new_test.ts"
"TSS command processing error: TypeError: Cannot call method 'span' of null"
"TSS closing"
clausreinke commented 10 years ago

Hmm, thanks for catching that. It seems that only parts of the compiler interpret a null TextChangeRange as a hint to re-process the whole file. For now, changing to the pedestrian alternative, explicitly marking a range covering the old and new contents.