@codingame/monaco-vscode-views-service-override 1.85.0 → 1.85.2
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/assets/index-no-csp.html +4 -0
- package/assets/index.html +5 -1
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +11 -9
- package/tools/editor.js +1 -1
- package/views.d.ts +9 -4
- package/views.js +32 -10
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +692 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +240 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +77 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorSerializer.js +42 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +71 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +346 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +96 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +145 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +103 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +399 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +196 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/fixedZoneWidget.js +41 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/lineAlignment.js +128 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/media/mergeEditor.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +611 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +158 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +262 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +173 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +79 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +1 -1
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +3 -0
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -3
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +0 -16
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +0 -107
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +0 -1604
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +0 -390
- package/vscode/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js +0 -157
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +0 -5
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +0 -217
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +0 -91
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +0 -1837
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".monaco-workbench .simple-find-part-wrapper{max-width:calc(100% - 64px);overflow:hidden;padding:0 10px 10px;pointer-events:none;position:absolute;right:18px;top:0;z-index:10}.simple-find-part .monaco-inputbox>.ibwrapper>input{text-overflow:clip}.monaco-workbench .simple-find-part{align-items:center;background-color:var(--vscode-editorWidget-background)!important;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);display:flex;font-size:12px;padding:4px;pointer-events:all;position:relative;top:-45px;transition:top .2s linear;visibility:hidden;z-index:10}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:top 0ms linear}.monaco-workbench .simple-find-part.visible{visibility:visible}.monaco-workbench .simple-find-part.suppress-transition{transition:none}.monaco-workbench .simple-find-part.visible-transition{top:0}.monaco-workbench .simple-find-part .monaco-findInput{flex:1}.monaco-workbench .simple-find-part .matchesCount{max-width:73px;min-width:73px;padding-left:5px;width:73px}.monaco-workbench .simple-find-part.reduced-find-widget .matchesCount{display:none}.monaco-workbench .simple-find-part .button{background-position:50%;background-repeat:no-repeat;cursor:pointer;display:flex;flex:initial;height:20px;justify-content:center;line-height:20px;margin-left:3px;min-width:20px;width:20px}.monaco-workbench div.simple-find-part div.button.disabled{cursor:default;opacity:.3!important}div.simple-find-part-wrapper div.button{border-radius:5px}.no-results.matchesCount{color:var(--vscode-errorForeground)}div.simple-find-part-wrapper div.button:hover:not(.disabled){background-color:var(--vscode-toolbar-hoverBackground);outline:1px dashed var(--vscode-toolbar-hoverOutline);outline-offset:-1px}.monaco-workbench .simple-find-part .monaco-sash{border-bottom-left-radius:4px;border-left:1px solid;left:0!important}.monaco-workbench .simple-find-part .monaco-sash.vertical:before{left:calc(50% - var(--vscode-sash-hover-size)/4);width:2px}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
import './simpleFindWidget.css.js';
|
|
2
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
-
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
4
|
-
import { Widget } from 'monaco-editor/esm/vs/base/browser/ui/widget.js';
|
|
5
|
-
import { Delayer } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
6
|
-
import { FindReplaceState } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findState.js';
|
|
7
|
-
import { SimpleButton, findPreviousMatchIcon, findNextMatchIcon, NLS_MATCHES_LOCATION, NLS_NO_RESULTS } from 'monaco-editor/esm/vs/editor/contrib/find/browser/findWidget.js';
|
|
8
|
-
import { ContextScopedFindInput } from 'monaco-editor/esm/vs/platform/history/browser/contextScopedHistoryWidget.js';
|
|
9
|
-
import { widgetClose } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
10
|
-
import { registerThemingParticipant } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
11
|
-
import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
|
|
12
|
-
import { showHistoryKeybindingHint } from 'monaco-editor/esm/vs/platform/history/browser/historyWidgetKeybindingHint.js';
|
|
13
|
-
import { status } from 'monaco-editor/esm/vs/base/browser/ui/aria/aria.js';
|
|
14
|
-
import { defaultInputBoxStyles, defaultToggleStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
15
|
-
import { Sash } from 'monaco-editor/esm/vs/base/browser/ui/sash/sash.js';
|
|
16
|
-
import { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
17
|
-
|
|
18
|
-
const NLS_FIND_INPUT_LABEL = ( nls.localizeWithPath(
|
|
19
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
20
|
-
'label.find',
|
|
21
|
-
"Find"
|
|
22
|
-
));
|
|
23
|
-
const NLS_FIND_INPUT_PLACEHOLDER = ( nls.localizeWithPath(
|
|
24
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
25
|
-
'placeholder.find',
|
|
26
|
-
"Find"
|
|
27
|
-
));
|
|
28
|
-
const NLS_PREVIOUS_MATCH_BTN_LABEL = ( nls.localizeWithPath(
|
|
29
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
30
|
-
'label.previousMatchButton',
|
|
31
|
-
"Previous Match"
|
|
32
|
-
));
|
|
33
|
-
const NLS_NEXT_MATCH_BTN_LABEL = ( nls.localizeWithPath(
|
|
34
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
35
|
-
'label.nextMatchButton',
|
|
36
|
-
"Next Match"
|
|
37
|
-
));
|
|
38
|
-
const NLS_CLOSE_BTN_LABEL = ( nls.localizeWithPath(
|
|
39
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
40
|
-
'label.closeButton',
|
|
41
|
-
"Close"
|
|
42
|
-
));
|
|
43
|
-
const SIMPLE_FIND_WIDGET_INITIAL_WIDTH = 310;
|
|
44
|
-
const MATCHES_COUNT_WIDTH = 73;
|
|
45
|
-
class SimpleFindWidget extends Widget {
|
|
46
|
-
constructor(options, contextViewService, contextKeyService, _keybindingService) {
|
|
47
|
-
super();
|
|
48
|
-
this._keybindingService = _keybindingService;
|
|
49
|
-
this._isVisible = false;
|
|
50
|
-
this._foundMatch = false;
|
|
51
|
-
this._width = 0;
|
|
52
|
-
this.state = ( new FindReplaceState());
|
|
53
|
-
this._matchesLimit = options.matchesLimit ?? Number.MAX_SAFE_INTEGER;
|
|
54
|
-
this._findInput = this._register(( new ContextScopedFindInput(null, contextViewService, {
|
|
55
|
-
label: NLS_FIND_INPUT_LABEL,
|
|
56
|
-
placeholder: NLS_FIND_INPUT_PLACEHOLDER,
|
|
57
|
-
validation: (value) => {
|
|
58
|
-
if (value.length === 0 || !this._findInput.getRegex()) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
this._foundMatch = false;
|
|
66
|
-
this.updateButtons(this._foundMatch);
|
|
67
|
-
return { content: e.message };
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
showCommonFindToggles: options.showCommonFindToggles,
|
|
71
|
-
appendCaseSensitiveLabel: options.appendCaseSensitiveActionId ? this._getKeybinding(options.appendCaseSensitiveActionId) : undefined,
|
|
72
|
-
appendRegexLabel: options.appendRegexActionId ? this._getKeybinding(options.appendRegexActionId) : undefined,
|
|
73
|
-
appendWholeWordsLabel: options.appendWholeWordsActionId ? this._getKeybinding(options.appendWholeWordsActionId) : undefined,
|
|
74
|
-
showHistoryHint: () => showHistoryKeybindingHint(_keybindingService),
|
|
75
|
-
inputBoxStyles: defaultInputBoxStyles,
|
|
76
|
-
toggleStyles: defaultToggleStyles
|
|
77
|
-
}, contextKeyService)));
|
|
78
|
-
this._updateHistoryDelayer = this._register(( new Delayer(500)));
|
|
79
|
-
this._register(this._findInput.onInput(async (e) => {
|
|
80
|
-
if (!options.checkImeCompletionState || !this._findInput.isImeSessionInProgress) {
|
|
81
|
-
this._foundMatch = this._onInputChanged();
|
|
82
|
-
if (options.showResultCount) {
|
|
83
|
-
await this.updateResultCount();
|
|
84
|
-
}
|
|
85
|
-
this.updateButtons(this._foundMatch);
|
|
86
|
-
this.focusFindBox();
|
|
87
|
-
this._delayedUpdateHistory();
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
90
|
-
this._findInput.setRegex(!!this.state.isRegex);
|
|
91
|
-
this._findInput.setCaseSensitive(!!this.state.matchCase);
|
|
92
|
-
this._findInput.setWholeWords(!!this.state.wholeWord);
|
|
93
|
-
this._register(this._findInput.onDidOptionChange(() => {
|
|
94
|
-
this.state.change({
|
|
95
|
-
isRegex: this._findInput.getRegex(),
|
|
96
|
-
wholeWord: this._findInput.getWholeWords(),
|
|
97
|
-
matchCase: this._findInput.getCaseSensitive()
|
|
98
|
-
}, true);
|
|
99
|
-
}));
|
|
100
|
-
this._register(this.state.onFindReplaceStateChange(() => {
|
|
101
|
-
this._findInput.setRegex(this.state.isRegex);
|
|
102
|
-
this._findInput.setWholeWords(this.state.wholeWord);
|
|
103
|
-
this._findInput.setCaseSensitive(this.state.matchCase);
|
|
104
|
-
this.findFirst();
|
|
105
|
-
}));
|
|
106
|
-
this.prevBtn = this._register(( new SimpleButton({
|
|
107
|
-
label: NLS_PREVIOUS_MATCH_BTN_LABEL + (options.previousMatchActionId ? this._getKeybinding(options.previousMatchActionId) : ''),
|
|
108
|
-
icon: findPreviousMatchIcon,
|
|
109
|
-
onTrigger: () => {
|
|
110
|
-
this.find(true);
|
|
111
|
-
}
|
|
112
|
-
})));
|
|
113
|
-
this.nextBtn = this._register(( new SimpleButton({
|
|
114
|
-
label: NLS_NEXT_MATCH_BTN_LABEL + (options.nextMatchActionId ? this._getKeybinding(options.nextMatchActionId) : ''),
|
|
115
|
-
icon: findNextMatchIcon,
|
|
116
|
-
onTrigger: () => {
|
|
117
|
-
this.find(false);
|
|
118
|
-
}
|
|
119
|
-
})));
|
|
120
|
-
const closeBtn = this._register(( new SimpleButton({
|
|
121
|
-
label: NLS_CLOSE_BTN_LABEL + (options.closeWidgetActionId ? this._getKeybinding(options.closeWidgetActionId) : ''),
|
|
122
|
-
icon: widgetClose,
|
|
123
|
-
onTrigger: () => {
|
|
124
|
-
this.hide();
|
|
125
|
-
}
|
|
126
|
-
})));
|
|
127
|
-
this._innerDomNode = document.createElement('div');
|
|
128
|
-
this._innerDomNode.classList.add('simple-find-part');
|
|
129
|
-
this._innerDomNode.appendChild(this._findInput.domNode);
|
|
130
|
-
this._innerDomNode.appendChild(this.prevBtn.domNode);
|
|
131
|
-
this._innerDomNode.appendChild(this.nextBtn.domNode);
|
|
132
|
-
this._innerDomNode.appendChild(closeBtn.domNode);
|
|
133
|
-
this._domNode = document.createElement('div');
|
|
134
|
-
this._domNode.classList.add('simple-find-part-wrapper');
|
|
135
|
-
this._domNode.appendChild(this._innerDomNode);
|
|
136
|
-
this.onkeyup(this._innerDomNode, e => {
|
|
137
|
-
if (e.equals(9 )) {
|
|
138
|
-
this.hide();
|
|
139
|
-
e.preventDefault();
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
this._focusTracker = this._register(dom.trackFocus(this._innerDomNode));
|
|
144
|
-
this._register(this._focusTracker.onDidFocus(this._onFocusTrackerFocus.bind(this)));
|
|
145
|
-
this._register(this._focusTracker.onDidBlur(this._onFocusTrackerBlur.bind(this)));
|
|
146
|
-
this._findInputFocusTracker = this._register(dom.trackFocus(this._findInput.domNode));
|
|
147
|
-
this._register(this._findInputFocusTracker.onDidFocus(this._onFindInputFocusTrackerFocus.bind(this)));
|
|
148
|
-
this._register(this._findInputFocusTracker.onDidBlur(this._onFindInputFocusTrackerBlur.bind(this)));
|
|
149
|
-
this._register(dom.addDisposableListener(this._innerDomNode, 'click', (event) => {
|
|
150
|
-
event.stopPropagation();
|
|
151
|
-
}));
|
|
152
|
-
if (options?.showResultCount) {
|
|
153
|
-
this._domNode.classList.add('result-count');
|
|
154
|
-
this._matchesCount = document.createElement('div');
|
|
155
|
-
this._matchesCount.className = 'matchesCount';
|
|
156
|
-
this._findInput.domNode.insertAdjacentElement('afterend', this._matchesCount);
|
|
157
|
-
this._register(this._findInput.onDidChange(async () => {
|
|
158
|
-
await this.updateResultCount();
|
|
159
|
-
}));
|
|
160
|
-
this._register(this._findInput.onDidOptionChange(async () => {
|
|
161
|
-
this._foundMatch = this._onInputChanged();
|
|
162
|
-
await this.updateResultCount();
|
|
163
|
-
this.focusFindBox();
|
|
164
|
-
this._delayedUpdateHistory();
|
|
165
|
-
}));
|
|
166
|
-
}
|
|
167
|
-
let initialMinWidth = options?.initialWidth;
|
|
168
|
-
if (initialMinWidth) {
|
|
169
|
-
initialMinWidth = initialMinWidth < SIMPLE_FIND_WIDGET_INITIAL_WIDTH ? SIMPLE_FIND_WIDGET_INITIAL_WIDTH : initialMinWidth;
|
|
170
|
-
this._domNode.style.width = `${initialMinWidth}px`;
|
|
171
|
-
}
|
|
172
|
-
if (options?.enableSash) {
|
|
173
|
-
const _initialMinWidth = initialMinWidth ?? SIMPLE_FIND_WIDGET_INITIAL_WIDTH;
|
|
174
|
-
let originalWidth = _initialMinWidth;
|
|
175
|
-
const resizeSash = this._register(( new Sash(
|
|
176
|
-
this._innerDomNode,
|
|
177
|
-
this,
|
|
178
|
-
{ orientation: 0 , size: 1 }
|
|
179
|
-
)));
|
|
180
|
-
this._register(resizeSash.onDidStart(() => {
|
|
181
|
-
originalWidth = parseFloat(dom.getComputedStyle(this._domNode).width);
|
|
182
|
-
}));
|
|
183
|
-
this._register(resizeSash.onDidChange((e) => {
|
|
184
|
-
const width = originalWidth + e.startX - e.currentX;
|
|
185
|
-
if (width < _initialMinWidth) {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
this._domNode.style.width = `${width}px`;
|
|
189
|
-
}));
|
|
190
|
-
this._register(resizeSash.onDidReset(e => {
|
|
191
|
-
const currentWidth = parseFloat(dom.getComputedStyle(this._domNode).width);
|
|
192
|
-
if (currentWidth === _initialMinWidth) {
|
|
193
|
-
this._domNode.style.width = '100%';
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
this._domNode.style.width = `${_initialMinWidth}px`;
|
|
197
|
-
}
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
getVerticalSashLeft(_sash) {
|
|
202
|
-
return 0;
|
|
203
|
-
}
|
|
204
|
-
get inputValue() {
|
|
205
|
-
return this._findInput.getValue();
|
|
206
|
-
}
|
|
207
|
-
get focusTracker() {
|
|
208
|
-
return this._focusTracker;
|
|
209
|
-
}
|
|
210
|
-
_getKeybinding(actionId) {
|
|
211
|
-
const kb = this._keybindingService?.lookupKeybinding(actionId);
|
|
212
|
-
if (!kb) {
|
|
213
|
-
return '';
|
|
214
|
-
}
|
|
215
|
-
return ` (${kb.getLabel()})`;
|
|
216
|
-
}
|
|
217
|
-
dispose() {
|
|
218
|
-
super.dispose();
|
|
219
|
-
if (this._domNode && this._domNode.parentElement) {
|
|
220
|
-
this._domNode.parentElement.removeChild(this._domNode);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
isVisible() {
|
|
224
|
-
return this._isVisible;
|
|
225
|
-
}
|
|
226
|
-
getDomNode() {
|
|
227
|
-
return this._domNode;
|
|
228
|
-
}
|
|
229
|
-
getFindInputDomNode() {
|
|
230
|
-
return this._findInput.domNode;
|
|
231
|
-
}
|
|
232
|
-
reveal(initialInput, animated = true) {
|
|
233
|
-
if (initialInput) {
|
|
234
|
-
this._findInput.setValue(initialInput);
|
|
235
|
-
}
|
|
236
|
-
if (this._isVisible) {
|
|
237
|
-
this._findInput.select();
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
this._isVisible = true;
|
|
241
|
-
this.updateResultCount();
|
|
242
|
-
this.layout();
|
|
243
|
-
setTimeout(() => {
|
|
244
|
-
this._innerDomNode.classList.toggle('suppress-transition', !animated);
|
|
245
|
-
this._innerDomNode.classList.add('visible', 'visible-transition');
|
|
246
|
-
this._innerDomNode.setAttribute('aria-hidden', 'false');
|
|
247
|
-
this._findInput.select();
|
|
248
|
-
if (!animated) {
|
|
249
|
-
setTimeout(() => {
|
|
250
|
-
this._innerDomNode.classList.remove('suppress-transition');
|
|
251
|
-
}, 0);
|
|
252
|
-
}
|
|
253
|
-
}, 0);
|
|
254
|
-
}
|
|
255
|
-
show(initialInput) {
|
|
256
|
-
if (initialInput && !this._isVisible) {
|
|
257
|
-
this._findInput.setValue(initialInput);
|
|
258
|
-
}
|
|
259
|
-
this._isVisible = true;
|
|
260
|
-
this.layout();
|
|
261
|
-
setTimeout(() => {
|
|
262
|
-
this._innerDomNode.classList.add('visible', 'visible-transition');
|
|
263
|
-
this._innerDomNode.setAttribute('aria-hidden', 'false');
|
|
264
|
-
}, 0);
|
|
265
|
-
}
|
|
266
|
-
hide(animated = true) {
|
|
267
|
-
if (this._isVisible) {
|
|
268
|
-
this._innerDomNode.classList.toggle('suppress-transition', !animated);
|
|
269
|
-
this._innerDomNode.classList.remove('visible-transition');
|
|
270
|
-
this._innerDomNode.setAttribute('aria-hidden', 'true');
|
|
271
|
-
setTimeout(() => {
|
|
272
|
-
this._isVisible = false;
|
|
273
|
-
this.updateButtons(this._foundMatch);
|
|
274
|
-
this._innerDomNode.classList.remove('visible', 'suppress-transition');
|
|
275
|
-
}, animated ? 200 : 0);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
layout(width = this._width) {
|
|
279
|
-
this._width = width;
|
|
280
|
-
if (!this._isVisible) {
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
if (this._matchesCount) {
|
|
284
|
-
let reducedFindWidget = false;
|
|
285
|
-
if (SIMPLE_FIND_WIDGET_INITIAL_WIDTH + MATCHES_COUNT_WIDTH + 28 >= width) {
|
|
286
|
-
reducedFindWidget = true;
|
|
287
|
-
}
|
|
288
|
-
this._innerDomNode.classList.toggle('reduced-find-widget', reducedFindWidget);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
_delayedUpdateHistory() {
|
|
292
|
-
this._updateHistoryDelayer.trigger(this._updateHistory.bind(this));
|
|
293
|
-
}
|
|
294
|
-
_updateHistory() {
|
|
295
|
-
this._findInput.inputBox.addToHistory();
|
|
296
|
-
}
|
|
297
|
-
_getRegexValue() {
|
|
298
|
-
return this._findInput.getRegex();
|
|
299
|
-
}
|
|
300
|
-
_getWholeWordValue() {
|
|
301
|
-
return this._findInput.getWholeWords();
|
|
302
|
-
}
|
|
303
|
-
_getCaseSensitiveValue() {
|
|
304
|
-
return this._findInput.getCaseSensitive();
|
|
305
|
-
}
|
|
306
|
-
updateButtons(foundMatch) {
|
|
307
|
-
const hasInput = this.inputValue.length > 0;
|
|
308
|
-
this.prevBtn.setEnabled(this._isVisible && hasInput && foundMatch);
|
|
309
|
-
this.nextBtn.setEnabled(this._isVisible && hasInput && foundMatch);
|
|
310
|
-
}
|
|
311
|
-
focusFindBox() {
|
|
312
|
-
this.nextBtn.focus();
|
|
313
|
-
this._findInput.inputBox.focus();
|
|
314
|
-
}
|
|
315
|
-
async updateResultCount() {
|
|
316
|
-
if (!this._matchesCount) {
|
|
317
|
-
this.updateButtons(this._foundMatch);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
const count = await this._getResultCount();
|
|
321
|
-
this._matchesCount.innerText = '';
|
|
322
|
-
const showRedOutline = (this.inputValue.length > 0 && count?.resultCount === 0);
|
|
323
|
-
this._matchesCount.classList.toggle('no-results', showRedOutline);
|
|
324
|
-
let label = '';
|
|
325
|
-
if (count?.resultCount) {
|
|
326
|
-
let matchesCount = String(count.resultCount);
|
|
327
|
-
if (count.resultCount >= this._matchesLimit) {
|
|
328
|
-
matchesCount += '+';
|
|
329
|
-
}
|
|
330
|
-
let matchesPosition = String(count.resultIndex + 1);
|
|
331
|
-
if (matchesPosition === '0') {
|
|
332
|
-
matchesPosition = '?';
|
|
333
|
-
}
|
|
334
|
-
label = strings.format(NLS_MATCHES_LOCATION, matchesPosition, matchesCount);
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
label = NLS_NO_RESULTS;
|
|
338
|
-
}
|
|
339
|
-
status(this._announceSearchResults(label, this.inputValue));
|
|
340
|
-
this._matchesCount.appendChild(document.createTextNode(label));
|
|
341
|
-
this._foundMatch = !!count && count.resultCount > 0;
|
|
342
|
-
this.updateButtons(this._foundMatch);
|
|
343
|
-
}
|
|
344
|
-
changeState(state) {
|
|
345
|
-
this.state.change(state, false);
|
|
346
|
-
}
|
|
347
|
-
_announceSearchResults(label, searchString) {
|
|
348
|
-
if (!searchString) {
|
|
349
|
-
return ( nls.localizeWithPath(
|
|
350
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
351
|
-
'ariaSearchNoInput',
|
|
352
|
-
"Enter search input"
|
|
353
|
-
));
|
|
354
|
-
}
|
|
355
|
-
if (label === NLS_NO_RESULTS) {
|
|
356
|
-
return searchString === ''
|
|
357
|
-
? ( nls.localizeWithPath(
|
|
358
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
359
|
-
'ariaSearchNoResultEmpty',
|
|
360
|
-
"{0} found",
|
|
361
|
-
label
|
|
362
|
-
))
|
|
363
|
-
: ( nls.localizeWithPath(
|
|
364
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
365
|
-
'ariaSearchNoResult',
|
|
366
|
-
"{0} found for '{1}'",
|
|
367
|
-
label,
|
|
368
|
-
searchString
|
|
369
|
-
));
|
|
370
|
-
}
|
|
371
|
-
return ( nls.localizeWithPath(
|
|
372
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
373
|
-
'ariaSearchNoResultWithLineNumNoCurrentMatch',
|
|
374
|
-
"{0} found for '{1}'",
|
|
375
|
-
label,
|
|
376
|
-
searchString
|
|
377
|
-
));
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
const simpleFindWidgetSashBorder = registerColor('simpleFindWidget.sashBorder', { dark: '#454545', light: '#C8C8C8', hcDark: '#6FC3DF', hcLight: '#0F4A85' }, ( nls.localizeWithPath(
|
|
381
|
-
'vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget',
|
|
382
|
-
'simpleFindWidget.sashBorder',
|
|
383
|
-
'Border color of the sash border.'
|
|
384
|
-
)));
|
|
385
|
-
registerThemingParticipant((theme, collector) => {
|
|
386
|
-
const resizeBorderBackground = theme.getColor(simpleFindWidgetSashBorder);
|
|
387
|
-
collector.addRule(`.monaco-workbench .simple-find-part .monaco-sash { background-color: ${resizeBorderBackground}; border-color: ${resizeBorderBackground} }`);
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
export { SimpleFindWidget, simpleFindWidgetSashBorder };
|
package/vscode/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
-
import { getCodeEditor } from 'monaco-editor/esm/vs/editor/browser/editorBrowser.js';
|
|
4
|
-
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
6
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
7
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
8
|
-
import { IStatusbarService } from 'vscode/vscode/vs/workbench/services/statusbar/browser/statusbar';
|
|
9
|
-
import { ILanguageDetectionService, LanguageDetectionLanguageEventSource } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService';
|
|
10
|
-
import { ThrottledDelayer } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
11
|
-
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
12
|
-
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
13
|
-
import { registerAction2, Action2 } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
14
|
-
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
15
|
-
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
16
|
-
import { NOTEBOOK_EDITOR_EDITABLE } from '../../notebook/common/notebookContextKeys.js';
|
|
17
|
-
import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
|
|
18
|
-
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
19
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
20
|
-
|
|
21
|
-
var LanguageDetectionStatusContribution_1;
|
|
22
|
-
const detectLanguageCommandId = 'editor.detectLanguage';
|
|
23
|
-
let LanguageDetectionStatusContribution = class LanguageDetectionStatusContribution {
|
|
24
|
-
static { LanguageDetectionStatusContribution_1 = this; }
|
|
25
|
-
static { this._id = 'status.languageDetectionStatus'; }
|
|
26
|
-
constructor(_languageDetectionService, _statusBarService, _configurationService, _editorService, _languageService, _keybindingService) {
|
|
27
|
-
this._languageDetectionService = _languageDetectionService;
|
|
28
|
-
this._statusBarService = _statusBarService;
|
|
29
|
-
this._configurationService = _configurationService;
|
|
30
|
-
this._editorService = _editorService;
|
|
31
|
-
this._languageService = _languageService;
|
|
32
|
-
this._keybindingService = _keybindingService;
|
|
33
|
-
this._disposables = ( new DisposableStore());
|
|
34
|
-
this._delayer = ( new ThrottledDelayer(1000));
|
|
35
|
-
this._renderDisposables = ( new DisposableStore());
|
|
36
|
-
_editorService.onDidActiveEditorChange(() => this._update(true), this, this._disposables);
|
|
37
|
-
this._update(false);
|
|
38
|
-
}
|
|
39
|
-
dispose() {
|
|
40
|
-
this._disposables.dispose();
|
|
41
|
-
this._delayer.dispose();
|
|
42
|
-
this._combinedEntry?.dispose();
|
|
43
|
-
this._renderDisposables.dispose();
|
|
44
|
-
}
|
|
45
|
-
_update(clear) {
|
|
46
|
-
if (clear) {
|
|
47
|
-
this._combinedEntry?.dispose();
|
|
48
|
-
this._combinedEntry = undefined;
|
|
49
|
-
}
|
|
50
|
-
this._delayer.trigger(() => this._doUpdate());
|
|
51
|
-
}
|
|
52
|
-
async _doUpdate() {
|
|
53
|
-
const editor = getCodeEditor(this._editorService.activeTextEditorControl);
|
|
54
|
-
this._renderDisposables.clear();
|
|
55
|
-
editor?.onDidChangeModelLanguage(() => this._update(true), this, this._renderDisposables);
|
|
56
|
-
editor?.onDidChangeModelContent(() => this._update(false), this, this._renderDisposables);
|
|
57
|
-
const editorModel = editor?.getModel();
|
|
58
|
-
const editorUri = editorModel?.uri;
|
|
59
|
-
const existingId = editorModel?.getLanguageId();
|
|
60
|
-
const enablementConfig = this._configurationService.getValue('workbench.editor.languageDetectionHints');
|
|
61
|
-
const enabled = typeof enablementConfig === 'object' && enablementConfig?.untitledEditors;
|
|
62
|
-
const disableLightbulb = !enabled || editorUri?.scheme !== Schemas.untitled || !existingId;
|
|
63
|
-
if (disableLightbulb || !editorUri) {
|
|
64
|
-
this._combinedEntry?.dispose();
|
|
65
|
-
this._combinedEntry = undefined;
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
const lang = await this._languageDetectionService.detectLanguage(editorUri);
|
|
69
|
-
const skip = { 'jsonc': 'json' };
|
|
70
|
-
const existing = editorModel.getLanguageId();
|
|
71
|
-
if (lang && lang !== existing && skip[existing] !== lang) {
|
|
72
|
-
const detectedName = this._languageService.getLanguageName(lang) || lang;
|
|
73
|
-
let tooltip = ( localizeWithPath(
|
|
74
|
-
'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
|
|
75
|
-
'status.autoDetectLanguage',
|
|
76
|
-
"Accept Detected Language: {0}",
|
|
77
|
-
detectedName
|
|
78
|
-
));
|
|
79
|
-
const keybinding = this._keybindingService.lookupKeybinding(detectLanguageCommandId);
|
|
80
|
-
const label = keybinding?.getLabel();
|
|
81
|
-
if (label) {
|
|
82
|
-
tooltip += ` (${label})`;
|
|
83
|
-
}
|
|
84
|
-
const props = {
|
|
85
|
-
name: ( localizeWithPath(
|
|
86
|
-
'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
|
|
87
|
-
'langDetection.name',
|
|
88
|
-
"Language Detection"
|
|
89
|
-
)),
|
|
90
|
-
ariaLabel: ( localizeWithPath(
|
|
91
|
-
'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
|
|
92
|
-
'langDetection.aria',
|
|
93
|
-
"Change to Detected Language: {0}",
|
|
94
|
-
lang
|
|
95
|
-
)),
|
|
96
|
-
tooltip,
|
|
97
|
-
command: detectLanguageCommandId,
|
|
98
|
-
text: '$(lightbulb-autofix)',
|
|
99
|
-
};
|
|
100
|
-
if (!this._combinedEntry) {
|
|
101
|
-
this._combinedEntry = this._statusBarService.addEntry(props, LanguageDetectionStatusContribution_1._id, 1 , { id: 'status.editor.mode', alignment: 1 , compact: true });
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this._combinedEntry.update(props);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
this._combinedEntry?.dispose();
|
|
109
|
-
this._combinedEntry = undefined;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
LanguageDetectionStatusContribution = LanguageDetectionStatusContribution_1 = ( __decorate([
|
|
115
|
-
( __param(0, ILanguageDetectionService)),
|
|
116
|
-
( __param(1, IStatusbarService)),
|
|
117
|
-
( __param(2, IConfigurationService)),
|
|
118
|
-
( __param(3, IEditorService)),
|
|
119
|
-
( __param(4, ILanguageService)),
|
|
120
|
-
( __param(5, IKeybindingService))
|
|
121
|
-
], LanguageDetectionStatusContribution));
|
|
122
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(LanguageDetectionStatusContribution, 3 );
|
|
123
|
-
registerAction2(class extends Action2 {
|
|
124
|
-
constructor() {
|
|
125
|
-
super({
|
|
126
|
-
id: detectLanguageCommandId,
|
|
127
|
-
title: { value: ( localizeWithPath(
|
|
128
|
-
'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
|
|
129
|
-
'detectlang',
|
|
130
|
-
'Detect Language from Content'
|
|
131
|
-
)), original: 'Detect Language from Content' },
|
|
132
|
-
f1: true,
|
|
133
|
-
precondition: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.toNegated()), EditorContextKeys.editorTextFocus)),
|
|
134
|
-
keybinding: { primary: 34 | 512 | 1024 , weight: 200 }
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
async run(accessor) {
|
|
138
|
-
const editorService = accessor.get(IEditorService);
|
|
139
|
-
const languageDetectionService = accessor.get(ILanguageDetectionService);
|
|
140
|
-
const editor = getCodeEditor(editorService.activeTextEditorControl);
|
|
141
|
-
const notificationService = accessor.get(INotificationService);
|
|
142
|
-
const editorUri = editor?.getModel()?.uri;
|
|
143
|
-
if (editorUri) {
|
|
144
|
-
const lang = await languageDetectionService.detectLanguage(editorUri);
|
|
145
|
-
if (lang) {
|
|
146
|
-
editor.getModel()?.setLanguage(lang, LanguageDetectionLanguageEventSource);
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
notificationService.warn(( localizeWithPath(
|
|
150
|
-
'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution',
|
|
151
|
-
'noDetection',
|
|
152
|
-
"Unable to detect editor language"
|
|
153
|
-
)));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import n from '../../../../../../../../external/rollup-plugin-styles/dist/runtime/inject-css.js';
|
|
2
|
-
|
|
3
|
-
var css = ".ports-view .monaco-icon-label,.ports-view .monaco-list .monaco-list-row.focused .monaco-icon-label,.ports-view .monaco-list .monaco-list-row:hover:not(.highlighted) .monaco-icon-label{flex:1}.ports-view .monaco-list .monaco-list-row .actionBarContainer{flex:1 0 auto;flex:0 0 auto;text-align:right}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell{display:flex;flex:1;flex-wrap:nowrap;height:22px;overflow:hidden;text-overflow:ellipsis}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-inputbox{flex:1;height:22px;line-height:19px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-inputbox input{margin-top:-40px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-localaddress:hover{text-decoration:underline}.ports-view .monaco-table-td[data-col-index=\"0\"],.ports-view .monaco-table-th,.ports-view .monaco-table-th[data-col-index=\"0\"]{padding-left:10px}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .monaco-button{line-height:1.4em;margin-bottom:3px;margin-left:3px;margin-top:4px;padding:2px 14px;width:auto}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell>.ports-view-actionbar-cell-icon.codicon{margin-top:3px;padding-right:3px}.ports-view .monaco-list .monaco-list-row.selected .ports-view-actionbar-cell>.ports-view-actionbar-cell-icon.codicon{color:currentColor!important}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-resourceLabel .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .ports-view-actionbar-cell-resourceLabel:after{padding-right:0}.ports-view .monaco-list .monaco-list-row .ports-view-actionbar-cell .actions{display:none}.ports-view .monaco-list .monaco-list-row.focused .ports-view-actionbar-cell .actions,.ports-view .monaco-list .monaco-list-row.selected .ports-view-actionbar-cell .actions,.ports-view .monaco-list .monaco-list-row:hover .ports-view-actionbar-cell .actions{display:block}.ports-view .monaco-list .ports-view-actionbar-cell .actions .action-label{background-position:50% 50%;background-repeat:no-repeat;background-size:16px;height:100%;padding:2px;width:16px}.monaco-workbench .codicon.codicon-ports-forwarded-with-process-icon{color:var(--vscode-ports-iconRunningProcessForeground)}";
|
|
4
|
-
n(css,{});
|
|
5
|
-
|
|
6
|
-
export { css, css as default };
|