mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Restore undo-redo elements for IPathService.defaultUriScheme (#132612)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo';
|
||||
import { IPathService } from 'vs/workbench/services/path/common/pathService';
|
||||
|
||||
export class WorkbenchModelServiceImpl extends ModelServiceImpl {
|
||||
constructor(
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@ITextResourcePropertiesService resourcePropertiesService: ITextResourcePropertiesService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@ILogService logService: ILogService,
|
||||
@IUndoRedoService undoRedoService: IUndoRedoService,
|
||||
@IPathService private readonly _pathService: IPathService,
|
||||
) {
|
||||
super(configurationService, resourcePropertiesService, themeService, logService, undoRedoService);
|
||||
}
|
||||
|
||||
protected override _schemaShouldMaintainUndoRedoElements(resource: URI) {
|
||||
return (
|
||||
super._schemaShouldMaintainUndoRedoElements(resource)
|
||||
|| resource.scheme === this._pathService.defaultUriScheme
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IModelService, WorkbenchModelServiceImpl, true);
|
||||
Reference in New Issue
Block a user