|
Lines 1-6
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* @license |
2 |
* @license |
| 3 |
* Copyright (c) 2011, 2014 IBM Corporation and others. |
3 |
* Copyright (c) 2011, 2016 IBM Corporation and others. |
| 4 |
* All rights reserved. This program and the accompanying materials are made |
4 |
* All rights reserved. This program and the accompanying materials are made |
| 5 |
* available under the terms of the Eclipse Public License v1.0 |
5 |
* available under the terms of the Eclipse Public License v1.0 |
| 6 |
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution |
6 |
* (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution |
|
Lines 279-285
define("orion/editor/contentAssist", [ //$NON-NLS-0$
Link Here
|
| 279 |
var selectionStart = Math.min(sel.start, sel.end); |
279 |
var selectionStart = Math.min(sel.start, sel.end); |
| 280 |
this._initialCaretOffset = Math.min(offset, selectionStart); |
280 |
this._initialCaretOffset = Math.min(offset, selectionStart); |
| 281 |
this._computedProposals = null; |
281 |
this._computedProposals = null; |
| 282 |
|
282 |
delete this._autoApply; |
| 283 |
this._computeProposals(this._initialCaretOffset).then(function(proposals) { |
283 |
this._computeProposals(this._initialCaretOffset).then(function(proposals) { |
| 284 |
if (this.isActive()) { |
284 |
if (this.isActive()) { |
| 285 |
var flatProposalArray = this._flatten(proposals); |
285 |
var flatProposalArray = this._flatten(proposals); |
|
Lines 287-293
define("orion/editor/contentAssist", [ //$NON-NLS-0$
Link Here
|
| 287 |
if (flatProposalArray && Array.isArray(flatProposalArray) && (0 < flatProposalArray.length)) { |
287 |
if (flatProposalArray && Array.isArray(flatProposalArray) && (0 < flatProposalArray.length)) { |
| 288 |
this._computedProposals = proposals; |
288 |
this._computedProposals = proposals; |
| 289 |
} |
289 |
} |
| 290 |
this.dispatchEvent({type: "ProposalsComputed", data: {proposals: flatProposalArray}, autoApply: !this._autoTriggered}); //$NON-NLS-0$ |
290 |
var autoApply = typeof this._autoApply === 'boolean' ? this._autoApply : !this._autoTriggerEnabled; |
|
|
291 |
this.dispatchEvent({type: "ProposalsComputed", data: {proposals: flatProposalArray}, autoApply: autoApply}); //$NON-NLS-0$ |
| 291 |
if (this._computedProposals && this._filterText) { |
292 |
if (this._computedProposals && this._filterText) { |
| 292 |
// force filtering here because user entered text after |
293 |
// force filtering here because user entered text after |
| 293 |
// computeProposals() was called but before the plugins |
294 |
// computeProposals() was called but before the plugins |
|
Lines 359-364
define("orion/editor/contentAssist", [ //$NON-NLS-0$
Link Here
|
| 359 |
var func; |
360 |
var func; |
| 360 |
var promise; |
361 |
var promise; |
| 361 |
var params; |
362 |
var params; |
|
|
363 |
if(typeof providerInfo.autoApply === 'boolean') { |
| 364 |
_self._autoApply = providerInfo.autoApply; |
| 365 |
} |
| 362 |
if (computePrefixFunc) { |
366 |
if (computePrefixFunc) { |
| 363 |
ecProvider = _self.editorContextProvider; |
367 |
ecProvider = _self.editorContextProvider; |
| 364 |
editorContext = ecProvider.getEditorContext(); |
368 |
editorContext = ecProvider.getEditorContext(); |