8000 Fix bug with embed node.js which is not used with nf wizard. · lgrignon/typescript.java@95f09ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 95f09ee

Browse files
committed
Fix bug with embed node.js which is not used with nf wizard.
1 parent ac71192 commit 95f09ee

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/internal/ui/wizards/NewTypeScriptProjectWizard.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,13 @@ public void run(final IProgressMonitor monitor) throws InvocationTargetException
177177
// Install TypeScript/tslint if needed
178178
List<LineCommand> commands = new ArrayList<>();
179179
Map<String, Object> properties = new HashMap<String, Object>();
180-
mainPage.updateCommand(commands, newProjectHandle);
180+
String nodeFilePath = getNodeFilePath();
181+
mainPage.updateCommand(commands, newProjectHandle, nodeFilePath);
181182
tslintPage.updateCommand(commands, newProjectHandle);
182183

183184
if (!commands.isEmpty()) {
184-
properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, projectLocationPath.toString());
185-
String nodeFilePath = getNodeFilePath();
185+
properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR,
186+
projectLocationPath.toString());
186187
if (!StringUtils.isEmpty(nodeFilePath)) {
187188
EnvPath.insertToEnvPath(properties, nodeFilePath);
188189
}

eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/ui/wizards/AbstractWizardNewTypeScriptProjectCreationPage.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,9 @@ private void updateNodeJsMode() {
463463
protected void nodeJsChanged(File nodeFile) {
464464
}
465465

466-
/** Updates the Commands, which should be executed after creating the Project. */
467-
public void updateCommand(List<LineCommand> commands, IProject project) {
466+
/** Updates the Commands, which should be executed after creating the Project.
467+
* @param nodeFilePath */
468+
public void updateCommand(List<LineCommand> commands, IProject project, String nodeFilePath) {
468469
}
469470

470471
/** Class for the Status of the selected Node.js. */

eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/ui/wizards/WizardNewTypeScriptProjectCreationPage.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,12 @@ public void widgetSelected(SelectionEvent e) {
104104
updateTsRuntimeMode();
105105
}
106106
});
107-
installTsRuntime = new NpmInstallWidget(
108-
"typescript",
109-
new IStatusChangeListener() {
110-
@Override
111-
public void statusChanged(IStatus status) {
112-
setPageComplete(validatePage());
113-
}
114-
},
115-
parent,
116-
SWT.NONE
117-
);
107+
installTsRuntime = new NpmInstallWidget("typescript", new IStatusChangeListener() {
108+
@Override
109+
public void statusChanged(IStatus status) {
110+
setPageComplete(validatePage());
111+
}
112+
}, parent, SWT.NONE);
118113
installTsRuntime.getVersionText().addListener(SWT.Modify, this);
119114
}
120115

@@ -160,7 +155,7 @@ private IStatus validateTypeScriptRuntime() {
160155
}
161156

162157
@Override
163-
public void updateCommand(List<LineCommand> commands, final IProject project) {
158+
public void updateCommand(List<LineCommand> commands, final IProject project, String nodeFilePath) {
164159
if (!useEmbeddedTsRuntime) {
165160
// when TypeScript is installed when "npm install typescript"
166161
// command is terminated, update the project Eclispe preferences
@@ -172,7 +167,8 @@ public void onTerminateCommand(LineCommand lineCommand) {
172167
Display.getDefault().asyncExec(new Runnable() {
173168
@Override
174169
public void run() {
175-
IEclipsePreferences preferences = new ProjectScope(project).getNode(TypeScriptCorePlugin.PLUGIN_ID);
170+
IEclipsePreferences preferences = new ProjectScope(project)
171+
.getNode(TypeScriptCorePlugin.PLUGIN_ID);
176172
preferences.putBoolean(TypeScriptCorePreferenceConstants.USE_EMBEDDED_TYPESCRIPT, false);
177173
preferences.put(TypeScriptCorePreferenceConstants.INSTALLED_TYPESCRIPT_PATH,
178174
"${project_loc:node_modules/typescript}");
@@ -183,7 +179,6 @@ public void run() {
183179
}
184180
}
185181
});
186-
187182
}
188183
}));
189184
}

0 commit comments

Comments
 (0)
0