axmor / typecs

TypEcs - TypeScript IDE for Eclipse
62 stars 14 forks source link

TypeScript 1.8 support #94

Open micaelgallego opened 8 years ago

micaelgallego commented 8 years ago

Hi guys,

Thanks for this awesome project. I've using atom-typescript plugin lately for authoring TypeScript code, but I miss a lot Eclipse for my development.

When do you plan to support TypeScript v1.8 (now in beta)? I'm thinking in contribute in some way to make this plugin up to date. Where can I start? What steps are necessary to include a new version of TypeScript compiler in Typecs?

Thanks

alexeagle commented 8 years ago

Ping! TypeScript 1.8.2 is now the default stable version

micaelgallego commented 8 years ago

@alexeagle Are you interested also in update typecs plugin to latest version?

alexeagle commented 8 years ago

I have no idea what would be involved, and we haven't heard from the project maintainers so I don't know who would review such a PR. I have not even verified that this problem exists with current versions of things. Can you try it and gather any available diagnostic information?

p-kudrin commented 8 years ago

Hi. Unfortunately I am not have enough time to support this project now. I'm going to do some bug fixing in nearest time. But it's all. If anyone want continue to support this project I can give all rights for that.

alexeagle commented 8 years ago

what about @kosz78 - is this project unmaintained now?

p-kudrin commented 8 years ago

he is not maintaining this project now.

p-kudrin commented 8 years ago

@micaelgallego Do you have code examples which use features of 1.8 version? also will be great to have examples for 1.6 and 1.7 versions. Because this plugin has tested only for 1.5 version. And I am not using Typescript now and did not track the latest changes. May be we can migrate to 1.8 version of compiler without losing functionality. Or it will need minimum of changes.

micaelgallego commented 8 years ago

My main objective is develop Angular 2 apps inside eclipse. Angular 2 beta 7 support TypeScript 1.8.2. I think it will be enough to honor tsconfig.json file to configure tsc instead of using eclipse preference pages. I think it is less important to update other plugins features assuming that language services are backward compatible and language rules haven't changed a lot.

If you can give me some instructions of how to proceed, I can try to update TypeScript compiler.

p-kudrin commented 8 years ago

@micaelgallego tsconfig.json is supported starting with TypeScript 1.5. The plugin has already supported this. But may be there is some bug. Have you already tried this feature?

You should update files in 'typecs/src/com.axmor.eclipse.typescript.core/lib/typescript-bridge/ts/' directory from https://github.com/Microsoft/TypeScript/tree/v1.8.2/lib

micaelgallego commented 8 years ago

I've opened an Angular 2 project generated with official angular2-cli (https://github.com/angular/angular-cli) and I've found some problems.

This tool generates a project with the following structure:

.git
config
dist
e2e
node_modules
src
   app
      main.html
      main.spec.ts
      main.ts
   app.ts
   favicon.ico
   index.html
   tsconfig.json
   typings.d.ts
tmp
typings
.clang-format
.gitignore
ember-cli-build.js
karma-test-shim.js
karma.conf.js
package.json
protractor.conf.js
tsling.json
typings.json

If I "Enable TypeScript Nature" in a brand new project from angular2-cli, the TypeScript Builder hangs. Builder can't be stopped. If I kill manually node process, the builder finish. Maybe the problem is that plugin recognizes all .ts files in node_modules folder (angular2 and dependencies) and try to compile all of them. Atom-Typescript is more intelligent and only try to compile ts files in folder containing tsconfig.json.

If I create a project only with src folder (the folder containing tsconfig.json), the TypeScript builder doesn't take too long, but I obtain errors like this "Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning." This option is configured in tsconfig.json, and it seems that is being ignored.

It is necessary to enable some flag or active some configuration to honor tsconfig.js in the project root?

Thank you in advance.

p-kudrin commented 8 years ago

@micaelgallego 1) you have to configure path to source directory to prevent over compiling. RightClick on the project > Properties > TypeScript > Source directory or file ...

2) I need investigate this behavior. Unfortunately I cannot give any advice now.

micaelgallego commented 8 years ago

Thank you @p-kudrin. I'll try to install the plugin in develop mode to take a look.

jsotrifork commented 8 years ago

Hi @p-kudrin, I have tried to incorporate TypeScript 1.8.10 in a local build according to your directions above. After fixing a couple of api changes, the plugin now works in one TypeScript project!

However, another project loops infinitly when auto-build is enabled. I have tracked the triggering as far as TypeScriptAPIImpl.java:181, which contains this line:

outResource.get().refreshLocal(IResource.DEPTH_INFINITE, monitor);

(outResource reflects compilerOptions.outDir in tsconfig.json - 'files' does not point to any file in outDir)

Any thoughts on why this is triggering an infinite build? The TypEcs from git/master does not have this behaviour on this project, so it seems to be related to ts 1.8.10..

p-kudrin commented 8 years ago

Do you use tsconfig.json to configure the project? Which values do options 'out" or "outDir" have?

jsotrifork commented 8 years ago

@p-kudrin Yes, tsconfig.json is used. Here is a shortened version (there are many more files): { "version": "1.8.9", "compileOnSave": false, "compilerOptions": { "target": "es5", "module": "commonjs", "declaration": true, "sourceMap": true, "moduleResolution": "node", "rootDir": "src/main/ts", "noLib": false, "outDir": "target/lib" }, "filesGlob": [ "typings/**/*.d.ts", "src/**/*.ts", "!src/**/*.d.ts", "!node_modules/**" ], "exclude": [ "node_modules" ], "atom": { "rewriteTsconfig": true }, "files": [ "typings/tsd.d.ts", "src/main/ts/core/Comparator.ts", "src/main/ts/core/Core.ts" ] }

p-kudrin commented 8 years ago

Could you check where is your tsconfig.json relatively to "/target/..." folders. Currently the plugin expects that the parent of tsconfig.json contains "outDir" folder.

jsotrifork commented 8 years ago

tsconfig.json is placed in the project root dir. target is a subdir to root dir.

p-kudrin commented 8 years ago

Thank you. I'll try investigate this problem. Other possible reason is your 'tsd.d.ts'. It can contain cyclic references or references to very large files. You can help this project if you'll prepare pull request with your fixes for 1.8 version.

jsotrifork commented 8 years ago

@p-kudrin I've created a pull request with my changes.

jsotrifork commented 8 years ago

Here is an extremely simple Java project that demonstrates the problem with infinite builds (using the ts 1.8 changes from my pull request).

The trigger seems to be "declaration": true in tsconfig.json, which makes some kind of sense: A typescript file is added to the project which triggers yet another build (although it shouldn't since the file is not listed as a source file).

minimal.zip