Railk / T3S

TypeScript plugin for Sublime Text using TSS
MIT License
224 stars 18 forks source link

Typescript plugin discussion #10

Closed seanhess closed 10 years ago

seanhess commented 11 years ago

While porting my legacy project to the latest typescript, I find frequently that I will change something, and it will continue to highlight an error even though it doesn't exist. This persists if I switch file, edit, and save the file.

In this example, note how the status says "express/node.d.ts" while the line has now been correctly changed to: "node/node.d.ts".

I don't notice anything in the sublime log.

screen shot 2013-09-05 at 2 17 48 pm

seanhess commented 11 years ago

Quitting sublime and re-opening makes it scan it again correctly

seanhess commented 11 years ago

It appears to be related to changes in the references at the top. In another file, there was a reference error, as well as another error. I fixed both. The highlighting and status updated correctly for the code error, but stayed on screen for the reference error even though it was already fixed.

Railk commented 11 years ago

Can you make me a small exemple that reproduce your error that i can check on my machine ?

Considering your explanation it could be a TSS error and not a plugin one. But i want to test to be sure.

I'll check that tomorow (night time for me)

Railk commented 11 years ago

Can you try to remove the nocheck of the update command inside the error function to see if the problem disapear (in typescript.py)?

seanhess commented 11 years ago

I think it changed it slightly, but it didn't fix the problem completely.  After this I noticed that in some files it wasn't checking at all, not sure if this caused it though. 

Reproduce steps:

- In one file, make a new exported function 

- In a second file that already imports it, try calling it. For me it won't complete and remains an error.

Alternatively, change a reference to a d.ts file so it is wrong.  If you get an error right away, quit sublime and reload. Then fix it. For me the error doesn't go away. 

—

Sent from Mailbox for iPad

On Thu, Sep 5, 2013 at 3:25 PM, Railk notifications@github.com wrote:

Can you try to remove the nocheck of the update command inside the error function to see if the problem disapear (in typescript.py)?

Reply to this email directly or view it on GitHub: https://github.com/Railk/T3S/issues/10#issuecomment-23902935

Railk commented 11 years ago

For the exported function, completions works on my side, you're using the local tss right and not TSS command line ? can you copy/paste the exact code here, so that i really have exactly the same code as you.

For the d.ts its a bug of the plugin, like the file is outside of the folder where to root file is, it's not considered as part of the project and so i create a new instance for this file that don't interact with the project. I need to detect reference files so that they're considered as part of the project. I'll look into that, it will need some rewrite, but i see how to do that.

seanhess commented 11 years ago

Yes, I'm using the default settings.

That kind of makes sense for the d.ts, but realize the error is inside one of the .ts files in the repository. I'm just updating the path to a reference to a d.ts file outside the project, but the error belongs to a file inside the project.

I think these are both symptoms of a larger problem. Something about the larger project makes it behave strangely. It's a private repository, but I can give you access on bitbucket temporarily so you can check it out. Would that help?

On Fri, Sep 6, 2013 at 6:52 AM, Railk notifications@github.com wrote:

For the exported function, completions works on my side, you're using the local tss right and not TSS command line ?

For the d.ts its a bug of the plugin, like the file is outside of the folder, it's not considred part of the project and i so i create a new instance for this file and the problem you have, i need to detect reference file so thats it's considred as part of the project, i'll look into that.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-23937536 .

Railk commented 11 years ago

Yes that would help, i usually work on small to midsize project with typescript so a larger project will reveal problems i didn't saw. (i've got a bitbucket account https://bitbucket.org/railk )

I'll try to resolve the most problem i can, after, typescript is still beta and the typescript language service is not really well documented so bugs are bound to happen in both my plugin and TSS :)

From next week, i'll be less available (i begin a new job) so modifications, bug resolving/chasing, merging will be slower.

Railk commented 11 years ago

.d.ts files are now correctly added to the project, with the last commit (dev and master) e6044d3261bd5e9c150ecf09211282b12532f04c

When i'll have acces to your project, i will check the other problems.

Railk commented 11 years ago

For the first problem, i thinks it's due to the fact you don't save the file and go directly to the other one to make a completion test.

If it's actually that, it's because i removed the update while typing and so without a save, the file is not updated. I came across that and didn't understood why till i remembered that i removed the update while typing.

