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 465610 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/contentAssist.js (-2 / +33 lines)
Lines 102-109 Link Here
102
		dfault : "proposal-default" //$NON-NLS-0$
102
		dfault : "proposal-default" //$NON-NLS-0$
103
	};
103
	};
104
	
104
	
105
	function ContentAssist(textView) {
105
	/**
106
	 * @name ContentAssist
107
	 * @description Creates a new content assist manager for the given text ciew
108
	 * @param textView The text view to provide content assist for
109
	 * @param serviceRegistry Optional, used to look up page message service for status
110
	 */
111
	function ContentAssist(textView, serviceRegistry) {
106
		this.textView = textView;
112
		this.textView = textView;
113
		if (serviceRegistry){
114
			this.pageMessage = serviceRegistry.getService("orion.page.message"); //$NON-NLS-1$
115
		}
107
		this.state = State.INACTIVE;
116
		this.state = State.INACTIVE;
108
		this.clearProviders();
117
		this.clearProviders();
109
		var self = this;
118
		var self = this;
Lines 368-375 Link Here
368
				}
377
				}
369
				return Deferred.when(proposals);
378
				return Deferred.when(proposals);
370
			});
379
			});
380
			
371
			// TODO should we allow error to propagate instead of handling here?
381
			// TODO should we allow error to propagate instead of handling here?
372
			return Deferred.all(promises, this.handleError);
382
			var allPromises = Deferred.all(promises, this.handleError);
383
			
384
			if (this.pageMessage){
385
				allPromises = Deferred.when(allPromises, function(proposals){
386
					var foundProposal = false;
387
					if (proposals && proposals.length > 0){
388
						for (var i=0; i<proposals.length; i++) {
389
							if (proposals[i].length > 0){
390
								foundProposal = true;
391
								break;
392
							}
393
						}
394
					}
395
					if (!foundProposal){
396
						self.pageMessage.setErrorMessage(messages["noProposals"]);
397
					}
398
					return proposals;
399
				});
400
				self.pageMessage.showWhile(allPromises, messages["computingProposals"]);
401
			}
402
			
403
			return allPromises;
373
		},
404
		},
374
405
375
		filterProposals: function(force) {
406
		filterProposals: function(force) {
(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/nls/root/messages.js (+2 lines)
Lines 134-139 Link Here
134
	"linkedModeExited": "Linked Mode exited", //$NON-NLS-1$ //$NON-NLS-0$
134
	"linkedModeExited": "Linked Mode exited", //$NON-NLS-1$ //$NON-NLS-0$
135
	"syntaxError": "Syntax Error", //$NON-NLS-1$ //$NON-NLS-0$
135
	"syntaxError": "Syntax Error", //$NON-NLS-1$ //$NON-NLS-0$
136
	"contentAssist": "Content Assist", //$NON-NLS-1$ //$NON-NLS-0$
136
	"contentAssist": "Content Assist", //$NON-NLS-1$ //$NON-NLS-0$
137
	"noProposals": "No proposals found",
138
	"computingProposals": "Computing content assist proposals...",
137
	"lineColumn": "Line ${0} : Column ${1}", //$NON-NLS-1$ //$NON-NLS-0$
139
	"lineColumn": "Line ${0} : Column ${1}", //$NON-NLS-1$ //$NON-NLS-0$
138
	"multiSelections": "${0} selection regions", //$NON-NLS-1$ //$NON-NLS-0$
140
	"multiSelections": "${0} selection regions", //$NON-NLS-1$ //$NON-NLS-0$
139
	
141
	
(-)a/bundles/org.eclipse.orion.client.ui/web/orion/editorView.js (-1 / +1 lines)
Lines 416-422 Link Here
416
416
417
			var contentAssistFactory = readonly ? null : {
417
			var contentAssistFactory = readonly ? null : {
418
				createContentAssistMode: function(editor) {
418
				createContentAssistMode: function(editor) {
419
					var contentAssist = new mContentAssist.ContentAssist(editor.getTextView());
419
					var contentAssist = new mContentAssist.ContentAssist(editor.getTextView(), serviceRegistry);
420
420
421
					contentAssist.addEventListener("Activating", setContentAssistProviders.bind(null, editor, contentAssist)); //$NON-NLS-0$
421
					contentAssist.addEventListener("Activating", setContentAssistProviders.bind(null, editor, contentAssist)); //$NON-NLS-0$
422
					var widget = new mContentAssist.ContentAssistWidget(contentAssist, "contentassist"); //$NON-NLS-0$
422
					var widget = new mContentAssist.ContentAssistWidget(contentAssist, "contentassist"); //$NON-NLS-0$

Return to bug 465610