@codingame/monaco-vscode-api 1.67.12 → 1.67.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/modelEditor.js +20 -3
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -33,8 +33,8 @@ import { a as asPromise, r as raceCancellationError } from './async-9ffe4d42.js'
|
|
|
33
33
|
import { ThemeIcon as ThemeIcon$2 } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
34
34
|
import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
|
|
35
35
|
import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
36
|
-
import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
37
36
|
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
37
|
+
import { IDialogService } from 'monaco-editor/esm/vs/platform/dialogs/common/dialogs.js';
|
|
38
38
|
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
39
39
|
import { Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
40
40
|
import { EditOperation } from 'monaco-editor/esm/vs/editor/common/core/editOperation.js';
|
package/dist/modelEditor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as __decorate, d as __param, f as IFileService, h as IUriIdentityService, e as ITextFileService, S as SIDE_GROUP, A as ACTIVE_GROUP, l as IEditorService, x as isPreferredGroup } from './services-fb7952fb.js';
|
|
2
2
|
import { E as Emitter, w as withUndefinedAsNull, c as ILanguageDetectionService, u as unsupported } from './missing-services-71e80bea.js';
|
|
3
|
-
import { Disposable, MutableDisposable, dispose, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { Disposable, MutableDisposable, dispose, toDisposable, ImmortalReference } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
4
|
import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
5
5
|
import { PLAINTEXT_LANGUAGE_ID } from 'monaco-editor/esm/vs/editor/common/languages/modesRegistry.js';
|
|
6
6
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -680,6 +680,7 @@ let EditorService = class EditorService {
|
|
|
680
680
|
let newModelRef;
|
|
681
681
|
if (model == null) {
|
|
682
682
|
const modelRef = await this.textModelService.createModelReference(resource);
|
|
683
|
+
newModelRef = modelRef;
|
|
683
684
|
model = modelRef.object.textEditorModel;
|
|
684
685
|
}
|
|
685
686
|
else {
|
|
@@ -703,15 +704,31 @@ let EditorService = class EditorService {
|
|
|
703
704
|
EditorService = __decorate([
|
|
704
705
|
__param(1, ITextModelService)
|
|
705
706
|
], EditorService);
|
|
706
|
-
class CustomTextModelResolverService extends TextModelResolverService {
|
|
707
|
+
let CustomTextModelResolverService = class CustomTextModelResolverService extends TextModelResolverService {
|
|
708
|
+
constructor(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService) {
|
|
709
|
+
super(_instantiationService, fileService, undoRedoService, _modelService, uriIdentityService);
|
|
710
|
+
this._instantiationService = _instantiationService;
|
|
711
|
+
this._modelService = _modelService;
|
|
712
|
+
}
|
|
707
713
|
async createModelReference(resource) {
|
|
714
|
+
const existingModel = this._modelService.getModel(resource);
|
|
715
|
+
if (existingModel != null) {
|
|
716
|
+
return new ImmortalReference(this._instantiationService.createInstance(TextResourceEditorModel, resource));
|
|
717
|
+
}
|
|
708
718
|
const ref = await super.createModelReference(resource);
|
|
709
719
|
ref.object.textEditorModel.onWillDispose(() => {
|
|
710
720
|
ref.dispose();
|
|
711
721
|
});
|
|
712
722
|
return ref;
|
|
713
723
|
}
|
|
714
|
-
}
|
|
724
|
+
};
|
|
725
|
+
CustomTextModelResolverService = __decorate([
|
|
726
|
+
__param(0, IInstantiationService),
|
|
727
|
+
__param(1, IFileService),
|
|
728
|
+
__param(2, IUndoRedoService),
|
|
729
|
+
__param(3, IModelService),
|
|
730
|
+
__param(4, IUriIdentityService)
|
|
731
|
+
], CustomTextModelResolverService);
|
|
715
732
|
function getServiceOverride(openEditor) {
|
|
716
733
|
return {
|
|
717
734
|
[ITextModelService.toString()]: new SyncDescriptor(CustomTextModelResolverService),
|