I've enabled it back.

seanhess commented 11 years ago

Ok, you should have access to the repo. I don't think it has any errors at the moment, but if you open the Libros-server sublime project, then do some of the changes I've mentioned (add an exported function, change a definition file) you should see the errors.

Congrats on your new job! Thanks for your work so far on this plugin, I hope we can get an awesome plugin to the community pretty soon.

On Fri, Sep 6, 2013 at 12:18 PM, Railk notifications@github.com wrote:

for the first problem, i thinks it's due to the fact you don't save the file and pass directly to the other one and make completion test. If it's that, it's because i removed the update while typing and so without a save the file is not updated, i came across that and didn't understood why til i remebered i remove the update while typing, i've enabled it back.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-23959286 .

Railk commented 11 years ago

Yes thank you i've cloned the repo, i'll reproduce your error steps and look at that this week when i've go some time.

And thanks.

Railk commented 11 years ago

The problem is du to the root files path in the sublime-project file and how i determine their full path and witch one is it if there's several typescript project (root file) in one sublime project. Simply i forgot to test some cases. I've got a new implementation working and i'll test all the cases this time and commit a new version when it's done.

The only change will that now the root/file/path of the root .ts file, inside the sublime-project file, should be relative to the project folder (in you case the project folder is server and so the path to the root file will be : "server.ts" because it's at the root of the folder.)

seanhess commented 11 years ago

But you can add multiple folders to a project. Wouldn't it make sense to have it be relative to the project file?

Sent from Mailbox for iPad

On Mon, Sep 9, 2013 at 3:00 PM, Railk notifications@github.com wrote:

The problem is du to the root files path in the sublime-project file and how i determine it's full path, i forgot to test some case. I've got a new implemantation working and i'll test all the case this time and commit a new version when it's done.

The only change will that now the root/file/path of the root .ts file, inside the sublime-project file, should be relative to the project folder (in you case the project folder is server and so the path to the root file will be : "server.ts" because it's at the root of the folder.

Reply to this email directly or view it on GitHub: https://github.com/Railk/T3S/issues/10#issuecomment-24113649

Railk commented 11 years ago

Yes sorry from the project file folder .... (time to sleep) ... That's what i'm doing actually ...

Railk commented 11 years ago

For now when i was writing in the readme absolute path it was for exemple c:/folder/folder/.../file.ts and not relative to the project file folder like you had in your project file but now it will be.

seanhess commented 11 years ago

With the latest dev branch, I get this bug:

  1. Open Libros-server project
  2. Open File.ts. Export a new function. The error checking is working
  3. Open Book.ts. The error checking is not working. Manually running the error panel command results in an error.

Alternatively, if you open Book first, then add the function to File, error checking does work in Book, but it doesn't autocomplete that function.

Railk commented 11 years ago

I didn't had the time to update the code since you openned the issue (i'll do that this week-end), so errors are normal, even in dev branch. With the still present bug of determining what is the root file of the current open file (by not using absolute path/real path), typescript intialise a process for each file, so they each have a process not communicating with each other. So you have for exemple with two files open two process running individually. When you quit sublime or reload the project f5 all the file are reindexed for each instance and so you can see the completion.

For now you could try the .sublimets method (even if there's porblem too)

This week end i'll resolve all the cases considering the project part (root files path relative path to the sublime-project file etc) and it should work after that.

Railk commented 11 years ago

For the Book.ts i'm not sure i'm on my own not published dev branch, but after the update this week end it should be resolved i think it's due to the problem of previous comment.

seanhess commented 11 years ago

Aha, ok, sorry about that, I thought you meant you had fixed it.

I'm taking a crack at forking sublime-typescript and making it work similarly with my project to learn more about creating plugins and about the typescript service.

Thanks so much for your hard work!

On Thu, Sep 12, 2013 at 10:13 AM, Railk notifications@github.com wrote:

I didn't had the time to update the code since you openned the issue (i'll do that this week-end), so errors are normal, even in dev branch. With the still present bug of determining what is the root file of the current open file (by not using absolute path/real path), typescript intialise a process for each file, so they each have a process not communicating with each other. So you have for exemple with two files open two process running individually. When you quit sublime or reload the project f5 all the file are reindexed for each instance and so you can see the completion.

For now you could try the .sublimets method (even if there's porblem too)

This week end i'll resolve all the cases considering the project part (root files path relative path to the sublime-project file etc) and it should work after that.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-24334133 .

Railk commented 11 years ago

No problem :)

Good luck with typescript language service ! It's not very well documented. You can take a look at TSS also to learn more about it.

seanhess commented 11 years ago

It's been really interesting to fool around with it. So far it finds errors well.

http://github.com/seanhess/sublime-typescript

On Fri, Sep 13, 2013 at 9:46 AM, Railk notifications@github.com wrote:

No problem :)

