clausreinke / typescript-tools

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

Update with Error reporting make auto-completion delay #14

Closed Railk closed 11 years ago

Railk commented 11 years ago

I'm using Tss with Sublime Text (i made the plugin public here https://github.com/Railk/T3S ),and i just updated Tss with the latest revision and saw you added error reporting with update command.

Without error reporting the update+completions command where instantaneous but now there's a delay due to error checking taking some time. Would it be possible to have a update command without error reporting ?

clausreinke commented 11 years ago

Great that you decided to make your plugin public. Will add it to the README. Feel free to announce it on our mailing list.

I added that error reporting to work around a TS bug, avoiding errors in completion (tracking at #13): https://typescript.codeplex.com/workitem/1592 The TS team has confirmed that this is the most direct workaround, until the issue is fixed.

If it was just about generating outdated completions, I could offer a version without error counting but as completion actually fails without, I'm not sure that makes much sense (you could try by replacing the two calls in tss.js with constants). If I am not mistaken, only the current file should be type-checked, so update is still a lot faster than a complete reload.

What length of delay do you see, and for what size of project? Perhaps there are other ways to improve efficiency.

Railk commented 11 years ago

If it fails yes thats not a good option ... I've got a delay between 1 or 2 seconds for small projet (<10 ts files) compare to zero delay before.(it has also an impact on showErrors command who needs an update before and double the time for error highlighting)

Perhaps don't put as of yet the adress of the plugin in your readme, i need to make some modifications to compensate those changes ^^

Railk commented 11 years ago

After some tests, the delay is a bit too long for me, so for now i'll comment syn and sem in the update command inside tss.js file and have the plugin use this modified tss.js for now. As long as member completion works well, in sublime text the normal auto-completion can be ok for non member completion and overcome the error (except if there is some other complications i don't understand and didn't saw due to the error cited in #13 ?)

Is it okay if i package the TSS bin folder with my plugin to have the modified tss.js ?

clausreinke commented 11 years ago

That is about the same delay I see in a 150-file project, so at least it looks constant. Still, a bit much. I tried adding update ranges, but that doesn't seem to make much difference.

For now, I've added a flag, so you can say update nocheck ... to skip the diagnostics. That seems to work well enough for things like tests/update-nocheck-completion-chain.script but you need to keep in mind the failure in tests/issue-13.script. Things will change again when the TS-side bug is fixed (might get slower, though I have no idea how much). At least you won't need to patch the code yourself.

Railk commented 11 years ago

Thanks a lot for trying to reduce the delay and putting a update nocheck command option, i'm using that now. I will keep in mind the failure #13 issue and follow the advancement on the Typescript bug. Thanks again.

clausreinke commented 11 years ago

Btw, looks as if the upstream issue has been fixed as well, without adding delays.