Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreadman committed Dec 8, 2024
2 parents 10cd313 + 6d8bd75 commit 9729fee
Show file tree
Hide file tree
Showing 9 changed files with 649 additions and 685 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ const testSpecs2: ISuiteSpec[] = [
{ input: 'cd ~|', expectedCompletions: ['~'], expectedResourceRequests: { type: 'folders', cwd: testCwd } },

// Relative paths
{ input: 'cd s|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd src|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd src/|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd c|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd child|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd .|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd ./|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd ./src|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd ./child|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },
{ input: 'cd ..|', expectedResourceRequests: { type: 'folders', cwd: testCwd } },

// Relative directories (changes cwd due to /)
Expand Down
5 changes: 5 additions & 0 deletions src/vs/platform/list/browser/listService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export class ListService implements IListService {

return combinedDisposable(
widget.onDidFocus(() => this.setLastFocusedList(widget)),
widget.onDidBlur(() => {
if (this._lastFocusedWidget === widget) {
this.setLastFocusedList(undefined);
}
}),
toDisposable(() => this.lists.splice(this.lists.indexOf(registeredList), 1)),
widget.onDidDispose(() => {
this.lists = this.lists.filter(l => l !== registeredList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { diffSets, diffMaps } from '../../../base/common/collections.js';
import { IPaneCompositePartService } from '../../services/panecomposite/browser/panecomposite.js';
import { ViewContainerLocation } from '../../common/views.js';
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
import { IDirtyDiffModelService } from '../../contrib/scm/browser/diff.js';
import { IDirtyDiffModelService } from '../../contrib/scm/browser/dirtyDiffModel.js';


class TextEditorSnapshot {
Expand Down
15 changes: 8 additions & 7 deletions src/vs/workbench/api/browser/mainThreadEditors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import { IExtHostContext } from '../../services/extensions/common/extHostCustome
import { IEditorControl } from '../../common/editor.js';
import { getCodeEditor, ICodeEditor } from '../../../editor/browser/editorBrowser.js';
import { IConfigurationService } from '../../../platform/configuration/common/configuration.js';
import { DirtyDiffContribution } from '../../contrib/scm/browser/dirtydiffDecorator.js';
import { IDirtyDiffModelService } from '../../contrib/scm/browser/diff.js';
import { IDirtyDiffModelService } from '../../contrib/scm/browser/dirtyDiffModel.js';
import { autorun, constObservable, derived, derivedOpts, IObservable, observableFromEvent } from '../../../base/common/observable.js';
import { IUriIdentityService } from '../../../platform/uriIdentity/common/uriIdentity.js';
import { isITextModel } from '../../../editor/common/model.js';
Expand Down Expand Up @@ -386,13 +385,15 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
return Promise.resolve(diffEditor.getLineChanges() || []);
}

const dirtyDiffContribution = codeEditor.getContribution('editor.contrib.dirtydiff');

if (dirtyDiffContribution) {
return Promise.resolve((dirtyDiffContribution as DirtyDiffContribution).getChanges());
if (!codeEditor.hasModel()) {
return Promise.resolve([]);
}

return Promise.resolve([]);
const dirtyDiffModel = this._dirtyDiffModelService.getDirtyDiffModel(codeEditor.getModel().uri);
const scmQuickDiff = dirtyDiffModel?.quickDiffs.find(quickDiff => quickDiff.isSCM);
const scmQuickDiffChanges = dirtyDiffModel?.changes.filter(change => change.label === scmQuickDiff?.label);

return Promise.resolve(scmQuickDiffChanges?.map(change => change.change) ?? []);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { LanguageService } from '../../../../editor/common/services/languageServ
import { ILanguageConfigurationService } from '../../../../editor/common/languages/languageConfigurationRegistry.js';
import { TestLanguageConfigurationService } from '../../../../editor/test/common/modes/testLanguageConfigurationService.js';
import { IUndoRedoService } from '../../../../platform/undoRedo/common/undoRedo.js';
import { IDirtyDiffModelService } from '../../../contrib/scm/browser/diff.js';
import { IDirtyDiffModelService } from '../../../contrib/scm/browser/dirtyDiffModel.js';
import { ITextEditorDiffInformation } from '../../../../platform/editor/common/editor.js';

suite('MainThreadDocumentsAndEditors', () => {
Expand Down
130 changes: 0 additions & 130 deletions src/vs/workbench/contrib/scm/browser/diff.ts

This file was deleted.

Loading

0 comments on commit 9729fee

Please sign in to comment.