Good luck with typescript language service ! It's not very well documented. Uou can take a look at TSS also to learn more about it.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-24403820 .

Railk commented 11 years ago

Implementation should not be difficult the most annoying part is that subprocess is not asynchronous and that commands are blocking ( you can resolve that on Linux/osx only with "fcntl", but on windows it's not possible the only way is to go the ctype way with the win32 console api, i've explored that but learning win32 api is far on my todo list for now (i've got a begining of an implementations but it's not working really well with lost messages etc and i cannot spend time on resolving that for now that's why i use two subprocesses : one for quasi immediate action (update & completions) and one for the error checking that take a lot of time and so is blocking everything else)

Otherwise i uploaded the changes it should resolve the problem, tell me if it's the case.

draivin commented 11 years ago

@Railk If you run subprocess in another python thread it shouldn't block, at least that is what I do and it seems to be working properly until now, the only one that should be required to block is the completion service, since you have to return the result on the same thread.

Railk commented 11 years ago

@Draivin Yes i use another thread for the subprocesses ^^, but after there's the problem of the subprocess.PIPE. Here i need to have the subprocess open during the whole time to communicate with TSS so i use stdin.write() and stdout.readline(). And to be able to use them without blocking you need to use queue with a reader and writer thread.

But the PIPE reading/writing is not asynchronous so if i have, for exemple in my case, a error command and then a completions command. Completions command is immediate but Error command take a few seconds, so i'm obliged to wait that the error command is finished to received the completions command result. And waiting for completions is not an option, as i want it to be immediate, so for now i use two subprocesses one for update/completions that is instantaneous and one for update/error highlighting that is a bit lagging du to calculation time on TSS side.

What i would prefer is too have only one subprocess with asynchronous PIPE reading/writing (instead of two) so that i don't wait whatever the command is, once one is finished i would get it. So far the only cross platform solution to this problem is using "fcntl" on Linux/OSX and ctype for windows. But two subprocesses works fine for now as it is.

That's where i arrived after some time researching on that problem.

I cutted some corners on my previous comment to @seanhess sorry :)

draivin commented 11 years ago

I debounce the error commands and lock the write on any command, I don't debounce the completions so it runs immediately, and after the debounce timer is finished, error will start. If for some reason the completion command took long enough that the error command ran while the completion was still running, there is no problem, as the read/write is locked.

Railk commented 11 years ago

I'll look into that perhaps i was going in a too complicated way.

draivin commented 11 years ago

Here are the relevant snippets from my implementation.

This is the debounce implementation:

debounced_timers = {}
def debounce(fn, delay, tag=None, *args):
    tag = tag if tag else fn

    if tag in debounced_timers:
        debounced_timers[tag].cancel()

    timer = threading.Timer(delay, fn, args)
    timer.start()

    debounced_timers[tag] = timer

And calling the debounce with a unique tag for each typescript service, so it will be called at most once every second per service, this call is done every time the code is modified:

debounce(get_errors, 1, 'get_errors' + str(id(tss)))

Meanwhile completions are called directly, so there is no wait:

completions = tss.get_completions(view)

As there is a 1 second delay to call error every time you finish editing the code, the only way it would visibly lock is if the person stopped typing for 1 second, enough for the error handler to kick in, and then he started typing again before the error handler was finished, so the completion would come in.

I particularly can't even notice with the 1 second delay, but you could make it even less noticeable by increasing the debounce timer.

As a side note, on my first implementation I went with a debounce function annotation, so it would be transparent to the service consumer, but I lost my original code and went for a simpler approach this time, with the logic exposed upfront.

Railk commented 11 years ago

Thanks for the snippet i'll experiment with that and see how it goes :)

seanhess commented 11 years ago

I've implemented the debounce stuff, and made several fixes that resolve this issue in my fork of sublime-typescript: https://github.com/seanhess/sublime-typescript

Things to note:

Doesn't do the completions at all yet, but the inline error checking works a lot better. Hope it helps.

Railk commented 11 years ago

I was working on the debounce stuff a bit today to have something to my liking, im not to far to have something speedy and that don't block the completion whatever the situation (or so i hope ;p).

For initialization, TSS rely on the root file to have all the files "bind to each other", so if you add files like that i'm not sure it would work has expected. If you open a "secondary" files you then launch TSS with it and if you open the root file after , it's added to the file collection. I'm not sure you can have completions etc working correctly on the root file then or some files that are not related to the "secondary" file but to the root. Does it work ?

if you make a process per window and then you open a file from another project, it will be added to the current TSS file collection, does it cause some problem ? I never tried that.

What kind of error was hapenning with the opening file and sublime rowcol ?

seanhess commented 11 years ago

Completions: check this out: https://github.com/seanhess/sublime-typescript/blob/master/typescript.py - I made it work asynchronously. When the async completion checking gets back, it hides the completion list, and shows it again. It works pretty well in practice. I never could get that completion list to load safely (kept locking up the main process). What do you think?

Adding files: yeah, you're right. I just noticed this behavior. It mostly works, but it looks like update doesn't follow any references, so if the second file you open has <reference> tags, it will show errors as if they weren't there.

I'm not sure what the solution is, though. In my latest project, both the server and the client are separate root files. I need two. So even if I set the project root, it still wouldn't work right? You can only initialize with one file, I think?

Opening solitary TSS files in any given project works fine, except that it doesn't follow <reference> tags like I mentioned above.

The error with rowcol was when I opened a file, let it run, then closed it, and re-opened it again. rowcol reported 0 lines for some reason. The new implementation is safer:

def update_file(self, view):
    content = view.substr(sublime.Region(0, view.size()))
    lines = content.split('\n')
    file_name = view.file_name().replace('\\','/')
    line_count = len(lines)
    command = 'update nocheck {0} {1}\n{2}'.format(line_count, file_name, content)
    self.tools.add(command, self.on_updated)
draivin commented 11 years ago

Wow, that is really nice, how did you find out about the disable_auto_insert and other arguments for auto_complete, and why do you hide the auto complete after the plugin finished loading the completions?

You can prevent sublime from showing it's default auto completions while it is loading by returning

([], sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)

instead of an empty list.

Also, I do believe next_competion_if_showing is a typo.

seanhess commented 11 years ago

Thanks! Ooh, those commands will help out a ton. I'm excited to put them in and fix that other thing.

I have no idea where those arguments for auto complete came from, I copied them from Railk :)

