@codingame/monaco-vscode-search-service-override 1.83.7 → 1.83.9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-search-service-override",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.9",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.83.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.9",
|
|
22
22
|
"monaco-editor": "0.44.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { extname, isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
3
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
3
4
|
import { ToggleCaseSensitiveKeybinding, ToggleWholeWordKeybinding, ToggleRegexKeybinding } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findModel.js';
|
|
4
5
|
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
5
6
|
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
@@ -73,6 +74,46 @@ SearchEditorContribution = ( __decorate([
|
|
|
73
74
|
], SearchEditorContribution));
|
|
74
75
|
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
75
76
|
workbenchContributionsRegistry.registerWorkbenchContribution(SearchEditorContribution, 1 );
|
|
77
|
+
class SearchEditorInputSerializer {
|
|
78
|
+
canSerialize(input) {
|
|
79
|
+
return !!input.tryReadConfigSync();
|
|
80
|
+
}
|
|
81
|
+
serialize(input) {
|
|
82
|
+
if (input.isDisposed()) {
|
|
83
|
+
return JSON.stringify({ modelUri: undefined, dirty: false, config: input.tryReadConfigSync(), name: input.getName(), matchRanges: [], backingUri: input.backingUri?.toString() });
|
|
84
|
+
}
|
|
85
|
+
let modelUri = undefined;
|
|
86
|
+
if (input.modelUri.path || input.modelUri.fragment && input.isDirty()) {
|
|
87
|
+
modelUri = ( input.modelUri.toString());
|
|
88
|
+
}
|
|
89
|
+
const config = input.tryReadConfigSync();
|
|
90
|
+
const dirty = input.isDirty();
|
|
91
|
+
const matchRanges = dirty ? input.getMatchRanges() : [];
|
|
92
|
+
const backingUri = input.backingUri;
|
|
93
|
+
return JSON.stringify({ modelUri, dirty, config, name: input.getName(), matchRanges, backingUri: backingUri?.toString() });
|
|
94
|
+
}
|
|
95
|
+
deserialize(instantiationService, serializedEditorInput) {
|
|
96
|
+
const { modelUri, dirty, config, matchRanges, backingUri } = JSON.parse(serializedEditorInput);
|
|
97
|
+
if (config && (config.query !== undefined)) {
|
|
98
|
+
if (modelUri) {
|
|
99
|
+
const input = instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'model', modelUri: ( URI.parse(modelUri)), config, backupOf: backingUri ? ( URI.parse(backingUri)) : undefined });
|
|
100
|
+
input.setDirty(dirty);
|
|
101
|
+
input.setMatchRanges(matchRanges);
|
|
102
|
+
return input;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
if (backingUri) {
|
|
106
|
+
return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'existingFile', fileUri: ( URI.parse(backingUri)) });
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return instantiationService.invokeFunction(getOrMakeSearchEditorInput, { from: 'rawData', resultsContents: '', config });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(SearchEditorInput.ID, SearchEditorInputSerializer);
|
|
76
117
|
CommandsRegistry.registerCommand(CleanSearchEditorStateCommandId, (accessor) => {
|
|
77
118
|
const activeEditorPane = accessor.get(IEditorService).activeEditorPane;
|
|
78
119
|
if (activeEditorPane instanceof SearchEditor) {
|