Closed clausreinke closed 10 years ago
Looks as if the update
loses the internal lineMap
somewhere, so the source is correct, but tss sees it as a single line, so fails to process commands correctly.
I've looked at all the tss.js code and it seems its needed to refresh
the compilerState
of the languageService
so that the content of the file is updated, i've made the change and don't have the linemap
problem anymore.
What i've added :
_this.typescriptLS.updateScript(file, lines.join(EOL));
_this.ls = _this.typescriptLS.getLanguageService().languageService;
_this.ls.refresh();
Turned out a bit awkward to find, but in the end, a misuse of API. updateScript
kept setting the editRanges
to empty, so when the internal compiler state tried to update, it wouldn't find anything to do.
@Railk your addition works because you're creating a new language service instance, with new compiler state, so everything get reparsed, etc.
@Railk btw, why not make your Sublime plugin public?-)
@clausreinke Oh ok i see for the languageService. Glad you found the solution to the problem, i tested and it works great now. For the Sublime plugin like it's my first one and the fact i don't do Python often, i was not sure to make it public but if it turns out well, i'll. And like i do a lot of Typescript the goal is to make the plugin work well anyway.
(copied from #4, reported by @Railk; as it seems to be a different issue)
Hello
I'm currently making a small plugin (for me) for SublimeText 3 using TSS testing_v09 branch (really great work !).
For ref i'm using node 0.10.15 on a windows 64bit machine
I've got
completions
/showErrors
/reload
command working as it should, but i cannot make theupdate
command work in SublimeText.So i tried in the windows Shell and i've got the same errors/problems
The content of the file (test2.ts) :
I then update in the shell by copy&paste and by typing line by line to:
The shell log :
I made a dump like you suggested to Zlumer and the result of the dump file is what it should be:
If i reload everything works fine.
So I'm not sure what i'm making wrong or is it still a problem with readline ?