monaco-editor-core 0.55.0-dev-20251030 → 0.55.0-dev-20251101
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/esm/nls.keys.json +1 -1
- package/esm/nls.messages.cs.js +2 -2
- package/esm/nls.messages.de.js +2 -2
- package/esm/nls.messages.es.js +2 -2
- package/esm/nls.messages.fr.js +2 -2
- package/esm/nls.messages.it.js +2 -2
- package/esm/nls.messages.ja.js +2 -2
- package/esm/nls.messages.js +1 -1
- package/esm/nls.messages.json +1 -1
- package/esm/nls.messages.ko.js +2 -2
- package/esm/nls.messages.pl.js +2 -2
- package/esm/nls.messages.pt-br.js +2 -2
- package/esm/nls.messages.ru.js +2 -2
- package/esm/nls.messages.tr.js +2 -2
- package/esm/nls.messages.zh-cn.js +2 -2
- package/esm/nls.messages.zh-tw.js +2 -2
- package/esm/nls.metadata.json +15 -13
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.css +1 -5
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +4 -25
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
- package/esm/vs/editor/common/tokens/sparseMultilineTokens.js +4 -0
- package/esm/vs/editor/common/tokens/sparseMultilineTokens.js.map +1 -1
- package/esm/vs/editor/common/tokens/sparseTokensStore.js +7 -1
- package/esm/vs/editor/common/tokens/sparseTokensStore.js.map +1 -1
- package/esm/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.css +2 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsViews/inlineEditsLineReplacementView.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js +10 -7
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/utils/utils.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +74 -70
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js.map +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +2 -2
- package/esm/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/esm/vs/editor/contrib/rename/browser/renameWidget.js +7 -7
- package/esm/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- package/esm/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/esm/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/esm/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/esm/vs/editor/contrib/suggest/browser/suggestController.js +10 -10
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js +17 -17
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/esm/vs/editor/contrib/suggest/browser/wordContextKey.js +1 -1
- package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/esm/vs/editor/contrib/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- package/esm/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/esm/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/esm/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- package/esm/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +62 -62
- package/esm/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/esm/vs/platform/actionWidget/browser/actionList.js +4 -4
- package/esm/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/esm/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/esm/vs/platform/actions/browser/toolbar.js +2 -2
- package/esm/vs/platform/actions/common/actions.js +3 -1
- package/esm/vs/platform/actions/common/actions.js.map +1 -1
- package/esm/vs/platform/actions/common/menuService.js +2 -2
- package/esm/vs/platform/configuration/common/configurationRegistry.js +10 -10
- package/esm/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/esm/vs/platform/contextkey/common/contextkey.js +9 -9
- package/esm/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/esm/vs/platform/contextkey/common/scanner.js +5 -5
- package/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/esm/vs/platform/hover/browser/hoverService.js +9 -3
- package/esm/vs/platform/hover/browser/hoverService.js.map +1 -1
- package/esm/vs/platform/hover/browser/hoverWidget.js +1 -1
- package/esm/vs/platform/hover/browser/updatableHoverWidget.js +1 -1
- package/esm/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/esm/vs/platform/list/browser/listService.js +27 -27
- package/esm/vs/platform/markers/common/markerService.js +2 -2
- package/esm/vs/platform/markers/common/markers.js +6 -6
- package/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +7 -7
- package/esm/vs/platform/quickinput/browser/helpQuickAccess.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInput.js +10 -10
- package/esm/vs/platform/quickinput/browser/quickInputActions.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputActions.js.map +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/esm/vs/platform/quickinput/browser/quickInputList.js +1 -1
- package/esm/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/esm/vs/platform/quickinput/browser/tree/quickInputTreeAccessibilityProvider.js +1 -1
- package/esm/vs/platform/theme/common/colorUtils.js +2 -2
- package/esm/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/esm/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/esm/vs/platform/theme/common/colors/editorColors.js +95 -95
- package/esm/vs/platform/theme/common/colors/inputColors.js +47 -47
- package/esm/vs/platform/theme/common/colors/listColors.js +36 -36
- package/esm/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/esm/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/esm/vs/platform/theme/common/colors/miscColors.js +16 -16
- package/esm/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/esm/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/esm/vs/platform/theme/common/iconRegistry.js +6 -6
- package/esm/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/esm/vs/platform/workspace/common/workspace.js +1 -1
- package/package.json +2 -2
|
@@ -12,9 +12,20 @@ import { getCodeEditor } from '../../../browser/editorBrowser.js';
|
|
|
12
12
|
import { AbstractEditorNavigationQuickAccessProvider } from './editorNavigationQuickAccess.js';
|
|
13
13
|
export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {
|
|
14
14
|
static { this.PREFIX = ':'; }
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(useZeroBasedOffsetSetting) {
|
|
16
16
|
super({ canAcceptInBackground: true });
|
|
17
|
-
this.
|
|
17
|
+
this.useZeroBasedOffsetSetting = useZeroBasedOffsetSetting;
|
|
18
|
+
this._useZeroBasedOffset = useZeroBasedOffsetSetting?.value === true;
|
|
19
|
+
}
|
|
20
|
+
get useZeroBasedOffset() {
|
|
21
|
+
return this._useZeroBasedOffset;
|
|
22
|
+
}
|
|
23
|
+
set useZeroBasedOffset(value) {
|
|
24
|
+
this._useZeroBasedOffset = value;
|
|
25
|
+
if (this.useZeroBasedOffsetSetting) {
|
|
26
|
+
// Asynchronously persist the setting change
|
|
27
|
+
this.useZeroBasedOffsetSetting.value = value;
|
|
28
|
+
}
|
|
18
29
|
}
|
|
19
30
|
provideWithoutTextEditor(picker) {
|
|
20
31
|
const label = localize(1334, "Open a text editor first to go to a line.");
|
|
@@ -29,7 +40,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
29
40
|
disposables.add(picker.onDidAccept(event => {
|
|
30
41
|
const [item] = picker.selectedItems;
|
|
31
42
|
if (item) {
|
|
32
|
-
if (!
|
|
43
|
+
if (!item.lineNumber) {
|
|
33
44
|
return;
|
|
34
45
|
}
|
|
35
46
|
this.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });
|
|
@@ -41,44 +52,39 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
41
52
|
// React to picker changes
|
|
42
53
|
const updatePickerAndEditor = () => {
|
|
43
54
|
const inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.PREFIX.length);
|
|
44
|
-
const inOffsetMode =
|
|
45
|
-
const position = this.parsePosition(editor, inputText);
|
|
46
|
-
const label = this.getPickLabel(editor, position.lineNumber, position.column, inOffsetMode);
|
|
55
|
+
const { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor, inputText);
|
|
47
56
|
// Show toggle only when input text starts with '::'.
|
|
48
|
-
toggle.visible = inOffsetMode;
|
|
57
|
+
toggle.visible = !!inOffsetMode;
|
|
49
58
|
// Picker
|
|
50
59
|
picker.items = [{
|
|
51
|
-
lineNumber
|
|
52
|
-
column
|
|
60
|
+
lineNumber,
|
|
61
|
+
column,
|
|
53
62
|
label,
|
|
54
|
-
detail: inputText.length ?
|
|
55
|
-
undefined : // Don't show hint once the user has started typing.
|
|
56
|
-
localize(1335, "Use :line[:column] or ::offset to go to a position. Negative values are counted from the end.")
|
|
57
63
|
}];
|
|
58
64
|
// ARIA Label
|
|
59
65
|
picker.ariaLabel = label;
|
|
60
66
|
// Clear decorations for invalid range
|
|
61
|
-
if (!
|
|
67
|
+
if (!lineNumber) {
|
|
62
68
|
this.clearDecorations(editor);
|
|
63
69
|
return;
|
|
64
70
|
}
|
|
65
71
|
// Reveal
|
|
66
|
-
const range = this.toRange(
|
|
72
|
+
const range = this.toRange(lineNumber, column);
|
|
67
73
|
editor.revealRangeInCenter(range, 0 /* ScrollType.Smooth */);
|
|
68
74
|
// Decorate
|
|
69
75
|
this.addDecorations(editor, range);
|
|
70
76
|
};
|
|
71
77
|
// Add a toggle to switch between 1- and 0-based offsets.
|
|
72
78
|
const toggle = new Toggle({
|
|
73
|
-
title: localize(
|
|
79
|
+
title: localize(1335, "Use Zero-Based Offset"),
|
|
74
80
|
icon: Codicon.indexZero,
|
|
75
|
-
isChecked: this.useZeroBasedOffset
|
|
81
|
+
isChecked: this.useZeroBasedOffset,
|
|
76
82
|
inputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),
|
|
77
83
|
inputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),
|
|
78
84
|
inputActiveOptionBackground: asCssVariable(inputActiveOptionBackground)
|
|
79
85
|
});
|
|
80
86
|
disposables.add(toggle.onChange(() => {
|
|
81
|
-
this.useZeroBasedOffset
|
|
87
|
+
this.useZeroBasedOffset = !this.useZeroBasedOffset;
|
|
82
88
|
updatePickerAndEditor();
|
|
83
89
|
}));
|
|
84
90
|
picker.toggles = [toggle];
|
|
@@ -106,75 +112,73 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
106
112
|
}
|
|
107
113
|
parsePosition(editor, value) {
|
|
108
114
|
const model = this.getModel(editor);
|
|
115
|
+
if (!model) {
|
|
116
|
+
return {
|
|
117
|
+
label: localize(1336, "Open a text editor first to go to a line.")
|
|
118
|
+
};
|
|
119
|
+
}
|
|
109
120
|
// Support ::<offset> notation to navigate to a specific offset in the model.
|
|
110
121
|
if (value.startsWith(':')) {
|
|
111
122
|
let offset = parseInt(value.substring(1), 10);
|
|
112
|
-
|
|
123
|
+
const maxOffset = model.getValueLength();
|
|
124
|
+
if (isNaN(offset)) {
|
|
125
|
+
// No valid offset specified.
|
|
126
|
+
return {
|
|
127
|
+
inOffsetMode: true,
|
|
128
|
+
label: localize(1337, "Type a character number in the file from 1 to {0} to go to.", maxOffset)
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
113
132
|
const reverse = offset < 0;
|
|
114
|
-
if (!this.useZeroBasedOffset
|
|
133
|
+
if (!this.useZeroBasedOffset) {
|
|
115
134
|
// Convert 1-based offset to model's 0-based.
|
|
116
135
|
offset -= Math.sign(offset);
|
|
117
136
|
}
|
|
118
137
|
if (reverse) {
|
|
119
138
|
// Offset from the end of the buffer
|
|
120
|
-
offset +=
|
|
139
|
+
offset += maxOffset;
|
|
121
140
|
}
|
|
122
|
-
|
|
141
|
+
const pos = model.getPositionAt(offset);
|
|
142
|
+
return {
|
|
143
|
+
...pos,
|
|
144
|
+
inOffsetMode: true,
|
|
145
|
+
label: localize(1338, "Press Enter to go to line {0} and column {1}.", pos.lineNumber, pos.column)
|
|
146
|
+
};
|
|
123
147
|
}
|
|
124
148
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
149
|
+
else {
|
|
150
|
+
// Support line-col formats of `line,col`, `line:col`, `line#col`
|
|
151
|
+
const parts = value.split(/,|:|#/);
|
|
152
|
+
const maxLine = model.getLineCount();
|
|
153
|
+
let lineNumber = parseInt(parts[0]?.trim(), 10);
|
|
154
|
+
if (parts.length < 1 || isNaN(lineNumber)) {
|
|
155
|
+
return {
|
|
156
|
+
label: localize(1339, "Type a line number from 1 to {0} to go to.", maxLine)
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// Handle negative line numbers and clip to valid range.
|
|
160
|
+
lineNumber = lineNumber >= 0 ? lineNumber : (maxLine + 1) + lineNumber;
|
|
161
|
+
lineNumber = Math.min(Math.max(1, lineNumber), maxLine);
|
|
133
162
|
const maxColumn = model.getLineMaxColumn(lineNumber);
|
|
163
|
+
let column = parseInt(parts[1]?.trim(), 10);
|
|
164
|
+
if (parts.length < 2 || isNaN(column)) {
|
|
165
|
+
return {
|
|
166
|
+
lineNumber,
|
|
167
|
+
column: 1,
|
|
168
|
+
label: parts.length < 2 ?
|
|
169
|
+
localize(1340, "Press Enter to go to line {0}. Type : to enter column number.", lineNumber) :
|
|
170
|
+
localize(1341, "Press Enter to go to line {0} or enter column number from 1 to {1}.", lineNumber, maxColumn)
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
// Handle negative column numbers and clip to valid range.
|
|
134
174
|
column = column >= 0 ? column : maxColumn + column;
|
|
135
175
|
column = Math.min(Math.max(1, column), maxColumn);
|
|
176
|
+
return {
|
|
177
|
+
lineNumber,
|
|
178
|
+
column,
|
|
179
|
+
label: localize(1342, "Press Enter to go to line {0} and column {1}.", lineNumber, column)
|
|
180
|
+
};
|
|
136
181
|
}
|
|
137
|
-
return { lineNumber, column };
|
|
138
|
-
}
|
|
139
|
-
getPickLabel(editor, lineNumber, column, inOffsetMode) {
|
|
140
|
-
// Location valid: indicate this as picker label
|
|
141
|
-
if (this.isValidLineNumber(editor, lineNumber)) {
|
|
142
|
-
if (this.isValidColumn(editor, lineNumber, column)) {
|
|
143
|
-
return localize(1337, "Go to line {0} and character {1}.", lineNumber, column);
|
|
144
|
-
}
|
|
145
|
-
return localize(1338, "Go to line {0}.", lineNumber);
|
|
146
|
-
}
|
|
147
|
-
// Location invalid: show generic label
|
|
148
|
-
const position = editor.getPosition() || { lineNumber: 1, column: 1 };
|
|
149
|
-
// When in offset mode, prompt for an offset.
|
|
150
|
-
if (inOffsetMode) {
|
|
151
|
-
return localize(1339, "Current Line: {0}, Character: {1}. Type a character offset to navigate to.", position.lineNumber, position.column);
|
|
152
|
-
}
|
|
153
|
-
const lineCount = this.lineCount(editor);
|
|
154
|
-
if (lineCount > 1) {
|
|
155
|
-
return localize(1340, "Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.", position.lineNumber, position.column, lineCount);
|
|
156
|
-
}
|
|
157
|
-
return localize(1341, "Current Line: {0}, Character: {1}. Type a line number to navigate to.", position.lineNumber, position.column);
|
|
158
|
-
}
|
|
159
|
-
isValidLineNumber(editor, lineNumber) {
|
|
160
|
-
if (!lineNumber || typeof lineNumber !== 'number') {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
return lineNumber > 0 && lineNumber <= this.lineCount(editor);
|
|
164
|
-
}
|
|
165
|
-
isValidColumn(editor, lineNumber, column) {
|
|
166
|
-
if (!column || typeof column !== 'number') {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
const model = this.getModel(editor);
|
|
170
|
-
if (!model) {
|
|
171
|
-
return false;
|
|
172
|
-
}
|
|
173
|
-
const positionCandidate = { lineNumber, column };
|
|
174
|
-
return model.validatePosition(positionCandidate).equals(positionCandidate);
|
|
175
|
-
}
|
|
176
|
-
lineCount(editor) {
|
|
177
|
-
return this.getModel(editor)?.getLineCount() ?? 0;
|
|
178
182
|
}
|
|
179
183
|
}
|
|
180
184
|
//# sourceMappingURL=gotoLineQuickAccess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CA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QACpF,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC3C,OAAO,KAAK,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,OAAO,KAAK,CAAC;QACd,CAAC;QAED,MAAM,iBAAiB,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;QAEjD,OAAO,KAAK,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC5E,CAAC;IAEO,SAAS,CAAC,MAAe;QAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC","file":"gotoLineQuickAccess.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Toggle } from '../../../../base/browser/ui/toggle/toggle.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colors/inputColors.js';\nimport { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';\nimport { getCodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js';\nimport { IPosition } from '../../../common/core/position.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js';\n\ninterface IGotoLineQuickPickItem extends IQuickPickItem, Partial<IPosition> { }\n\nexport abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic PREFIX = ':';\n\n\tconstructor(private useZeroBasedOffset: { value: boolean } = { value: false }) {\n\t\tsuper({ canAcceptInBackground: true });\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>): IDisposable {\n\t\tconst label = localize('cannotRunGotoLine', \"Open a text editor first to go to a line.\");\n\n\t\tpicker.items = [{ label }];\n\t\tpicker.ariaLabel = label;\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto line once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tif (!this.isValidLineNumber(editor, item.lineNumber)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// React to picker changes\n\t\tconst updatePickerAndEditor = () => {\n\t\t\tconst inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.PREFIX.length);\n\t\t\tconst inOffsetMode = inputText.startsWith(':');\n\t\t\tconst position = this.parsePosition(editor, inputText);\n\t\t\tconst label = this.getPickLabel(editor, position.lineNumber, position.column, inOffsetMode);\n\n\t\t\t// Show toggle only when input text starts with '::'.\n\t\t\ttoggle.visible = inOffsetMode;\n\n\t\t\t// Picker\n\t\t\tpicker.items = [{\n\t\t\t\tlineNumber: position.lineNumber,\n\t\t\t\tcolumn: position.column,\n\t\t\t\tlabel,\n\t\t\t\tdetail: inputText.length ?\n\t\t\t\t\tundefined : // Don't show hint once the user has started typing.\n\t\t\t\t\tlocalize('gotoLineQuickAccessDescription', \"Use :line[:column] or ::offset to go to a position. Negative values are counted from the end.\")\n\t\t\t}];\n\n\t\t\t// ARIA Label\n\t\t\tpicker.ariaLabel = label;\n\n\t\t\t// Clear decorations for invalid range\n\t\t\tif (!this.isValidLineNumber(editor, position.lineNumber)) {\n\t\t\t\tthis.clearDecorations(editor);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reveal\n\t\t\tconst range = this.toRange(position.lineNumber, position.column);\n\t\t\teditor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t\t// Decorate\n\t\t\tthis.addDecorations(editor, range);\n\t\t};\n\n\t\t// Add a toggle to switch between 1- and 0-based offsets.\n\t\tconst toggle = new Toggle({\n\t\t\ttitle: localize('gotoLineToggle', \"Use zero-based offset\"),\n\t\t\ticon: Codicon.indexZero,\n\t\t\tisChecked: this.useZeroBasedOffset.value,\n\t\t\tinputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),\n\t\t\tinputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),\n\t\t\tinputActiveOptionBackground: asCssVariable(inputActiveOptionBackground)\n\t\t});\n\n\t\tdisposables.add(\n\t\t\ttoggle.onChange(() => {\n\t\t\t\tthis.useZeroBasedOffset.value = !this.useZeroBasedOffset.value;\n\t\t\t\tupdatePickerAndEditor();\n\t\t\t}));\n\n\t\tpicker.toggles = [toggle];\n\n\t\tupdatePickerAndEditor();\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerAndEditor()));\n\n\t\t// Adjust line number visibility as needed\n\t\tconst codeEditor = getCodeEditor(editor);\n\t\tif (codeEditor) {\n\t\t\tconst options = codeEditor.getOptions();\n\t\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\t\tif (lineNumbers.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tcodeEditor.updateOptions({ lineNumbers: 'on' });\n\n\t\t\t\tdisposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: 'relative' })));\n\t\t\t}\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate toRange(lineNumber = 1, column = 1): IRange {\n\t\treturn {\n\t\t\tstartLineNumber: lineNumber,\n\t\t\tstartColumn: column,\n\t\t\tendLineNumber: lineNumber,\n\t\t\tendColumn: column\n\t\t};\n\t}\n\n\tprotected parsePosition(editor: IEditor, value: string): IPosition {\n\t\tconst model = this.getModel(editor);\n\n\t\t// Support ::<offset> notation to navigate to a specific offset in the model.\n\t\tif (value.startsWith(':')) {\n\t\t\tlet offset = parseInt(value.substring(1), 10);\n\t\t\tif (!isNaN(offset) && model) {\n\t\t\t\tconst reverse = offset < 0;\n\t\t\t\tif (!this.useZeroBasedOffset.value) {\n\t\t\t\t\t// Convert 1-based offset to model's 0-based.\n\t\t\t\t\toffset -= Math.sign(offset);\n\t\t\t\t}\n\t\t\t\tif (reverse) {\n\t\t\t\t\t// Offset from the end of the buffer\n\t\t\t\t\toffset += model.getValueLength();\n\t\t\t\t}\n\t\t\t\treturn model.getPositionAt(offset);\n\t\t\t}\n\t\t}\n\n\t\t// Support line-col formats of `line,col`, `line:col`, `line#col`\n\t\tlet [lineNumber, column] = value.split(/,|:|#/).map(part => parseInt(part, 10)).filter(part => !isNaN(part));\n\n\t\t// Handle negative line numbers and clip to valid range.\n\t\tconst maxLine = (model?.getLineCount() ?? 0) + 1;\n\t\tlineNumber = lineNumber >= 0 ? lineNumber : maxLine + lineNumber;\n\t\tlineNumber = Math.min(Math.max(1, lineNumber), maxLine);\n\n\t\t// Handle negative column numbers and clip to valid range.\n\t\tif (column !== undefined && model) {\n\t\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tcolumn = column >= 0 ? column : maxColumn + column;\n\t\t\tcolumn = Math.min(Math.max(1, column), maxColumn);\n\t\t}\n\n\t\treturn { lineNumber, column };\n\t}\n\n\tprivate getPickLabel(editor: IEditor, lineNumber: number, column: number | undefined, inOffsetMode: boolean): string {\n\n\t\t// Location valid: indicate this as picker label\n\t\tif (this.isValidLineNumber(editor, lineNumber)) {\n\t\t\tif (this.isValidColumn(editor, lineNumber, column)) {\n\t\t\t\treturn localize('gotoLineColumnLabel', \"Go to line {0} and character {1}.\", lineNumber, column);\n\t\t\t}\n\n\t\t\treturn localize('gotoLineLabel', \"Go to line {0}.\", lineNumber);\n\t\t}\n\n\t\t// Location invalid: show generic label\n\t\tconst position = editor.getPosition() || { lineNumber: 1, column: 1 };\n\n\t\t// When in offset mode, prompt for an offset.\n\t\tif (inOffsetMode) {\n\t\t\treturn localize('gotoLineOffsetLabel', \"Current Line: {0}, Character: {1}. Type a character offset to navigate to.\", position.lineNumber, position.column);\n\t\t}\n\n\t\tconst lineCount = this.lineCount(editor);\n\t\tif (lineCount > 1) {\n\t\t\treturn localize('gotoLineLabelEmptyWithLimit', \"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.\", position.lineNumber, position.column, lineCount);\n\t\t}\n\n\t\treturn localize('gotoLineLabelEmpty', \"Current Line: {0}, Character: {1}. Type a line number to navigate to.\", position.lineNumber, position.column);\n\t}\n\n\tprivate isValidLineNumber(editor: IEditor, lineNumber: number | undefined): boolean {\n\t\tif (!lineNumber || typeof lineNumber !== 'number') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn lineNumber > 0 && lineNumber <= this.lineCount(editor);\n\t}\n\n\tprivate isValidColumn(editor: IEditor, lineNumber: number, column: number | undefined): boolean {\n\t\tif (!column || typeof column !== 'number') {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst positionCandidate = { lineNumber, column };\n\n\t\treturn model.validatePosition(positionCandidate).equals(positionCandidate);\n\t}\n\n\tprivate lineCount(editor: IEditor): number {\n\t\treturn this.getModel(editor)?.getLineCount() ?? 0;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,MAAM,EAAE,MAAM,8CAA8C,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAe,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAC5J,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,OAAO,EAAE,2CAA2C,EAAiC,MAAM,kCAAkC,CAAC;AAI9H,MAAM,OAAgB,mCAAoC,SAAQ,2CAA2C;aAErG,WAAM,GAAG,GAAG,CAAC;IAIpB,YAAoB,yBAA8C;QACjE,KAAK,CAAC,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;QADpB,8BAAyB,GAAzB,yBAAyB,CAAqB;QAEjE,IAAI,CAAC,mBAAmB,GAAG,yBAAyB,EAAE,KAAK,KAAK,IAAI,CAAC;IACtE,CAAC;IAED,IAAY,kBAAkB;QAC7B,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACjC,CAAC;IAED,IAAY,kBAAkB,CAAC,KAAc;QAC5C,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACjC,IAAI,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACpC,4CAA4C;YAC5C,IAAI,CAAC,yBAAyB,C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,QAAQ,CAAC,IAAuB,EAAE,+CAA+C,EAAE,UAAU,EAAE,MAAM,CAAC;aAC7G,CAAC;QACH,CAAC;IACF,CAAC","file":"gotoLineQuickAccess.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { Toggle } from '../../../../base/browser/ui/toggle/toggle.js';\nimport { CancellationToken } from '../../../../base/common/cancellation.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';\nimport { localize } from '../../../../nls.js';\nimport { IQuickPick, IQuickPickItem } from '../../../../platform/quickinput/common/quickInput.js';\nimport { inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from '../../../../platform/theme/common/colors/inputColors.js';\nimport { asCssVariable } from '../../../../platform/theme/common/colorUtils.js';\nimport { getCodeEditor } from '../../../browser/editorBrowser.js';\nimport { EditorOption, RenderLineNumbersType } from '../../../common/config/editorOptions.js';\nimport { IPosition } from '../../../common/core/position.js';\nimport { IRange } from '../../../common/core/range.js';\nimport { IEditor, ScrollType } from '../../../common/editorCommon.js';\nimport { AbstractEditorNavigationQuickAccessProvider, IQuickAccessTextEditorContext } from './editorNavigationQuickAccess.js';\n\ninterface IGotoLineQuickPickItem extends IQuickPickItem, Partial<IPosition> { }\n\nexport abstract class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigationQuickAccessProvider {\n\n\tstatic PREFIX = ':';\n\n\tprivate _useZeroBasedOffset: boolean;\n\n\tconstructor(private useZeroBasedOffsetSetting?: { value: boolean }) {\n\t\tsuper({ canAcceptInBackground: true });\n\t\tthis._useZeroBasedOffset = useZeroBasedOffsetSetting?.value === true;\n\t}\n\n\tprivate get useZeroBasedOffset() {\n\t\treturn this._useZeroBasedOffset;\n\t}\n\n\tprivate set useZeroBasedOffset(value: boolean) {\n\t\tthis._useZeroBasedOffset = value;\n\t\tif (this.useZeroBasedOffsetSetting) {\n\t\t\t// Asynchronously persist the setting change\n\t\t\tthis.useZeroBasedOffsetSetting.value = value;\n\t\t}\n\t}\n\n\tprotected provideWithoutTextEditor(picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>): IDisposable {\n\t\tconst label = localize('cannotRunGotoLine', \"Open a text editor first to go to a line.\");\n\n\t\tpicker.items = [{ label }];\n\t\tpicker.ariaLabel = label;\n\n\t\treturn Disposable.None;\n\t}\n\n\tprotected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoLineQuickPickItem, { useSeparators: true }>, token: CancellationToken): IDisposable {\n\t\tconst editor = context.editor;\n\t\tconst disposables = new DisposableStore();\n\n\t\t// Goto line once picked\n\t\tdisposables.add(picker.onDidAccept(event => {\n\t\t\tconst [item] = picker.selectedItems;\n\t\t\tif (item) {\n\t\t\t\tif (!item.lineNumber) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.gotoLocation(context, { range: this.toRange(item.lineNumber, item.column), keyMods: picker.keyMods, preserveFocus: event.inBackground });\n\n\t\t\t\tif (!event.inBackground) {\n\t\t\t\t\tpicker.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}));\n\n\t\t// React to picker changes\n\t\tconst updatePickerAndEditor = () => {\n\t\t\tconst inputText = picker.value.trim().substring(AbstractGotoLineQuickAccessProvider.PREFIX.length);\n\t\t\tconst { inOffsetMode, lineNumber, column, label } = this.parsePosition(editor, inputText);\n\n\t\t\t// Show toggle only when input text starts with '::'.\n\t\t\ttoggle.visible = !!inOffsetMode;\n\n\t\t\t// Picker\n\t\t\tpicker.items = [{\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel,\n\t\t\t}];\n\n\t\t\t// ARIA Label\n\t\t\tpicker.ariaLabel = label;\n\n\t\t\t// Clear decorations for invalid range\n\t\t\tif (!lineNumber) {\n\t\t\t\tthis.clearDecorations(editor);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reveal\n\t\t\tconst range = this.toRange(lineNumber, column);\n\t\t\teditor.revealRangeInCenter(range, ScrollType.Smooth);\n\n\t\t\t// Decorate\n\t\t\tthis.addDecorations(editor, range);\n\t\t};\n\n\t\t// Add a toggle to switch between 1- and 0-based offsets.\n\t\tconst toggle = new Toggle({\n\t\t\ttitle: localize('gotoLineToggle', \"Use Zero-Based Offset\"),\n\t\t\ticon: Codicon.indexZero,\n\t\t\tisChecked: this.useZeroBasedOffset,\n\t\t\tinputActiveOptionBorder: asCssVariable(inputActiveOptionBorder),\n\t\t\tinputActiveOptionForeground: asCssVariable(inputActiveOptionForeground),\n\t\t\tinputActiveOptionBackground: asCssVariable(inputActiveOptionBackground)\n\t\t});\n\n\t\tdisposables.add(\n\t\t\ttoggle.onChange(() => {\n\t\t\t\tthis.useZeroBasedOffset = !this.useZeroBasedOffset;\n\t\t\t\tupdatePickerAndEditor();\n\t\t\t}));\n\n\t\tpicker.toggles = [toggle];\n\n\t\tupdatePickerAndEditor();\n\t\tdisposables.add(picker.onDidChangeValue(() => updatePickerAndEditor()));\n\n\t\t// Adjust line number visibility as needed\n\t\tconst codeEditor = getCodeEditor(editor);\n\t\tif (codeEditor) {\n\t\t\tconst options = codeEditor.getOptions();\n\t\t\tconst lineNumbers = options.get(EditorOption.lineNumbers);\n\t\t\tif (lineNumbers.renderType === RenderLineNumbersType.Relative) {\n\t\t\t\tcodeEditor.updateOptions({ lineNumbers: 'on' });\n\n\t\t\t\tdisposables.add(toDisposable(() => codeEditor.updateOptions({ lineNumbers: 'relative' })));\n\t\t\t}\n\t\t}\n\n\t\treturn disposables;\n\t}\n\n\tprivate toRange(lineNumber = 1, column = 1): IRange {\n\t\treturn {\n\t\t\tstartLineNumber: lineNumber,\n\t\t\tstartColumn: column,\n\t\t\tendLineNumber: lineNumber,\n\t\t\tendColumn: column\n\t\t};\n\t}\n\n\tprotected parsePosition(editor: IEditor, value: string): Partial<IPosition> & { inOffsetMode?: boolean; label: string } {\n\t\tconst model = this.getModel(editor);\n\t\tif (!model) {\n\t\t\treturn {\n\t\t\t\tlabel: localize('gotoLine.noEditor', \"Open a text editor first to go to a line.\")\n\t\t\t};\n\t\t}\n\n\t\t// Support ::<offset> notation to navigate to a specific offset in the model.\n\t\tif (value.startsWith(':')) {\n\t\t\tlet offset = parseInt(value.substring(1), 10);\n\t\t\tconst maxOffset = model.getValueLength();\n\t\t\tif (isNaN(offset)) {\n\t\t\t\t// No valid offset specified.\n\t\t\t\treturn {\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: localize('gotoLine.offsetPrompt', \"Type a character number in the file from 1 to {0} to go to.\", maxOffset)\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconst reverse = offset < 0;\n\t\t\t\tif (!this.useZeroBasedOffset) {\n\t\t\t\t\t// Convert 1-based offset to model's 0-based.\n\t\t\t\t\toffset -= Math.sign(offset);\n\t\t\t\t}\n\t\t\t\tif (reverse) {\n\t\t\t\t\t// Offset from the end of the buffer\n\t\t\t\t\toffset += maxOffset;\n\t\t\t\t}\n\t\t\t\tconst pos = model.getPositionAt(offset);\n\t\t\t\treturn {\n\t\t\t\t\t...pos,\n\t\t\t\t\tinOffsetMode: true,\n\t\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press Enter to go to line {0} and column {1}.\", pos.lineNumber, pos.column)\n\t\t\t\t};\n\t\t\t}\n\t\t} else {\n\t\t\t// Support line-col formats of `line,col`, `line:col`, `line#col`\n\t\t\tconst parts = value.split(/,|:|#/);\n\n\t\t\tconst maxLine = model.getLineCount();\n\t\t\tlet lineNumber = parseInt(parts[0]?.trim(), 10);\n\t\t\tif (parts.length < 1 || isNaN(lineNumber)) {\n\t\t\t\treturn {\n\t\t\t\t\tlabel: localize('gotoLine.linePrompt', \"Type a line number from 1 to {0} to go to.\", maxLine)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative line numbers and clip to valid range.\n\t\t\tlineNumber = lineNumber >= 0 ? lineNumber : (maxLine + 1) + lineNumber;\n\t\t\tlineNumber = Math.min(Math.max(1, lineNumber), maxLine);\n\n\t\t\tconst maxColumn = model.getLineMaxColumn(lineNumber);\n\t\t\tlet column = parseInt(parts[1]?.trim(), 10);\n\t\t\tif (parts.length < 2 || isNaN(column)) {\n\t\t\t\treturn {\n\t\t\t\t\tlineNumber,\n\t\t\t\t\tcolumn: 1,\n\t\t\t\t\tlabel: parts.length < 2 ?\n\t\t\t\t\t\tlocalize('gotoLine.lineColumnPrompt', \"Press Enter to go to line {0}. Type : to enter column number.\", lineNumber) :\n\t\t\t\t\t\tlocalize('gotoLine.columnPrompt', \"Press Enter to go to line {0} or enter column number from 1 to {1}.\", lineNumber, maxColumn)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// Handle negative column numbers and clip to valid range.\n\t\t\tcolumn = column >= 0 ? column : maxColumn + column;\n\t\t\tcolumn = Math.min(Math.max(1, column), maxColumn);\n\n\t\t\treturn {\n\t\t\t\tlineNumber,\n\t\t\t\tcolumn,\n\t\t\t\tlabel: localize('gotoLine.goToPosition', \"Press Enter to go to line {0} and column {1}.\", lineNumber, column)\n\t\t\t};\n\t\t}\n\t}\n}\n"]}
|
|
@@ -39,7 +39,7 @@ let AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessP
|
|
|
39
39
|
this.options.canAcceptInBackground = true;
|
|
40
40
|
}
|
|
41
41
|
provideWithoutTextEditor(picker) {
|
|
42
|
-
this.provideLabelPick(picker, localize(
|
|
42
|
+
this.provideLabelPick(picker, localize(1343, "To go to a symbol, first open a text editor with symbol information."));
|
|
43
43
|
return Disposable.None;
|
|
44
44
|
}
|
|
45
45
|
provideWithTextEditor(context, picker, token, runOptions) {
|
|
@@ -60,7 +60,7 @@ let AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessP
|
|
|
60
60
|
doProvideWithoutEditorSymbols(context, model, picker, token) {
|
|
61
61
|
const disposables = new DisposableStore();
|
|
62
62
|
// Generic pick for not having any symbol information
|
|
63
|
-
this.provideLabelPick(picker, localize(
|
|
63
|
+
this.provideLabelPick(picker, localize(1344, "The active text editor does not provide symbol information."));
|
|
64
64
|
// Wait for changes to the registry and see if eventually
|
|
65
65
|
// we do get symbols. This can happen if the picker is opened
|
|
66
66
|
// very early after the model has loaded but before the
|
|
@@ -146,10 +146,10 @@ let AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessP
|
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
148
|
if (query.original.length > 0) {
|
|
149
|
-
this.provideLabelPick(picker, localize(
|
|
149
|
+
this.provideLabelPick(picker, localize(1345, "No matching editor symbols"));
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
this.provideLabelPick(picker, localize(
|
|
152
|
+
this.provideLabelPick(picker, localize(1346, "No editor symbols"));
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -196,7 +196,7 @@ let AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessP
|
|
|
196
196
|
if (openSideBySideDirection) {
|
|
197
197
|
buttons = [{
|
|
198
198
|
iconClass: openSideBySideDirection === 'right' ? ThemeIcon.asClassName(Codicon.splitHorizontal) : ThemeIcon.asClassName(Codicon.splitVertical),
|
|
199
|
-
tooltip: openSideBySideDirection === 'right' ? localize(
|
|
199
|
+
tooltip: openSideBySideDirection === 'right' ? localize(1347, "Open to the Side") : localize(1348, "Open to the Bottom")
|
|
200
200
|
}];
|
|
201
201
|
}
|
|
202
202
|
const filteredSymbolPicks = [];
|
|
@@ -312,7 +312,7 @@ let AbstractGotoSymbolQuickAccessProvider = class AbstractGotoSymbolQuickAccessP
|
|
|
312
312
|
}
|
|
313
313
|
else if (sortedFilteredSymbolPicks.length > 0) {
|
|
314
314
|
symbolPicks = [
|
|
315
|
-
{ label: localize(
|
|
315
|
+
{ label: localize(1349, "symbols ({0})", filteredSymbolPicks.length), type: 'separator' },
|
|
316
316
|
...sortedFilteredSymbolPicks
|
|
317
317
|
];
|
|
318
318
|
}
|
|
@@ -362,33 +362,33 @@ AbstractGotoSymbolQuickAccessProvider = AbstractGotoSymbolQuickAccessProvider_1
|
|
|
362
362
|
], AbstractGotoSymbolQuickAccessProvider);
|
|
363
363
|
export { AbstractGotoSymbolQuickAccessProvider };
|
|
364
364
|
// #region NLS Helpers
|
|
365
|
-
const FALLBACK_NLS_SYMBOL_KIND = localize(
|
|
365
|
+
const FALLBACK_NLS_SYMBOL_KIND = localize(1350, "properties ({0})");
|
|
366
366
|
const NLS_SYMBOL_KIND_CACHE = {
|
|
367
|
-
[5 /* SymbolKind.Method */]: localize(
|
|
368
|
-
[11 /* SymbolKind.Function */]: localize(
|
|
369
|
-
[8 /* SymbolKind.Constructor */]: localize(
|
|
370
|
-
[12 /* SymbolKind.Variable */]: localize(
|
|
371
|
-
[4 /* SymbolKind.Class */]: localize(
|
|
372
|
-
[22 /* SymbolKind.Struct */]: localize(
|
|
373
|
-
[23 /* SymbolKind.Event */]: localize(
|
|
374
|
-
[24 /* SymbolKind.Operator */]: localize(
|
|
375
|
-
[10 /* SymbolKind.Interface */]: localize(
|
|
376
|
-
[2 /* SymbolKind.Namespace */]: localize(
|
|
377
|
-
[3 /* SymbolKind.Package */]: localize(
|
|
378
|
-
[25 /* SymbolKind.TypeParameter */]: localize(
|
|
379
|
-
[1 /* SymbolKind.Module */]: localize(
|
|
380
|
-
[6 /* SymbolKind.Property */]: localize(
|
|
381
|
-
[9 /* SymbolKind.Enum */]: localize(
|
|
382
|
-
[21 /* SymbolKind.EnumMember */]: localize(
|
|
383
|
-
[14 /* SymbolKind.String */]: localize(
|
|
384
|
-
[0 /* SymbolKind.File */]: localize(
|
|
385
|
-
[17 /* SymbolKind.Array */]: localize(
|
|
386
|
-
[15 /* SymbolKind.Number */]: localize(
|
|
387
|
-
[16 /* SymbolKind.Boolean */]: localize(
|
|
388
|
-
[18 /* SymbolKind.Object */]: localize(
|
|
389
|
-
[19 /* SymbolKind.Key */]: localize(
|
|
390
|
-
[7 /* SymbolKind.Field */]: localize(
|
|
391
|
-
[13 /* SymbolKind.Constant */]: localize(
|
|
367
|
+
[5 /* SymbolKind.Method */]: localize(1351, "methods ({0})"),
|
|
368
|
+
[11 /* SymbolKind.Function */]: localize(1352, "functions ({0})"),
|
|
369
|
+
[8 /* SymbolKind.Constructor */]: localize(1353, "constructors ({0})"),
|
|
370
|
+
[12 /* SymbolKind.Variable */]: localize(1354, "variables ({0})"),
|
|
371
|
+
[4 /* SymbolKind.Class */]: localize(1355, "classes ({0})"),
|
|
372
|
+
[22 /* SymbolKind.Struct */]: localize(1356, "structs ({0})"),
|
|
373
|
+
[23 /* SymbolKind.Event */]: localize(1357, "events ({0})"),
|
|
374
|
+
[24 /* SymbolKind.Operator */]: localize(1358, "operators ({0})"),
|
|
375
|
+
[10 /* SymbolKind.Interface */]: localize(1359, "interfaces ({0})"),
|
|
376
|
+
[2 /* SymbolKind.Namespace */]: localize(1360, "namespaces ({0})"),
|
|
377
|
+
[3 /* SymbolKind.Package */]: localize(1361, "packages ({0})"),
|
|
378
|
+
[25 /* SymbolKind.TypeParameter */]: localize(1362, "type parameters ({0})"),
|
|
379
|
+
[1 /* SymbolKind.Module */]: localize(1363, "modules ({0})"),
|
|
380
|
+
[6 /* SymbolKind.Property */]: localize(1364, "properties ({0})"),
|
|
381
|
+
[9 /* SymbolKind.Enum */]: localize(1365, "enumerations ({0})"),
|
|
382
|
+
[21 /* SymbolKind.EnumMember */]: localize(1366, "enumeration members ({0})"),
|
|
383
|
+
[14 /* SymbolKind.String */]: localize(1367, "strings ({0})"),
|
|
384
|
+
[0 /* SymbolKind.File */]: localize(1368, "files ({0})"),
|
|
385
|
+
[17 /* SymbolKind.Array */]: localize(1369, "arrays ({0})"),
|
|
386
|
+
[15 /* SymbolKind.Number */]: localize(1370, "numbers ({0})"),
|
|
387
|
+
[16 /* SymbolKind.Boolean */]: localize(1371, "booleans ({0})"),
|
|
388
|
+
[18 /* SymbolKind.Object */]: localize(1372, "objects ({0})"),
|
|
389
|
+
[19 /* SymbolKind.Key */]: localize(1373, "keys ({0})"),
|
|
390
|
+
[7 /* SymbolKind.Field */]: localize(1374, "fields ({0})"),
|
|
391
|
+
[13 /* SymbolKind.Constant */]: localize(1375, "constants ({0})")
|
|
392
392
|
};
|
|
393
393
|
//#endregion
|
|
394
394
|
//# sourceMappingURL=gotoSymbolQuickAccess.js.map
|
|
@@ -20,10 +20,10 @@ export class ReadOnlyMessageController extends Disposable {
|
|
|
20
20
|
let message = this.editor.getOptions().get(105 /* EditorOption.readOnlyMessage */);
|
|
21
21
|
if (!message) {
|
|
22
22
|
if (this.editor.isSimpleWidget) {
|
|
23
|
-
message = new MarkdownString(nls.localize(
|
|
23
|
+
message = new MarkdownString(nls.localize(1376, "Cannot edit in read-only input"));
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
|
-
message = new MarkdownString(nls.localize(
|
|
26
|
+
message = new MarkdownString(nls.localize(1377, "Cannot edit in read-only editor"));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
messageController.showMessage(message, this.editor.getPosition());
|
|
@@ -99,7 +99,7 @@ class RenameSkeleton {
|
|
|
99
99
|
}
|
|
100
100
|
const result = await provider.provideRenameEdits(this.model, this.position, newName, token);
|
|
101
101
|
if (!result) {
|
|
102
|
-
return this._provideRenameEdits(newName, i + 1, rejects.concat(nls.localize(
|
|
102
|
+
return this._provideRenameEdits(newName, i + 1, rejects.concat(nls.localize(1378, "No result.")), token);
|
|
103
103
|
}
|
|
104
104
|
else if (result.rejectReason) {
|
|
105
105
|
return this._provideRenameEdits(newName, i + 1, rejects.concat(result.rejectReason), token);
|
|
@@ -172,7 +172,7 @@ let RenameController = class RenameController {
|
|
|
172
172
|
else {
|
|
173
173
|
trace('resolve rename location failed', e instanceof Error ? e : JSON.stringify(e, null, '\t'));
|
|
174
174
|
if (typeof e === 'string' || isMarkdownString(e)) {
|
|
175
|
-
MessageController.get(this.editor)?.showMessage(e || nls.localize(
|
|
175
|
+
MessageController.get(this.editor)?.showMessage(e || nls.localize(1379, "An unknown error occurred while resolving rename location"), position);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
return undefined;
|
|
@@ -240,24 +240,24 @@ let RenameController = class RenameController {
|
|
|
240
240
|
this._bulkEditService.apply(renameResult, {
|
|
241
241
|
editor: this.editor,
|
|
242
242
|
showPreview: inputFieldResult.wantsPreview,
|
|
243
|
-
label: nls.localize(
|
|
243
|
+
label: nls.localize(1380, "Renaming '{0}' to '{1}'", loc?.text, inputFieldResult.newName),
|
|
244
244
|
code: 'undoredo.rename',
|
|
245
|
-
quotableLabel: nls.localize(
|
|
245
|
+
quotableLabel: nls.localize(1381, "Renaming {0} to {1}", loc?.text, inputFieldResult.newName),
|
|
246
246
|
respectAutoSaveConfig: true,
|
|
247
247
|
reason: EditSources.rename(),
|
|
248
248
|
}).then(result => {
|
|
249
249
|
trace('edits applied');
|
|
250
250
|
if (result.ariaSummary) {
|
|
251
|
-
alert(nls.localize(
|
|
251
|
+
alert(nls.localize(1382, "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc.text, inputFieldResult.newName, result.ariaSummary));
|
|
252
252
|
}
|
|
253
253
|
}).catch(err => {
|
|
254
254
|
trace(`error when applying edits ${JSON.stringify(err, null, '\t')}`);
|
|
255
|
-
this._notificationService.error(nls.localize(
|
|
255
|
+
this._notificationService.error(nls.localize(1383, "Rename failed to apply edits"));
|
|
256
256
|
this._logService.error(err);
|
|
257
257
|
});
|
|
258
258
|
}, err => {
|
|
259
259
|
trace('error when providing rename edits', JSON.stringify(err, null, '\t'));
|
|
260
|
-
this._notificationService.error(nls.localize(
|
|
260
|
+
this._notificationService.error(nls.localize(1384, "Rename failed to compute edits"));
|
|
261
261
|
this._logService.error(err);
|
|
262
262
|
}).finally(() => {
|
|
263
263
|
cts2.dispose();
|
|
@@ -293,7 +293,7 @@ export class RenameAction extends EditorAction {
|
|
|
293
293
|
constructor() {
|
|
294
294
|
super({
|
|
295
295
|
id: 'editor.action.rename',
|
|
296
|
-
label: nls.localize2(
|
|
296
|
+
label: nls.localize2(1386, "Rename Symbol"),
|
|
297
297
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.hasRenameProvider),
|
|
298
298
|
kbOpts: {
|
|
299
299
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -374,7 +374,7 @@ registerAction2(class FocusNextRenameSuggestion extends Action2 {
|
|
|
374
374
|
super({
|
|
375
375
|
id: 'focusNextRenameSuggestion',
|
|
376
376
|
title: {
|
|
377
|
-
...nls.localize2(
|
|
377
|
+
...nls.localize2(1387, "Focus Next Rename Suggestion"),
|
|
378
378
|
},
|
|
379
379
|
precondition: CONTEXT_RENAME_INPUT_VISIBLE,
|
|
380
380
|
keybinding: [
|
|
@@ -402,7 +402,7 @@ registerAction2(class FocusPreviousRenameSuggestion extends Action2 {
|
|
|
402
402
|
super({
|
|
403
403
|
id: 'focusPreviousRenameSuggestion',
|
|
404
404
|
title: {
|
|
405
|
-
...nls.localize2(
|
|
405
|
+
...nls.localize2(1388, "Focus Previous Rename Suggestion"),
|
|
406
406
|
},
|
|
407
407
|
precondition: CONTEXT_RENAME_INPUT_VISIBLE,
|
|
408
408
|
keybinding: [
|
|
@@ -447,7 +447,7 @@ Registry.as(Extensions.Configuration).registerConfiguration({
|
|
|
447
447
|
properties: {
|
|
448
448
|
'editor.rename.enablePreview': {
|
|
449
449
|
scope: 6 /* ConfigurationScope.LANGUAGE_OVERRIDABLE */,
|
|
450
|
-
description: nls.localize(
|
|
450
|
+
description: nls.localize(1385, "Enable/disable the ability to preview changes before renaming"),
|
|
451
451
|
default: true,
|
|
452
452
|
type: 'boolean'
|
|
453
453
|
}
|
|
@@ -39,8 +39,8 @@ import { editorWidgetBackground, inputBackground, inputBorder, inputForeground,
|
|
|
39
39
|
import { IThemeService } from '../../../../platform/theme/common/themeService.js';
|
|
40
40
|
/** for debugging */
|
|
41
41
|
const _sticky = false;
|
|
42
|
-
export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisible', false, nls.localize(
|
|
43
|
-
export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey('renameInputFocused', false, nls.localize(
|
|
42
|
+
export const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisible', false, nls.localize(1389, "Whether the rename input widget is visible"));
|
|
43
|
+
export const CONTEXT_RENAME_INPUT_FOCUSED = new RawContextKey('renameInputFocused', false, nls.localize(1390, "Whether the rename input widget is focused"));
|
|
44
44
|
let RenameWidget = class RenameWidget {
|
|
45
45
|
constructor(_editor, _acceptKeybindings, _themeService, _keybindingService, contextKeyService, _logService) {
|
|
46
46
|
this._editor = _editor;
|
|
@@ -163,7 +163,7 @@ let RenameWidget = class RenameWidget {
|
|
|
163
163
|
}
|
|
164
164
|
beforeRender() {
|
|
165
165
|
const [accept, preview] = this._acceptKeybindings;
|
|
166
|
-
this._label.innerText = nls.localize(
|
|
166
|
+
this._label.innerText = nls.localize(1391, "{0} to Rename, {1} to Preview", this._keybindingService.lookupKeybinding(accept)?.getLabel(), this._keybindingService.lookupKeybinding(preview)?.getLabel());
|
|
167
167
|
this._domNode.style.minWidth = `200px`; // to prevent from widening when candidates come in
|
|
168
168
|
return null;
|
|
169
169
|
}
|
|
@@ -477,7 +477,7 @@ class RenameCandidateListView {
|
|
|
477
477
|
// adjust list container layout
|
|
478
478
|
this._listContainer.style.height = `${height}px`;
|
|
479
479
|
this._listContainer.style.width = `${width}px`;
|
|
480
|
-
aria.status(nls.localize(
|
|
480
|
+
aria.status(nls.localize(1392, "Received {0} rename suggestions", candidates.length));
|
|
481
481
|
}
|
|
482
482
|
clearCandidates() {
|
|
483
483
|
this._listContainer.style.height = '0px';
|
|
@@ -619,13 +619,13 @@ class InputWithButton {
|
|
|
619
619
|
this._inputNode.className = 'rename-input';
|
|
620
620
|
this._inputNode.type = 'text';
|
|
621
621
|
this._inputNode.style.border = 'none';
|
|
622
|
-
this._inputNode.setAttribute('aria-label', nls.localize(
|
|
622
|
+
this._inputNode.setAttribute('aria-label', nls.localize(1393, "Rename input. Type new name and press Enter to commit."));
|
|
623
623
|
this._domNode.appendChild(this._inputNode);
|
|
624
624
|
this._buttonNode = document.createElement('div');
|
|
625
625
|
this._buttonNode.className = 'rename-suggestions-button';
|
|
626
626
|
this._buttonNode.setAttribute('tabindex', '0');
|
|
627
|
-
this._buttonGenHoverText = nls.localize(
|
|
628
|
-
this._buttonCancelHoverText = nls.localize(
|
|
627
|
+
this._buttonGenHoverText = nls.localize(1394, "Generate New Name Suggestions");
|
|
628
|
+
this._buttonCancelHoverText = nls.localize(1395, "Cancel");
|
|
629
629
|
this._buttonHoverContent = this._buttonGenHoverText;
|
|
630
630
|
this._disposables.add(getBaseLayerHoverDelegate().setupDelayedHover(this._buttonNode, () => ({
|
|
631
631
|
content: this._buttonHoverContent,
|
|
@@ -131,7 +131,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
|
|
|
131
131
|
constructor() {
|
|
132
132
|
super(true, {
|
|
133
133
|
id: 'editor.action.smartSelect.expand',
|
|
134
|
-
label: nls.localize2(
|
|
134
|
+
label: nls.localize2(1398, "Expand Selection"),
|
|
135
135
|
precondition: undefined,
|
|
136
136
|
kbOpts: {
|
|
137
137
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -145,7 +145,7 @@ class GrowSelectionAction extends AbstractSmartSelect {
|
|
|
145
145
|
menuOpts: {
|
|
146
146
|
menuId: MenuId.MenubarSelectionMenu,
|
|
147
147
|
group: '1_basic',
|
|
148
|
-
title: nls.localize(
|
|
148
|
+
title: nls.localize(1396, "&&Expand Selection"),
|
|
149
149
|
order: 2
|
|
150
150
|
}
|
|
151
151
|
});
|
|
@@ -157,7 +157,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
|
|
|
157
157
|
constructor() {
|
|
158
158
|
super(false, {
|
|
159
159
|
id: 'editor.action.smartSelect.shrink',
|
|
160
|
-
label: nls.localize2(
|
|
160
|
+
label: nls.localize2(1399, "Shrink Selection"),
|
|
161
161
|
precondition: undefined,
|
|
162
162
|
kbOpts: {
|
|
163
163
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -171,7 +171,7 @@ class ShrinkSelectionAction extends AbstractSmartSelect {
|
|
|
171
171
|
menuOpts: {
|
|
172
172
|
menuId: MenuId.MenubarSelectionMenu,
|
|
173
173
|
group: '1_basic',
|
|
174
|
-
title: nls.localize(
|
|
174
|
+
title: nls.localize(1397, "&&Shrink Selection"),
|
|
175
175
|
order: 3
|
|
176
176
|
}
|
|
177
177
|
});
|
|
@@ -40,9 +40,9 @@ let SnippetController2 = class SnippetController2 {
|
|
|
40
40
|
static get(editor) {
|
|
41
41
|
return editor.getContribution(SnippetController2_1.ID);
|
|
42
42
|
}
|
|
43
|
-
static { this.InSnippetMode = new RawContextKey('inSnippetMode', false, localize(
|
|
44
|
-
static { this.HasNextTabstop = new RawContextKey('hasNextTabstop', false, localize(
|
|
45
|
-
static { this.HasPrevTabstop = new RawContextKey('hasPrevTabstop', false, localize(
|
|
43
|
+
static { this.InSnippetMode = new RawContextKey('inSnippetMode', false, localize(1400, "Whether the editor in current in snippet mode")); }
|
|
44
|
+
static { this.HasNextTabstop = new RawContextKey('hasNextTabstop', false, localize(1401, "Whether there is a next tab stop when in snippet mode")); }
|
|
45
|
+
static { this.HasPrevTabstop = new RawContextKey('hasPrevTabstop', false, localize(1402, "Whether there is a previous tab stop when in snippet mode")); }
|
|
46
46
|
constructor(_editor, _logService, _languageFeaturesService, contextKeyService, _languageConfigurationService) {
|
|
47
47
|
this._editor = _editor;
|
|
48
48
|
this._logService = _logService;
|
|
@@ -128,7 +128,7 @@ let SnippetController2 = class SnippetController2 {
|
|
|
128
128
|
sortText: 'a'.repeat(i + 1),
|
|
129
129
|
range: activeChoice.range,
|
|
130
130
|
filterText: isAnyOfOptions ? `${word}_${option.value}` : undefined,
|
|
131
|
-
command: { id: 'jumpToNextSnippetPlaceholder', title: localize(
|
|
131
|
+
command: { id: 'jumpToNextSnippetPlaceholder', title: localize(1403, 'Go to next placeholder...') }
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
return { suggestions };
|
|
@@ -245,10 +245,10 @@ export class TimeBasedVariableResolver {
|
|
|
245
245
|
constructor() {
|
|
246
246
|
this._date = new Date();
|
|
247
247
|
}
|
|
248
|
-
static { this.dayNames = [nls.localize(
|
|
249
|
-
static { this.dayNamesShort = [nls.localize(
|
|
250
|
-
static { this.monthNames = [nls.localize(
|
|
251
|
-
static { this.monthNamesShort = [nls.localize(
|
|
248
|
+
static { this.dayNames = [nls.localize(1404, "Sunday"), nls.localize(1405, "Monday"), nls.localize(1406, "Tuesday"), nls.localize(1407, "Wednesday"), nls.localize(1408, "Thursday"), nls.localize(1409, "Friday"), nls.localize(1410, "Saturday")]; }
|
|
249
|
+
static { this.dayNamesShort = [nls.localize(1411, "Sun"), nls.localize(1412, "Mon"), nls.localize(1413, "Tue"), nls.localize(1414, "Wed"), nls.localize(1415, "Thu"), nls.localize(1416, "Fri"), nls.localize(1417, "Sat")]; }
|
|
250
|
+
static { this.monthNames = [nls.localize(1418, "January"), nls.localize(1419, "February"), nls.localize(1420, "March"), nls.localize(1421, "April"), nls.localize(1422, "May"), nls.localize(1423, "June"), nls.localize(1424, "July"), nls.localize(1425, "August"), nls.localize(1426, "September"), nls.localize(1427, "October"), nls.localize(1428, "November"), nls.localize(1429, "December")]; }
|
|
251
|
+
static { this.monthNamesShort = [nls.localize(1430, "Jan"), nls.localize(1431, "Feb"), nls.localize(1432, "Mar"), nls.localize(1433, "Apr"), nls.localize(1434, "May"), nls.localize(1435, "Jun"), nls.localize(1436, "Jul"), nls.localize(1437, "Aug"), nls.localize(1438, "Sep"), nls.localize(1439, "Oct"), nls.localize(1440, "Nov"), nls.localize(1441, "Dec")]; }
|
|
252
252
|
resolve(variable) {
|
|
253
253
|
const { name } = variable;
|
|
254
254
|
if (name === 'CURRENT_YEAR') {
|