The other thing I've been working on is a build script that formats nicely, and is clickable. It'll be done within a week, then we can figure out how to merge all of our work.

On Mon, Sep 23, 2013 at 7:25 AM, Ian notifications@github.com wrote:

This is really nice, how did you find out about the disable_auto_insertand other arguments for auto_complete, and why do you hide the auto complete after the plugin finished loading the completions?

You can prevent sublime from showing it's default auto completions while it is loading by returning

([], sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)

instead of an empty list.

Also, I do believe next_competion_if_showing is a typo.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-24919202 .

Railk commented 11 years ago

@seanhess : yes you can only initialize one file at a time.

You can have 2 separate initialisations (2 project) ou you can make a root file that references server and public to have both of them in one TSS process (i'm not what you want to do)

ok for rowcol

Otherwise, i've implemented a different version for the plugin that rely on sockets, to have only one (or two if i keep a channel for error only) node process for one or more projects. If the server is ON the new project create a new TSS instance if not i open the server(s) and create a TSS instance, I've modified the TSS command part to reflect that. I also look at "Thread" in nodejs to see if i can make the error command be on another thread so that i doesn't stall the node event loop, for now not so much luck for an "easy way".

seanhess commented 11 years ago

Cool, thanks for the info. I thought since you supported an array of root files you had some fancy way of initializing more than one. That makes sense.

Interesting.. So you're not using typescript-tools any more? You're using the typescript language services directly? If you are still using typescript-tools, why would it matter if you only had one node process, you'd still have have multiple sub-processes in node, right?

Node doesn't have threads, right? Are you saying you're going to have multiple sub-processes in node then? That's not really any different than having python do it, except maybe it's easier to make it non-blocking.

On Tue, Sep 24, 2013 at 9:49 AM, Railk notifications@github.com wrote:

@seanhess https://github.com/seanhess : yes you can only initialize one file at a time.

You can have 2 separate initialisations (2 project) ou you can make a root file that references server and public to have both of them in one TSS process (i'm not what you want to do)

ok for rowcol

Otherwise, i've implemented a different version for the plugin that rely on sockets, to have only one (or two if i keep a channel for error only) node process for one or more projects. If the server is ON the new project create a new TSS instance if not i open the server(s) and create a TSS instance, I've modified the TSS command part to reflect that. I also look at "Thread" in nodejs to see if i can make the error command be on another thread so that i doesn't stall the node event loop, for now not so much luck for an "easy way".

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25017007 .

Railk commented 11 years ago

Yes i can initialise several project, with the array of root files.

I'm still using TSS but a modified one, to have a socket server and json in/out but after the rest is the same. In fact like i can initialise several root files, it means several node process launch with python subprocess. The problem is that node process can eat up each (on my windows machine) 200mo of memory so it would mean Nx200mo. I would prefer to have only one node process with 200mo (that's the max i saw it can take whatever you do ) that will not go highter than that.

Node doesn't have thread's but there's some native module like "thread a gogo" that enable threads but there's some cross platform problem (windows).

For now it's just a test to see if i can have some benefits or not using sockets (one (or two) node process even with multiple root file/project is one benefits) i will see how it goes.

seanhess commented 11 years ago

Cool, interested to hear what happens.

On Tue, Sep 24, 2013 at 12:41 PM, Railk notifications@github.com wrote:

Yes i can initialise several project, with the array of root files.

I'm still using TSS but a modified one, to have a socket server and json in/out but after the rest is the same. In fact like i can initialise several root files, it means several node process launch with python subprocess. The problem is that node process can eat up each (on my windows machine) 200mo of memory so it would mean Nx200mo. I would prefer to have only one node process with 200mo (that's the max i saw it can take whatever you do ) that will not go highter than that.

