Skip to content

Commit 0a63c31

Browse files
ergunshDevtools-frontend LUCI CQ
authored andcommitted
[Workspace] Remove resetting working copy after text change
We started using `setWorkingCopy` to update UISourceCodes programmatically from other parts of DevTools (e.g. Styles tab & PatchWidget). Because of this, the logic for comparing the cleanliness of the code needs fixing and crrev.com/c/6381859 attempted doing it. However, somehow, with that change; updating styles from styles tab and calling `setWorkingCopy` do not update the `UISourceCode` at all and there are test failures attached to that CL. Until we figure out what's going on, it's best to disable the logic for resetting working copy when `isClean()` reports true on text change. There is one more place where we have a similar logic: activating the pretty toggle when the `isClean()` reports true on text change but that's a smaller bug that we can afford right now. Bug: 402699175 Change-Id: Id175cfaeb44ffa7728f30b28893654d73af6dd8e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6405494 Reviewed-by: Benedikt Meurer <[email protected]> Commit-Queue: Ergün Erdoğmuş <[email protected]>
1 parent fca5397 commit 0a63c31

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

front_end/panels/sources/UISourceCodeFrame.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ export class UISourceCodeFrame extends
286286
this.errorPopoverHelper.hidePopover();
287287
SourcesPanel.instance().updateLastModificationTime();
288288
this.muteSourceCodeEvents = true;
289-
if (this.isClean()) {
290-
this.uiSourceCodeInternal.resetWorkingCopy();
291-
} else {
292-
this.uiSourceCodeInternal.setWorkingCopyGetter(() => this.textEditor.state.sliceDoc());
293-
}
289+
// TODO: Bring back `isClean()` check and
290+
// resetting working copy after making sure that
291+
// `isClean()` correctly reports true only when
292+
// the original code and the working copy is the same.
293+
this.uiSourceCodeInternal.setWorkingCopyGetter(() => this.textEditor.state.sliceDoc());
294294
this.muteSourceCodeEvents = false;
295295
if (wasPretty !== this.pretty) {
296296
this.updateStyle();

0 commit comments

Comments
 (0)