angelozerr / angular-eclipse Goto Github PK
View Code? Open in Web Editor NEWAngular Eclipse Plugin
Home Page: https://angular.io/
License: Eclipse Public License 1.0
Angular Eclipse Plugin
Home Page: https://angular.io/
License: Eclipse Public License 1.0
Hi,
I'm trying to refactor my code in Eclipse.
When I rename a class, the new name is not reflected project wide. e.g. the class name in the corresponding module is still the old one.
I have the same problem, when I moving a file. The corresponding path references are not updated.
Is refactoring not supported? or I'm doing something wrong?
Cheers,
Bernd
In the blueprint Wizards (Component, Directive etc.) it would be nice, if we know, which files would be generated.
The gererated files and folders depend on the generated element and the parameters.
For example a Component named "header", generated with "-- spec false" would result in following files:
header\header.component.ts
header\header.component.css
header\header.component.html
while generating it with "--inline-template" and "--inline-style" would result in following files:
header\header.component.ts
header\header.component.spec.ts
You also need to take care about the app-defaults (set in the angular-cli.json). For example you could set the style-extension there, so that header.component.css
might become header.component.scss
.
This feature could also solve #43.
I just installed it on a new Eclipse installation and the same ng command that was working on my earlier installation seems to be NOT working any more. Was the 1.2.0-SNAPSHOT recently updated / modified? I noticed a couple of changes:
Any help would be greatly appreciated!!
Ver. 1.1.0
In the .log file for eclipse I get these warnings:
!ENTRY org.eclipse.jface.text 2 0 2016-10-27 14:56:29.421
!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.number'
!ENTRY org.eclipse.jface.text 2 0 2016-10-27 14:56:29.429
!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.round'
!ENTRY org.eclipse.jface.text 2 0 2016-10-27 14:56:29.449
!MESSAGE Duplicate template id: 'ts.eclipse.ide.jsdt.ui.templates.react.ptelr'
!ENTRY org.eclipse.jface.text 2 0 2016-10-27 14:56:29.456
!MESSAGE Duplicate template id: 'ts.eclipse.ide.jsdt.ui.templates.react.ptir'
Angular-CLI has a command for module-generation ("ng g module moduleName").
Using this command, it is possible to create a "normal" module, as well as a "routing" module ("--routing").
It would be cool, if the plugin supports generation for modules and routes, using a Wizard.
Provide HTML Angular2 Template (snippet) like https://github.com/johnpapa/vscode-angular2-snippets
When I run ng serve, an error is thrown. The server is running anyways, so going to "localhost:4200" will open the app and live reload is enabled.
Stacktrace:
!ENTRY ts.eclipse.ide.angular2.cli 4 0 2017-03-10 19:00:10.302
!MESSAGE Error while opening browser for ng serve.
!STACK 0
java.net.MalformedURLException: For input string: "4200 **"
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at ts.eclipse.ide.angular2.internal.cli.jobs.NgServeJob.runInUIThread(NgServeJob.java:46)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:97)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4211)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3827)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.NumberFormatException: For input string: "4200 **"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.net.URLStreamHandler.parseURL(Unknown Source)
... 31 more
Problem seems to be, that it wants to open the eclipse browser using "localhost:4200 **", and parsing the Port "4200 **" throws NumberFormatException.
Waiting for JSDT Editor improvement https://bugs.eclipse.org/bugs/show_bug.cgi?id=486961
Since Angular-CLI RC.0 it is possible to generate a guard using the command "ng generate guard [name]".
The supported options can be found here.
Would you change https://marketplace.eclipse.org/content/angular2-eclipse image
to the one modified as on http://www.nodeclipse.org/updates/list
So that v1 & v2 images differ a bit
As angular-cli is the official tool to generate boilerplate for angular 2 projects, I think it is good to have support for this tool out of the box.
As per documentation, it is recommended to install angular-cli globally with npm install -g angular-cli
to use commands directly in the command line. The following commands are some of the most important:
ng new PROJECT_NAME
: Creates a new project.ng serve
: Start a web server with integrated TS compiler and browser auto-reload on save.ng build
: Generates distribution artifacts.I think it will be good if angular2-eclipse have direct short-cuts to these commands and show its output.
In the future it can be considered to allow execute jasmine tests directly in a browser integrated in eclipse, show results, etc...
What do you think?
Since Angular-CLI RC.0 there are multiple tsconfig.json files (more infos here):
-src/tsconfig.app.json
for the app
src/tsconfig.spec.json
for unit testse2e/tsconfig.e2e.json
for e2e teststsconfig.json
for IDE integrationThe last one is relevant for the plugin (typescript.java
).
By default it looks like this:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016"
]
}
}
The properties target
and module
are missing, so default values are used.
Until now target
was set as es5
and module
was es2015
.
Until now the tsconfig.json
was inside the ./src
-Folder, so that the JS and Map-Files where generated inside the ./dist/out-tsc
. Now the tsconfig.json
is one level above, resulting in the JS and Map-Files inside ./dist/out-tsc/src
.
I guess we should investigate, what a "good" default tsconfig.json
for angular2-eclipse should look like and either overwrite the Angulat-CLI one or write a doc regarding this.
How to determine that a project has Angular2 nature?
But those folder, package.json could be hosted not only in project root (like src folder). So we could foolw the same idea than angelozerr/typescript.java#12 (comment)
And at the end if the user project doesn't follow thoses rules, user will be able to to "Convert as Angular2" to add Eclipse Angular2 nature to the project.
What do you think about that @micaelgallego @piotrtomiak
Hello ,
When I try to create angular2 project in eclipse , I get following error:
module.js:327
throw err;
^
Error: Cannot find module 'exists-sync'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/pasa/node_modules/angular-cli/node_modules/ember-cli/lib/models/project.js:11:26)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
'unknown': unknown terminal type.
I know that 1.2.0-SNAPSHOT is already there, but when is the actual 1.2.0 version releasing?
Completion for <input (c // hetre Ctrl+Space must show click, etc
It would be nice, if I can import a previously created Angular2-eclipse project (or create a new one with existing source) into workspace. In this case 'ng init' should not run, but an optional 'npm install' would be useful.
The motivation behind this is that many users exclude eclipse specific project files from git/svn but after a checkout from this repo it is not needed to use 'ng init'.
The preferences Javascript/Typescript/Angular2/CLI 'use ng custom file' is used to add this value in the Path env (when terminal is opened with CLI Wizard). It must be improved
I think it should be cool to check the existing of the ng in the CLI wizard when a project must be generated. In the case of ng doesn't exists, execute "npm install -g angular/cli" before executing "ng new"
@Springrbua what do you think about thoses ideas?
It would also be nice if all three of these commands were added to the Debug As menu, and have the Eclipse debugger connect to the running node.js instance.
Waiting for angelozerr/typescript.java#2
I am running Eclipse Neon on my MacBookPro with macOS el capitan.
npm and node are basically installed, i already have successfully implemented the "angular 2 hello world" tutorial project on the command line and could run the ng2 app.
now I tried to make an ng2 project in eclipse, using the angular2-eclipse feature.
after i installed it (without any error message), and try to create a new project by using the new-project wizard for a "new Angular2 project"
/Users/hansp/.profile: line 4: .bashrc: No such file or directory
/bin/bash: line 1: ng: command not found
There seems to be no way to change the tab indentation to 2 spaces. No matter what the editors are set to in terms of formatting and settings in Eclipse, TypeScript editor always indents 4 spaces.
When I open the "New Angular2 Component" Wizard by right-clicking a folder inside my project, I would expect it to generate the Component inside the selected folder.
But at the moment, the corresponding "ng generate" command is always executed in the applications root.
That means, that every Component is automatically generated in the source-folder ("src") and added to the root-mdule ("AppModule").
I would expect the Component to be generated inside the selected folder and added to the nearest module, just as if "ng generate" was executed inside the selected folder.
It would also be cool to be able to browse the folder from the WizardPage, the selected folder (or application-root) should be the default value.
Today the use of angular-cli requires:
It should be cool to give the capability to execute ng with:
In other words we could consume ng without installing nodejs or angular-cli. For developer who cannot install nodejs or angular-cli, they could commit in their SVN, Git repository an Eclipse Project which contains node_modules/angular-cli and uses it to execute ng.
.ember-cli is used to customize port, live reloading of ng server. It uses JSON format. Provode an .ember-cli editor linked to JSON Schema to benefit with completion.
Provide source highliting (like EclEmma) after test execution according to which source lines and branches were executed during the test batch.
Use wiki to list all your current ideas, roadmap
Hello ,
I try to build by using wizard ( run as ng buid) , I get error "Build failed.
The Broccoli Plugin: [Funnel] failed with:
Error: ENOENT: no such file or directory, lstat 'typings'
at Error (native)"
thank your interest
Since Angular-CLI beta 25, the "generate" command lets you specify a module (see angular/angular-cli#3811)
The generate Wizards could support this to (using a Combobox with available modules?).
The nearest module could be selected by default.
Angular-CLI supports a few options, when generating a new project.
It would be cool to be able to use them in the Project-Generation-Wizard..
Following options are available (copied from "ng help"):
--dry-run (Boolean) (Default: false)
aliases: -d
--verbose (Boolean) (Default: false)
aliases: -v
--link-cli (Boolean) (Default: false)
aliases: -lc
--skip-npm (Boolean) (Default: false)
aliases: -sn
--skip-git (Boolean) (Default: false)
aliases: -sg
--skip-tests (Boolean) (Default: false)
aliases: -st
--skip-commit (Boolean) (Default: false)
aliases: -sc
--directory (String) // Already supported by choosing project-location?
aliases: -dir <value
--source-dir (String) (Default: src)
aliases: -sd <value>
--style (String) (Default: css)
--prefix (String) (Default: app)
aliases: -p <value>
--mobile (Boolean) (Default: false) // Disabled temporarily
--routing (Boolean) (Default: false)
--inline-style (Boolean) (Default: false)
aliases: -is
--inline-template (Boolean) (Default: false)
aliases: -it
The most important ones (for me) are the following:
Just as Run As ng build and Run As ng serve execute the respective commands, it would be nice to have a run configuration that would invoke ng test.
It would also be nice if all three of these commands were added to the Debug As menu, and have the Eclipse debugger connect to the running node.js instance.
Lastly, but perhaps requiring massive amounts of additional work, it would be nice if ng test were also added to the Coverage As menu.
When you generate a Blueprint (Component, Directive etc.) using Angular-CLI you can specify different parameters.
This parameters affect the generated files and folders.
It would be cool, if we could set this parameters inside the Wizards.
If you try to generate an Angular element (Component, Directive etc.) which already exists inside the selected directory, Angular-CLI checks, if the execution changes anything.
If the generated files are different, then the existing file, Angular-CLI asks, if you want to overwrite the existing files.
The plugin does not take care about this "question" and so it does not input a valid value (Y,N,D or H).
The result is an endless loop with the following output:
Path-To-Project\src\app>ng generate component core --prefix app --spec false --flat false
installing component
? Overwrite src\app\core\core\core.component.ts? (Yndh) �[56D�[56C�[1000D�[K?
Overwrite src\app\core\core\core.component.ts? (Yndh) e�[57D�[57C�[1000D�[K?
Overwrite src\app\core\core\core.component.ts? (Yndh) ex�[58D�[58C�[1000D�[K?
Overwrite src\app\core\core\core.component.ts? (Yndh) exi�[59D�[59C�[1000D�[K?
Overwrite src\app\core\core\core.component.ts? (Yndh) exit�[60D�[60C�[1000D�[K?
Overwrite src\app\core\core\core.component.ts? (Yndh)
>> Please enter a valid command�[1A�[31D�[56C�[1B�[1000D�[K�[1A�[1000D�[K? Overwrite src\app\core\core\core.component.ts? (Yndh) e�[57D�[57C�[1000D�[K? Overwrite src\app\core\core\core.component.ts? (Yndh) ex�[58D�[58C�[1000D�[K? Overwrite src\app\core\core\core.component.ts? (Yndh) exi�[59D�[59C�[1000D�[K? Overwrite src\app\core\core\core.component.ts? (Yndh) exit�[60D�[60C�[1000D�[K? Overwrite src\app\core\core\core.component.ts? (Yndh)
This goes on until you terminate the process using the red button in eclipse.
Possible solutions:
Check if the generated files already exist. If they already exist, show an error and disable the "finish" button.
Take care about this result and let the user input a value in the console.
I personaly would preffer the first solution. If the generated files already exist, the user should delete them manually first and then generate them again.
The above error message appears when attempting to create additional run configurations by hand under the Angular CLI heading in Eclipse's run configuration manager.
I am not able to import automatically the used classes using ctrl + shift + o
Ignore errors for HTML Angular2 tags, attributes inside HTML Editor (ex: ngFor)
by using Eclipse neon custom validator. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=449327
Hi,
I've installed eclipse neon and added the 4 plugins from the 1.0.0 download site.
The ng command is not recognized.
I used the build-in nodejs and also tried with an external portable nodejs with angular installed no luck. (the portable nodejs works fine in windows cmd)
Running on windows 8.
Regards
Luc
Support for https://github.com/mgechev/codelyzer
Hi,
The build by default also validates the npm modules.
Can we remove the default validation of npm modules from build?
Provides an AngularCLI editor with several pages like TSConfig Editor https://github.com/angelozerr/typescript.java/wiki/TSConfig-Editor-Features#editor
Provide Angular2 Perspective to provide the "New" menu Angular2 Class, Pipe, etc wizards
Angular-CLI beta 32 introduces a few breaking changes, which will affect the plugin.
The breaking changes are listet in the changelog.
Following changes should affect the plugin:
Especially the renamed config and the removed commands will cause problems.
In Eclipse Preferences:
JavaScript -> TypeScript -> Angular2 -> HTML -> Editor -> Syntax Coloring throws an error
After clicking it again, it opens but the syntax coloring can not be changed.
Hi,
I am using python virtual environments on linux, with nodeenv, so that all of my node, typescript and angular projects are entirely distinct from each other.
I would like to be able to specify a per-project path to the ng command so that run, tests and build buttons that appear for angular-cli.json work correctly instead of saying
/bin/bash: line 1: ng: command not found
Provide an editor for angular-cli.json with completion based on JSON Schema https://github.com/angular/angular-cli/blob/master/lib/config/schema.json
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.