Node doesn't have thread's but there's some native module like "thread a gogo" that enable threads but there's some cross platform problem (windows).

For now it's just a test to see if i can have some benefits or not using sockets (one (or two) node process even with multiple root file/project is one benefits) i will see how it goes.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25031339 .

draivin commented 11 years ago

That is interesting, I instead am trying to go in a completely automatic approach with python, where the user wouldn't have to configure root files, it's going pretty well, I can detect when a project is a superset of another and close the previous project, handle file renaming, and a few other stuff. The downside is that I ended up with somewhat of a monstruous tss interface manager, but it keeps at exactly one node process per project open, without the user having to configure anything, and I don't think people keep many projects open simutaneously.

seanhess commented 11 years ago

That's cool. Which project are you working on Ian? A fork of T3S?

On Wed, Sep 25, 2013 at 9:23 AM, Ian notifications@github.com wrote:

That is interesting, I instead am trying to go in a completely automatic approach with python, where the user wouldn't have to configure root files, it's going pretty well, I can detect when a project is a superset of another and close the previous project, handle file renaming, and a few other stuff, the downside is that I ended up with somewhat of a monstruous tss interface manager, but it keeps at exactly one node process per project open, without the user having to configure anything, and I don't think people keep many projects open simutaneously.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25096488 .

draivin commented 11 years ago

It is over here https://github.com/Draivin/subtype, I've been working on it for a while but I threw it all away a couple of times because I didn't like the way it was going, finally I went on a way that is giving somewhat good results.

seanhess commented 11 years ago

How are you detecting it? Seeing if it is in a subfolder or something? Or just walking the include tree somehow?

On Wed, Sep 25, 2013 at 9:53 AM, Ian notifications@github.com wrote:

It is over here https://github.com/Draivin/subtype, I've been working on it for a while but I threw it all away a couple of times because I didn't like the way it was going, finally I went on a way that is giving somewhat good results.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25099652 .

draivin commented 11 years ago

Every time a new typescript file is opened I spawn a TSS for it, then I check if the new TSS files is a superset of the previously opened TSS files, if it is, I close the previously opened TSSs.

