Skip to content

provide "tsserver command" (v 2.1.0) for compilation #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nimo23 opened this issue Nov 7, 2016 · 11 comments
Closed

provide "tsserver command" (v 2.1.0) for compilation #105

nimo23 opened this issue Nov 7, 2016 · 11 comments

Comments

@nimo23
Copy link

nimo23 commented Nov 7, 2016

I have "compileOnSave": true which works. However, when creating a new file ("test.ts") then TS IDE generates its corresponding "js"-file, but it also compiles all the other ts-files (which are unrelated to "test.ts") again. These unrelated ts-files even have a generated js-file. However, the compiler generates new js-files for ALL ts-files.

I expected the following:

I create "1.ts"->compiler creates "1.js"
I create "2.ts"(which is unrelated to "1.ts")->compiler creates "2.js" AND do NOT recreate "1.js". But actually this is the case. TS IDE recreates "1.tjs".

I do not want that the compiler recreates untouched/unchanged ts(js)-files.

@angelozerr
Copy link
Owner

angelozerr commented Nov 7, 2016

I think it's because you have setted buildOnSave to true:

  • compileOnSave => compile only the ts files which are saved.
  • buildOnSave => compile the whole ts files of your project.

@nimo23
Copy link
Author

nimo23 commented Nov 7, 2016

Yes, that was my fault.

I changed buildOnSave=false. Now, it works.

Is this normal, that compilation for one file needs 3-5 seconds? Can I make it faster? I tried it with a new file containing only the following line:

export class AppComponent { }

I tried it several times and compilation for only one file needs 3-5 seconds. Is this normal?

@angelozerr
Copy link
Owner

I tried it several times and compilation for only one file needs 3-5 seconds. Is this normal?

Yes it's normal. I execute tsc command each time you save your ts file. Each time, tsc loads the whole ts files which are in the scope. TypeScript 2.1.0 will provide tsserver command to compile ts files and it will be very fast I think because:

  • once tsserver has loaded the ts files, no need to reload it.
  • when you change a ts file with the editor, typescript.java synchronize it (to support completion, etc) and no need to recompile it.

In other words, just be patient that I implement that and TypeScript 2.1.0 will be stable.

@nimo23
Copy link
Author

nimo23 commented Nov 7, 2016

Okay, so you can close this issue when ts 2.1.0 will be integrated.

By the way, I have this enabled:

1

And I cannot see any messages when TS IDE will compile my ts-files after save. It is compiled, but no message occurs in my console. I also tried it with "watch": true, but no message about compilation is shown. I want such a message as shown in the docs:

1

@angelozerr
Copy link
Owner

And I cannot see any messages when TS IDE will compile my ts-files after save.

Yes it's normal, tsserver is used for completion, hover, etc. 2.1.0 will give the capability to use tsserver for compilation too.

I also tried it with "watch": true, but no message about compilation is shown. I want such a message as shown in the docs

If you wish that, you must use "Run -> Compile" launch and set your tsconfig.json with watch: true. The TypeScritp builder disable the watch: true.

@nimo23
Copy link
Author

nimo23 commented Nov 7, 2016

Okay, now I understand.

So with 2.1.0, I will also see the messages of incremental builds message.
I have to wait for 2.1.0 :) Thanks!

I have renamed this issue to "provide tsserver command for compilation". Feel free to close this issue.

@nimo23 nimo23 changed the title compiler compiles ALL files instead of one or its related files provide "tsserver command" (v 2.1.0) for compilation Nov 7, 2016
@nimo23
Copy link
Author

nimo23 commented Nov 7, 2016

Oh I already see, you made it: #109

👍

@nimo23 nimo23 closed this as completed Nov 7, 2016
@angelozerr
Copy link
Owner

angelozerr commented Nov 8, 2016

So with 2.1.0, I will also see the messages of incremental builds message.

No you should do have this if you run at hand the Run Compile TypeScript and set in your tsconfig.json watch: true.

I will investigate #109 and use of --listEmitedFiles. Let's me some time. I'm very busy with TextMate for the moment.

@nimo23
Copy link
Author

nimo23 commented Nov 8, 2016

No you should do have this if you run at hand the Run Compile TypeScript and set in your tsconfig.json watch: true.

Console output works with your suggestion.

However, if ts 2.1.0 will be integrated in TS IDE, will it be possible to trace the incremental builds in the console output when "Trace tsserver request/response to the console" is set to true?

In future, it would be nice to also print this "incremental building process" when user sets the tracing checkbox to true.

@angelozerr
Copy link
Owner

However, if ts 2.1.0 will be integrated in TS IDE, will it be possible to trace the incremental builds in the console output when "Trace tsserver request/response to the console" is set to true?

No because I have not consumed, tsserver compiler commands. Once I will implement that, you will able to install 2.1.0 with npm and configure TS IDE with it. Do you want I start to implement it?

In future, it would be nice to also print this "incremental building process" when user sets the tracing checkbox to true.

It will be automaticly done since console trace the whole tsserver request/response.

@nimo23
Copy link
Author

nimo23 commented Nov 8, 2016

It will be automaticly done since console trace the whole tsserver request/response.

Okay, got it. I will wait after ts 2.1.0 is integrated in TS IDE. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants