| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * | 10 * |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 constructor(uiSourceCode) { | 36 constructor(uiSourceCode) { |
| 37 super(uiSourceCode.contentURL(), workingCopy); | 37 super(uiSourceCode.contentURL(), workingCopy); |
| 38 this._uiSourceCode = uiSourceCode; | 38 this._uiSourceCode = uiSourceCode; |
| 39 this.setEditable(this._canEditSource()); | 39 this.setEditable(this._canEditSource()); |
| 40 | 40 |
| 41 if (Runtime.experiments.isEnabled('sourceDiff')) | 41 if (Runtime.experiments.isEnabled('sourceDiff')) |
| 42 this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(),
this.textEditor); | 42 this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(),
this.textEditor); |
| 43 | 43 |
| 44 | 44 |
| 45 /** @type {?UI.AutocompleteConfig} */ | 45 /** @type {?UI.AutocompleteConfig} */ |
| 46 this._autocompleteConfig = {isWordChar: Common.TextUtils.isWordChar}; | 46 this._autocompleteConfig = {isWordChar: TextUtils.TextUtils.isWordChar}; |
| 47 Common.moduleSetting('textEditorAutocompletion').addChangeListener(this._upd
ateAutocomplete, this); | 47 Common.moduleSetting('textEditorAutocompletion').addChangeListener(this._upd
ateAutocomplete, this); |
| 48 this._updateAutocomplete(); | 48 this._updateAutocomplete(); |
| 49 | 49 |
| 50 /** @type {?Persistence.PersistenceBinding} */ | 50 /** @type {?Persistence.PersistenceBinding} */ |
| 51 this._persistenceBinding = Persistence.persistence.binding(uiSourceCode); | 51 this._persistenceBinding = Persistence.persistence.binding(uiSourceCode); |
| 52 | 52 |
| 53 /** @type {!Map<number, !SourceFrame.UISourceCodeFrame.RowMessageBucket>} */ | 53 /** @type {!Map<number, !SourceFrame.UISourceCodeFrame.RowMessageBucket>} */ |
| 54 this._rowMessageBuckets = new Map(); | 54 this._rowMessageBuckets = new Map(); |
| 55 /** @type {!Set<string>} */ | 55 /** @type {!Set<string>} */ |
| 56 this._typeDecorationsPending = new Set(); | 56 this._typeDecorationsPending = new Set(); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (this._persistenceBinding) { | 181 if (this._persistenceBinding) { |
| 182 var combinedSet = this._persistenceBinding.network.messages(); | 182 var combinedSet = this._persistenceBinding.network.messages(); |
| 183 combinedSet.addAll(this._persistenceBinding.fileSystem.messages()); | 183 combinedSet.addAll(this._persistenceBinding.fileSystem.messages()); |
| 184 return combinedSet; | 184 return combinedSet; |
| 185 } | 185 } |
| 186 return this._uiSourceCode.messages(); | 186 return this._uiSourceCode.messages(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 /** | 189 /** |
| 190 * @override | 190 * @override |
| 191 * @param {!Common.TextRange} oldRange | 191 * @param {!TextUtils.TextRange} oldRange |
| 192 * @param {!Common.TextRange} newRange | 192 * @param {!TextUtils.TextRange} newRange |
| 193 */ | 193 */ |
| 194 onTextChanged(oldRange, newRange) { | 194 onTextChanged(oldRange, newRange) { |
| 195 super.onTextChanged(oldRange, newRange); | 195 super.onTextChanged(oldRange, newRange); |
| 196 this._errorPopoverHelper.hidePopover(); | 196 this._errorPopoverHelper.hidePopover(); |
| 197 if (this._isSettingContent) | 197 if (this._isSettingContent) |
| 198 return; | 198 return; |
| 199 this._muteSourceCodeEvents = true; | 199 this._muteSourceCodeEvents = true; |
| 200 if (this.textEditor.isClean()) | 200 if (this.textEditor.isClean()) |
| 201 this._uiSourceCode.resetWorkingCopy(); | 201 this._uiSourceCode.resetWorkingCopy(); |
| 202 else | 202 else |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 } | 573 } |
| 574 | 574 |
| 575 /** | 575 /** |
| 576 * @param {number} lineNumber | 576 * @param {number} lineNumber |
| 577 * @param {number} columnNumber | 577 * @param {number} columnNumber |
| 578 */ | 578 */ |
| 579 _updateWavePosition(lineNumber, columnNumber) { | 579 _updateWavePosition(lineNumber, columnNumber) { |
| 580 lineNumber = Math.min(lineNumber, this.textEditor.linesCount - 1); | 580 lineNumber = Math.min(lineNumber, this.textEditor.linesCount - 1); |
| 581 var lineText = this.textEditor.line(lineNumber); | 581 var lineText = this.textEditor.line(lineNumber); |
| 582 columnNumber = Math.min(columnNumber, lineText.length); | 582 columnNumber = Math.min(columnNumber, lineText.length); |
| 583 var lineIndent = Common.TextUtils.lineIndent(lineText).length; | 583 var lineIndent = TextUtils.TextUtils.lineIndent(lineText).length; |
| 584 if (this._hasDecoration) | 584 if (this._hasDecoration) |
| 585 this.textEditor.removeDecoration(this._decoration, lineNumber); | 585 this.textEditor.removeDecoration(this._decoration, lineNumber); |
| 586 this._hasDecoration = true; | 586 this._hasDecoration = true; |
| 587 this.textEditor.addDecoration(this._decoration, lineNumber, Math.max(columnN
umber - 1, lineIndent)); | 587 this.textEditor.addDecoration(this._decoration, lineNumber, Math.max(columnN
umber - 1, lineIndent)); |
| 588 } | 588 } |
| 589 | 589 |
| 590 /** | 590 /** |
| 591 * @return {!Element} | 591 * @return {!Element} |
| 592 */ | 592 */ |
| 593 messagesDescription() { | 593 messagesDescription() { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 | 690 |
| 691 /** | 691 /** |
| 692 * @param {!Workspace.UISourceCode.Message} a | 692 * @param {!Workspace.UISourceCode.Message} a |
| 693 * @param {!Workspace.UISourceCode.Message} b | 693 * @param {!Workspace.UISourceCode.Message} b |
| 694 * @return {number} | 694 * @return {number} |
| 695 */ | 695 */ |
| 696 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { | 696 Workspace.UISourceCode.Message.messageLevelComparator = function(a, b) { |
| 697 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - | 697 return Workspace.UISourceCode.Message._messageLevelPriority[a.level()] - |
| 698 Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; | 698 Workspace.UISourceCode.Message._messageLevelPriority[b.level()]; |
| 699 }; | 699 }; |
| OLD | NEW |