Edit: not really every time a typescript file is open, just every time a typescript file that wasnt in the files of any other TSS before is added.

seanhess commented 11 years ago

But only if the file isn't currently in the files right? You could cache the files result and check if the file is in it before spawning. That way if you re-open a file in a project it is fast.

On Wed, Sep 25, 2013 at 10:41 AM, Ian notifications@github.com wrote:

Every time a new typescript file is opened I spawn a TSS for it, then I check if the new TSS files is a superset of the previously opened TSS files, if it is, I close the previously opened TSSs.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25103645 .

draivin commented 11 years ago

Yeah, I edited the comment to include that , but apparently the email went faster!

Railk commented 11 years ago

How does the TSS files initialisation is going ? For big project init time can be a bit long. So in the worst case scenario you could open/close a lot of TSS/node process, giving a less fluid experience, always waiting for initialisation.

For many projects simultaneously i think it's not that rare, it depends how you work, you could have for exemple when you work on a website a root file per page and so a lot of small typescript project opened and working simultaneously on them.

Otherwise the idea is interesting :) i tried to use your plugin but couldn't, is there a something to do to make it work ?

draivin commented 11 years ago

I haven't tested on really big files yet, and the initialisation time would depend on the order the views are positioned in the window, for example, if there are 3 files open, A, B and C, where C imports B and B imports A, and the views were in that order, it would load the TSS for A, then load the TSS for B, see that B is a superset of A and close the TSS for A, then load the TSS for C, see that C is a superset of B and close the TSS of B.

But otherwise, if the views were positioned like C B A, it would load the TSS for C, include B in C's tss, and include A in C's TSS.

It should work without needing to modify anything, but I only had the opportunity to test it on windows yet, so I am not really sure what is the problem, are you trying to use the latest commit? I tought that would work in other OSs, but I'm not sure.

Edit: Oh, forgot mentioning that it only works on sublime text 3 for now.

Edit2: Just tought of another thing, I could aglomerate all the typescript files that don't import any other in only one TSS instance, since they don't need completion from other files.

Railk commented 11 years ago

I tried the latest commit on windows, quickly, the plugin is loading correctly but after nothing. I will try again tomorow :) i m a bit tired so perhaps i ve done something wrong.

draivin commented 11 years ago

Ooooh, I think I know what the problem is, it detects if it is a typescript view by using

def is_typescript(view):
   return view.settings().get('syntax') == 'Packages/TypeScript/TypeScript.tmLanguage'

which dependes on the TypeScript sublime plugin that sets syntax highlighting for typescript.

I probably should include a local .tmlanguage that I can depend upon. Edit: done (it now includes a local .tmLanguage and also supports any package's typescript.tmlanguage) :)

Random toughts: The only thing that I feel is lacking in TSS right now is that when you reload you lose all updates, so for example, a person adds a import reference to a file, and does not save it, we can see that he did add a import through the errors that will start showing a failed import, but if we reload the file to chase the new dependencies it will still chase the old ones, as the new import declaration is not in the disk.

seanhess commented 11 years ago

Check out the "build" branch of mine guys: https://github.com/seanhess/sublime-typescript/tree/build

In this version, any time you save a typescript file, it recompiles the project/root file and displays errors at the bottom, as well as in line. I like that because it's like an automatic "watch" tool, but it displays in the sublime window. All the watch tools I know of are in a separate terminal window and are hard to see.

This version also has a synchronous, debounced autocompleter like yours Ian, I'm just playing around to see if it's better.

Anyway, the main point is: what do you think of displaying the errors like that at the bottom? I think it's a lot easier to tell what's going on when you can see the project errors all in one place. AND I really like how they're the actual errors you get compiling, so you know you're getting something real.

On Wed, Sep 25, 2013 at 3:18 PM, Ian notifications@github.com wrote:

Ooooh, I think I know what the problem is, it detects if it is a typescript view by using

def is_typescript(view): return view.settings().get('syntax') == 'Packages/TypeScript/TypeScript.tmLanguage'

which dependes on the TypeScript sublime plugin that sets syntax highlighting for typescript.

— Reply to this email directly or view it on GitHubhttps://github.com/Railk/T3S/issues/10#issuecomment-25125640 .