Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 509476
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/javascriptProject.js (-16 / +17 lines)
Lines 21-27 Link Here
21
				|| fileName === project.ESLINTRC_JS
21
				|| fileName === project.ESLINTRC_JS
22
				|| fileName === project.ESLINTRC_JSON
22
				|| fileName === project.ESLINTRC_JSON
23
				|| fileName === project.PACKAGE_JSON
23
				|| fileName === project.PACKAGE_JSON
24
				|| fileName === project.ESLINTRC_YAML
24
				|| fileName === project.ESLINTRC_YAML
25
				|| fileName === project.ESLINTRC_YML) {
25
				|| fileName === project.ESLINTRC_YML) {
26
				delete project.map.eslint;
26
				delete project.map.eslint;
27
			}
27
			}
Lines 145-151 Link Here
145
	 */
145
	 */
146
	JavaScriptProject.prototype.getProjectPath = function getProjectPath() {
146
	JavaScriptProject.prototype.getProjectPath = function getProjectPath() {
147
		if(this.projectMeta) {
147
		if(this.projectMeta) {
148
			return this.projectMeta.Location;
148
			return this.projectMeta.Location || "/file/";
149
		}
149
		}
150
		return null;
150
		return null;
151
	};
151
	};
Lines 174-180 Link Here
174
			return this.ecma;
174
			return this.ecma;
175
		}.bind(this));
175
		}.bind(this));
176
	};
176
	};
177
	
177
178
	/**
178
	/**
179
	 * @description Fetch the named child of the current project context
179
	 * @description Fetch the named child of the current project context
180
	 * @function
180
	 * @function
Lines 185-196 Link Here
185
		if(!this.projectMeta) {
185
		if(!this.projectMeta) {
186
			return new Deferred().resolve(null);
186
			return new Deferred().resolve(null);
187
		}
187
		}
188
		var filePath = this.projectMeta.Location+childName;
188
		
189
		var filePath = this.getProjectPath()+childName;
189
		if(this.map[filePath]) {
190
		if(this.map[filePath]) {
190
			return new Deferred().resolve(this.map[filePath]);
191
			return new Deferred().resolve(this.map[filePath]);
191
		}
192
		}
192
		return this.getFileClient().read(filePath, false, false, {readIfExists: true}).then(function(child) {
193
		return this.getFileClient().read(filePath, false, false, {readIfExists: true}).then(function(child) {
193
			this.map[filePath] = {name: filePath, contents: child, project: this.projectMeta.Location};
194
			this.map[filePath] = {name: filePath, contents: child, project: this.getProjectPath()};
194
			return this.map[filePath];
195
			return this.map[filePath];
195
		}.bind(this),
196
		}.bind(this),
196
		function() {
197
		function() {
Lines 232-240 Link Here
232
						} else {
233
						} else {
233
							json = values;
234
							json = values;
234
						}
235
						}
235
						return this.getFileClient().write(this.projectMeta.Location+childName, JSON.stringify(json, null, '\t'));
236
						return this.getFileClient().write(this.getProjectPath()+childName, JSON.stringify(json, null, '\t'));
236
					} else if(create) {
237
					} else if(create) {
237
						return this.getFileClient().createFile(this.projectMeta.Location, childName).then(function(file) {
238
						return this.getFileClient().createFile(this.getProjectPath(), childName).then(function(file) {
238
							json = _defaultsFor(childName);
239
							json = _defaultsFor(childName);
239
							if(json) {
240
							if(json) {
240
								_merge(json, values);
241
								_merge(json, values);
Lines 247-259 Link Here
247
		}
248
		}
248
	};
249
	};
249
	
250
	
250
	/**
251
	/**
251
	 * @description Get the defaults used when creating a new tracked file
252
	 * @description Get the defaults used when creating a new tracked file
252
	 * @private
253
	 * @private
253
	 * @param {String} filename The name of tracked file to create
254
	 * @param {String} filename The name of tracked file to create
254
	 * @returns {{}|null} An object of default values or null
255
	 * @returns {{}|null} An object of default values or null
255
	 * @since 13.0
256
	 * @since 13.0
256
	 */
257
	 */
257
	function _defaultsFor(filename) {
258
	function _defaultsFor(filename) {
258
		switch(filename) {
259
		switch(filename) {
259
			case JavaScriptProject.prototype.TERN_PROJECT: {
260
			case JavaScriptProject.prototype.TERN_PROJECT: {
Lines 412-425 Link Here
412
			}
413
			}
413
		}
414
		}
414
		if (project) {
415
		if (project) {
415
			if(!this.projectMeta || project.Location !== this.projectMeta.Location) {
416
			if(!this.projectMeta || (project.Location !== this.projectMeta.Location && typeof this.projectMeta.Location === "string")) {
416
				this.projectMeta = project;
417
				this.projectMeta = project;
417
				delete this.ecma;
418
				delete this.ecma;
418
				delete this.map[this.TERN_PROJECT];
419
				delete this.map[this.TERN_PROJECT];
419
				_handle.call(this, "onProjectChanged", this, evnt, project.Location);
420
				_handle.call(this, "onProjectChanged", this, evnt, project.Location || "/file/");
420
				return;
421
				return;
421
			} 
422
			} 
422
			_handle.call(this, "onInputChanged", this, evnt, project.Location);
423
			_handle.call(this, "onInputChanged", this, evnt, project.Location || "/file/");
423
		} else {
424
		} else {
424
			delete this.ecma;
425
			delete this.ecma;
425
			_handle.call(this, "onProjectChanged", this, evnt, null);
426
			_handle.call(this, "onProjectChanged", this, evnt, null);
(-)a/modules/orionode/.vscode/launch.json (+55 lines)
Added Link Here
1
{
2
   "version": "0.2.0",
3
   "configurations": [
4
       {
5
           "name": "Launch",
6
           "type": "node",
7
           "request": "launch",
8
           "program": "${workspaceRoot}/server.js",
9
           "stopOnEntry": false,
10
           "args": [],
11
           "cwd": "${workspaceRoot}",
12
           "preLaunchTask": null,
13
           "runtimeExecutable": null,
14
           "runtimeArgs": [
15
               "--nolazy"
16
           ],
17
           "env": {
18
               "NODE_ENV": "development"
19
           },
20
           "externalConsole": false,
21
           "sourceMaps": false,
22
           "outDir": null
23
       },
24
       {
25
           "name": "Attach",
26
           "type": "node",
27
           "request": "attach",
28
           "port": 5858,
29
           "address": "localhost",
30
           "restart": false,
31
           "sourceMaps": false,
32
           "outDir": null,
33
           "localRoot": "${workspaceRoot}",
34
           "remoteRoot": null
35
       },
36
       {
37
           "name": "DebugInElectron",
38
           "type": "node",
39
           "request": "launch",
40
           "program": "${workspaceRoot}/server.js",
41
           "stopOnEntry": false,
42
           "args": [],
43
           "cwd": "${workspaceRoot}",
44
           "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
45
           "runtimeArgs": [
46
               ".",
47
               "--enable-logging"
48
           ],
49
           "env": {},
50
           "externalConsole": false,
51
           "sourceMaps": false,
52
           "outDir": null
53
       }
54
   ]
55
}

Return to bug 509476