monaco-editor-core 0.55.0-dev-20251008 → 0.55.0-dev-20251009
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.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.ru.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 +3 -1
- package/esm/vs/base/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/esm/vs/base/browser/ui/toolbar/toolbar.js +4 -1
- package/esm/vs/base/browser/ui/toolbar/toolbar.js.map +1 -1
- package/esm/vs/base/common/codiconsLibrary.js +9 -1
- package/esm/vs/base/common/codiconsLibrary.js.map +1 -1
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +5 -8
- package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
- package/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.js +36 -31
- package/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer.js.map +1 -1
- package/esm/vs/editor/common/core/text/abstractText.js +5 -1
- package/esm/vs/editor/common/core/text/abstractText.js.map +1 -1
- package/esm/vs/editor/common/model/tokens/treeSitter/tokenStore.js +2 -1
- package/esm/vs/editor/common/model/tokens/treeSitter/tokenStore.js.map +1 -1
- package/esm/vs/editor/contrib/find/browser/findController.js +54 -61
- package/esm/vs/editor/contrib/find/browser/findController.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js +5 -8
- package/esm/vs/editor/contrib/hover/browser/glyphHoverWidget.js.map +1 -1
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +18 -23
- package/esm/vs/editor/contrib/hover/browser/markdownHoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +10 -12
- package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +9 -13
- package/esm/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js +8 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorMenu.js.map +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js +1 -1
- package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/theme.js +20 -20
- package/esm/vs/editor/contrib/insertFinalNewLine/browser/insertFinalNewLine.js +1 -1
- package/esm/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/esm/vs/editor/contrib/linesOperations/browser/linesOperations.js +31 -31
- package/esm/vs/editor/contrib/linkedEditing/browser/linkedEditing.js +2 -2
- package/esm/vs/editor/contrib/links/browser/links.js +10 -10
- package/esm/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/esm/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHints.js +1 -1
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +10 -12
- package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
- package/esm/vs/editor/contrib/peekView/browser/peekView.js +18 -18
- package/esm/vs/editor/contrib/placeholderText/browser/placeholderText.contribution.js +1 -1
- package/esm/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +5 -5
- 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/rename/browser/renameWidget.js.map +1 -1
- 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 +18 -24
- package/esm/vs/editor/contrib/suggest/browser/suggestWidget.js.map +1 -1
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +15 -18
- package/esm/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js.map +1 -1
- 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 +7 -6
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js.map +1 -1
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +29 -32
- package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
- 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/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/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 +5 -5
- 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 +15 -15
- 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
- package/version.txt +1 -1
|
@@ -220,10 +220,10 @@ let LinkDetector = class LinkDetector extends Disposable {
|
|
|
220
220
|
const messageOrError = err instanceof Error ? err.message : err;
|
|
221
221
|
// different error cases
|
|
222
222
|
if (messageOrError === 'invalid') {
|
|
223
|
-
this.notificationService.warn(nls.localize(
|
|
223
|
+
this.notificationService.warn(nls.localize(1268, 'Failed to open this link because it is not well-formed: {0}', link.url.toString()));
|
|
224
224
|
}
|
|
225
225
|
else if (messageOrError === 'missing') {
|
|
226
|
-
this.notificationService.warn(nls.localize(
|
|
226
|
+
this.notificationService.warn(nls.localize(1269, 'Failed to open this link because its target is missing.'));
|
|
227
227
|
}
|
|
228
228
|
else {
|
|
229
229
|
onUnexpectedError(err);
|
|
@@ -317,15 +317,15 @@ function getHoverMessage(link, useMetaKey) {
|
|
|
317
317
|
const label = link.tooltip
|
|
318
318
|
? link.tooltip
|
|
319
319
|
: executeCmd
|
|
320
|
-
? nls.localize(
|
|
321
|
-
: nls.localize(
|
|
320
|
+
? nls.localize(1270, 'Execute command')
|
|
321
|
+
: nls.localize(1271, 'Follow link');
|
|
322
322
|
const kb = useMetaKey
|
|
323
323
|
? platform.isMacintosh
|
|
324
|
-
? nls.localize(
|
|
325
|
-
: nls.localize(
|
|
324
|
+
? nls.localize(1272, "cmd + click")
|
|
325
|
+
: nls.localize(1273, "ctrl + click")
|
|
326
326
|
: platform.isMacintosh
|
|
327
|
-
? nls.localize(
|
|
328
|
-
: nls.localize(
|
|
327
|
+
? nls.localize(1274, "option + click")
|
|
328
|
+
: nls.localize(1275, "alt + click");
|
|
329
329
|
if (link.url) {
|
|
330
330
|
let nativeLabel = '';
|
|
331
331
|
if (/^command:/i.test(link.url.toString())) {
|
|
@@ -333,7 +333,7 @@ function getHoverMessage(link, useMetaKey) {
|
|
|
333
333
|
const match = link.url.toString().match(/^command:([^?#]+)/);
|
|
334
334
|
if (match) {
|
|
335
335
|
const commandId = match[1];
|
|
336
|
-
nativeLabel = nls.localize(
|
|
336
|
+
nativeLabel = nls.localize(1276, "Execute command {0}", commandId);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
const hoverMessage = new MarkdownString('', true)
|
|
@@ -349,7 +349,7 @@ class OpenLinkAction extends EditorAction {
|
|
|
349
349
|
constructor() {
|
|
350
350
|
super({
|
|
351
351
|
id: 'editor.action.openLink',
|
|
352
|
-
label: nls.localize2(
|
|
352
|
+
label: nls.localize2(1277, "Open Link"),
|
|
353
353
|
precondition: undefined
|
|
354
354
|
});
|
|
355
355
|
}
|
|
@@ -28,7 +28,7 @@ import * as dom from '../../../../base/browser/dom.js';
|
|
|
28
28
|
let MessageController = class MessageController {
|
|
29
29
|
static { MessageController_1 = this; }
|
|
30
30
|
static { this.ID = 'editor.contrib.messageController'; }
|
|
31
|
-
static { this.MESSAGE_VISIBLE = new RawContextKey('messageVisible', false, nls.localize(
|
|
31
|
+
static { this.MESSAGE_VISIBLE = new RawContextKey('messageVisible', false, nls.localize(1278, 'Whether the editor is currently showing an inline message')); }
|
|
32
32
|
static get(editor) {
|
|
33
33
|
return editor.getContribution(MessageController_1.ID);
|
|
34
34
|
}
|
|
@@ -32,7 +32,7 @@ function announceCursorChange(previousCursorState, cursorState) {
|
|
|
32
32
|
const cursorDiff = cursorState.filter(cs => !previousCursorState.find(pcs => pcs.equals(cs)));
|
|
33
33
|
if (cursorDiff.length >= 1) {
|
|
34
34
|
const cursorPositions = cursorDiff.map(cs => `line ${cs.viewState.position.lineNumber} column ${cs.viewState.position.column}`).join(', ');
|
|
35
|
-
const msg = cursorDiff.length === 1 ? nls.localize(
|
|
35
|
+
const msg = cursorDiff.length === 1 ? nls.localize(1279, "Cursor added: {0}", cursorPositions) : nls.localize(1280, "Cursors added: {0}", cursorPositions);
|
|
36
36
|
status(msg);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ export class InsertCursorAbove extends EditorAction {
|
|
|
40
40
|
constructor() {
|
|
41
41
|
super({
|
|
42
42
|
id: 'editor.action.insertCursorAbove',
|
|
43
|
-
label: nls.localize2(
|
|
43
|
+
label: nls.localize2(1289, "Add Cursor Above"),
|
|
44
44
|
precondition: undefined,
|
|
45
45
|
kbOpts: {
|
|
46
46
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -54,7 +54,7 @@ export class InsertCursorAbove extends EditorAction {
|
|
|
54
54
|
menuOpts: {
|
|
55
55
|
menuId: MenuId.MenubarSelectionMenu,
|
|
56
56
|
group: '3_multi',
|
|
57
|
-
title: nls.localize(
|
|
57
|
+
title: nls.localize(1281, "&&Add Cursor Above"),
|
|
58
58
|
order: 2
|
|
59
59
|
}
|
|
60
60
|
});
|
|
@@ -82,7 +82,7 @@ export class InsertCursorBelow extends EditorAction {
|
|
|
82
82
|
constructor() {
|
|
83
83
|
super({
|
|
84
84
|
id: 'editor.action.insertCursorBelow',
|
|
85
|
-
label: nls.localize2(
|
|
85
|
+
label: nls.localize2(1290, "Add Cursor Below"),
|
|
86
86
|
precondition: undefined,
|
|
87
87
|
kbOpts: {
|
|
88
88
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -96,7 +96,7 @@ export class InsertCursorBelow extends EditorAction {
|
|
|
96
96
|
menuOpts: {
|
|
97
97
|
menuId: MenuId.MenubarSelectionMenu,
|
|
98
98
|
group: '3_multi',
|
|
99
|
-
title: nls.localize(
|
|
99
|
+
title: nls.localize(1282, "A&&dd Cursor Below"),
|
|
100
100
|
order: 3
|
|
101
101
|
}
|
|
102
102
|
});
|
|
@@ -124,7 +124,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
|
|
124
124
|
constructor() {
|
|
125
125
|
super({
|
|
126
126
|
id: 'editor.action.insertCursorAtEndOfEachLineSelected',
|
|
127
|
-
label: nls.localize2(
|
|
127
|
+
label: nls.localize2(1291, "Add Cursors to Line Ends"),
|
|
128
128
|
precondition: undefined,
|
|
129
129
|
kbOpts: {
|
|
130
130
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -134,7 +134,7 @@ class InsertCursorAtEndOfEachLineSelected extends EditorAction {
|
|
|
134
134
|
menuOpts: {
|
|
135
135
|
menuId: MenuId.MenubarSelectionMenu,
|
|
136
136
|
group: '3_multi',
|
|
137
|
-
title: nls.localize(
|
|
137
|
+
title: nls.localize(1283, "Add C&&ursors to Line Ends"),
|
|
138
138
|
order: 4
|
|
139
139
|
}
|
|
140
140
|
});
|
|
@@ -171,7 +171,7 @@ class InsertCursorAtEndOfLineSelected extends EditorAction {
|
|
|
171
171
|
constructor() {
|
|
172
172
|
super({
|
|
173
173
|
id: 'editor.action.addCursorsToBottom',
|
|
174
|
-
label: nls.localize2(
|
|
174
|
+
label: nls.localize2(1292, "Add Cursors to Bottom"),
|
|
175
175
|
precondition: undefined
|
|
176
176
|
});
|
|
177
177
|
}
|
|
@@ -197,7 +197,7 @@ class InsertCursorAtTopOfLineSelected extends EditorAction {
|
|
|
197
197
|
constructor() {
|
|
198
198
|
super({
|
|
199
199
|
id: 'editor.action.addCursorsToTop',
|
|
200
|
-
label: nls.localize2(
|
|
200
|
+
label: nls.localize2(1293, "Add Cursors to Top"),
|
|
201
201
|
precondition: undefined
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -574,7 +574,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
|
|
574
574
|
constructor() {
|
|
575
575
|
super({
|
|
576
576
|
id: 'editor.action.addSelectionToNextFindMatch',
|
|
577
|
-
label: nls.localize2(
|
|
577
|
+
label: nls.localize2(1294, "Add Selection to Next Find Match"),
|
|
578
578
|
precondition: undefined,
|
|
579
579
|
kbOpts: {
|
|
580
580
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -584,7 +584,7 @@ export class AddSelectionToNextFindMatchAction extends MultiCursorSelectionContr
|
|
|
584
584
|
menuOpts: {
|
|
585
585
|
menuId: MenuId.MenubarSelectionMenu,
|
|
586
586
|
group: '3_multi',
|
|
587
|
-
title: nls.localize(
|
|
587
|
+
title: nls.localize(1284, "Add &&Next Occurrence"),
|
|
588
588
|
order: 5
|
|
589
589
|
}
|
|
590
590
|
});
|
|
@@ -597,12 +597,12 @@ export class AddSelectionToPreviousFindMatchAction extends MultiCursorSelectionC
|
|
|
597
597
|
constructor() {
|
|
598
598
|
super({
|
|
599
599
|
id: 'editor.action.addSelectionToPreviousFindMatch',
|
|
600
|
-
label: nls.localize2(
|
|
600
|
+
label: nls.localize2(1295, "Add Selection to Previous Find Match"),
|
|
601
601
|
precondition: undefined,
|
|
602
602
|
menuOpts: {
|
|
603
603
|
menuId: MenuId.MenubarSelectionMenu,
|
|
604
604
|
group: '3_multi',
|
|
605
|
-
title: nls.localize(
|
|
605
|
+
title: nls.localize(1285, "Add P&&revious Occurrence"),
|
|
606
606
|
order: 6
|
|
607
607
|
}
|
|
608
608
|
});
|
|
@@ -615,7 +615,7 @@ export class MoveSelectionToNextFindMatchAction extends MultiCursorSelectionCont
|
|
|
615
615
|
constructor() {
|
|
616
616
|
super({
|
|
617
617
|
id: 'editor.action.moveSelectionToNextFindMatch',
|
|
618
|
-
label: nls.localize2(
|
|
618
|
+
label: nls.localize2(1296, "Move Last Selection to Next Find Match"),
|
|
619
619
|
precondition: undefined,
|
|
620
620
|
kbOpts: {
|
|
621
621
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -632,7 +632,7 @@ export class MoveSelectionToPreviousFindMatchAction extends MultiCursorSelection
|
|
|
632
632
|
constructor() {
|
|
633
633
|
super({
|
|
634
634
|
id: 'editor.action.moveSelectionToPreviousFindMatch',
|
|
635
|
-
label: nls.localize2(
|
|
635
|
+
label: nls.localize2(1297, "Move Last Selection to Previous Find Match"),
|
|
636
636
|
precondition: undefined
|
|
637
637
|
});
|
|
638
638
|
}
|
|
@@ -644,7 +644,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
|
|
644
644
|
constructor() {
|
|
645
645
|
super({
|
|
646
646
|
id: 'editor.action.selectHighlights',
|
|
647
|
-
label: nls.localize2(
|
|
647
|
+
label: nls.localize2(1298, "Select All Occurrences of Find Match"),
|
|
648
648
|
precondition: undefined,
|
|
649
649
|
kbOpts: {
|
|
650
650
|
kbExpr: EditorContextKeys.focus,
|
|
@@ -654,7 +654,7 @@ export class SelectHighlightsAction extends MultiCursorSelectionControllerAction
|
|
|
654
654
|
menuOpts: {
|
|
655
655
|
menuId: MenuId.MenubarSelectionMenu,
|
|
656
656
|
group: '3_multi',
|
|
657
|
-
title: nls.localize(
|
|
657
|
+
title: nls.localize(1286, "Select All &&Occurrences"),
|
|
658
658
|
order: 7
|
|
659
659
|
}
|
|
660
660
|
});
|
|
@@ -667,7 +667,7 @@ export class CompatChangeAll extends MultiCursorSelectionControllerAction {
|
|
|
667
667
|
constructor() {
|
|
668
668
|
super({
|
|
669
669
|
id: 'editor.action.changeAll',
|
|
670
|
-
label: nls.localize2(
|
|
670
|
+
label: nls.localize2(1299, "Change All Occurrences"),
|
|
671
671
|
precondition: ContextKeyExpr.and(EditorContextKeys.writable, EditorContextKeys.editorTextFocus),
|
|
672
672
|
kbOpts: {
|
|
673
673
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -925,9 +925,9 @@ export class FocusNextCursor extends EditorAction {
|
|
|
925
925
|
constructor() {
|
|
926
926
|
super({
|
|
927
927
|
id: 'editor.action.focusNextCursor',
|
|
928
|
-
label: nls.localize2(
|
|
928
|
+
label: nls.localize2(1300, "Focus Next Cursor"),
|
|
929
929
|
metadata: {
|
|
930
|
-
description: nls.localize(
|
|
930
|
+
description: nls.localize(1287, "Focuses the next cursor"),
|
|
931
931
|
args: [],
|
|
932
932
|
},
|
|
933
933
|
precondition: undefined
|
|
@@ -957,9 +957,9 @@ export class FocusPreviousCursor extends EditorAction {
|
|
|
957
957
|
constructor() {
|
|
958
958
|
super({
|
|
959
959
|
id: 'editor.action.focusPreviousCursor',
|
|
960
|
-
label: nls.localize2(
|
|
960
|
+
label: nls.localize2(1301, "Focus Previous Cursor"),
|
|
961
961
|
metadata: {
|
|
962
|
-
description: nls.localize(
|
|
962
|
+
description: nls.localize(1288, "Focuses the previous cursor"),
|
|
963
963
|
args: [],
|
|
964
964
|
},
|
|
965
965
|
precondition: undefined
|
|
@@ -67,7 +67,7 @@ export class TriggerParameterHintsAction extends EditorAction {
|
|
|
67
67
|
constructor() {
|
|
68
68
|
super({
|
|
69
69
|
id: 'editor.action.triggerParameterHints',
|
|
70
|
-
label: nls.localize2(
|
|
70
|
+
label: nls.localize2(1302, "Trigger Parameter Hints"),
|
|
71
71
|
precondition: EditorContextKeys.hasSignatureHelpProvider,
|
|
72
72
|
kbOpts: {
|
|
73
73
|
kbExpr: EditorContextKeys.editorTextFocus,
|
|
@@ -22,31 +22,29 @@ import { escapeRegExpCharacters } from '../../../../base/common/strings.js';
|
|
|
22
22
|
import { assertReturnsDefined } from '../../../../base/common/types.js';
|
|
23
23
|
import './parameterHints.css';
|
|
24
24
|
import { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';
|
|
25
|
-
import {
|
|
26
|
-
import { MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js';
|
|
25
|
+
import { IMarkdownRendererService } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js';
|
|
27
26
|
import { Context } from './provideSignatureHelp.js';
|
|
28
27
|
import * as nls from '../../../../nls.js';
|
|
29
28
|
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
|
|
30
|
-
import { IOpenerService } from '../../../../platform/opener/common/opener.js';
|
|
31
29
|
import { listHighlightForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js';
|
|
32
30
|
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
|
|
33
31
|
import { ThemeIcon } from '../../../../base/common/themables.js';
|
|
34
32
|
const $ = dom.$;
|
|
35
|
-
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize(
|
|
36
|
-
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize(
|
|
33
|
+
const parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize(1303, 'Icon for show next parameter hint.'));
|
|
34
|
+
const parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize(1304, 'Icon for show previous parameter hint.'));
|
|
37
35
|
let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
38
36
|
static { ParameterHintsWidget_1 = this; }
|
|
39
37
|
static { this.ID = 'editor.widget.parameterHintsWidget'; }
|
|
40
|
-
constructor(editor, model, contextKeyService,
|
|
38
|
+
constructor(editor, model, contextKeyService, markdownRendererService) {
|
|
41
39
|
super();
|
|
42
40
|
this.editor = editor;
|
|
43
41
|
this.model = model;
|
|
42
|
+
this.markdownRendererService = markdownRendererService;
|
|
44
43
|
this.renderDisposeables = this._register(new DisposableStore());
|
|
45
44
|
this.visible = false;
|
|
46
45
|
this.announcedLabel = null;
|
|
47
46
|
// Editor.IContentWidget.allowEditorOverflow
|
|
48
47
|
this.allowEditorOverflow = true;
|
|
49
|
-
this.markdownRenderer = new MarkdownRenderer({ editor }, languageService, openerService);
|
|
50
48
|
this.keyVisible = Context.Visible.bindTo(contextKeyService);
|
|
51
49
|
this.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);
|
|
52
50
|
}
|
|
@@ -208,7 +206,7 @@ let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
|
208
206
|
// Select method gets called on every user type while parameter hints are visible.
|
|
209
207
|
// We do not want to spam the user with same announcements, so we only announce if the current parameter changed.
|
|
210
208
|
if (this.announcedLabel !== labelToAnnounce) {
|
|
211
|
-
aria.alert(nls.localize(
|
|
209
|
+
aria.alert(nls.localize(1305, "{0}, hint", labelToAnnounce));
|
|
212
210
|
this.announcedLabel = labelToAnnounce;
|
|
213
211
|
}
|
|
214
212
|
}
|
|
@@ -216,7 +214,8 @@ let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
|
216
214
|
this.domNodes.scrollbar.scanDomNode();
|
|
217
215
|
}
|
|
218
216
|
renderMarkdownDocs(markdown) {
|
|
219
|
-
const renderedContents = this.renderDisposeables.add(this.
|
|
217
|
+
const renderedContents = this.renderDisposeables.add(this.markdownRendererService.render(markdown, {
|
|
218
|
+
editor: this.editor,
|
|
220
219
|
asyncRenderCallback: () => {
|
|
221
220
|
this.domNodes?.scrollbar.scanDomNode();
|
|
222
221
|
}
|
|
@@ -302,9 +301,8 @@ let ParameterHintsWidget = class ParameterHintsWidget extends Disposable {
|
|
|
302
301
|
};
|
|
303
302
|
ParameterHintsWidget = ParameterHintsWidget_1 = __decorate([
|
|
304
303
|
__param(2, IContextKeyService),
|
|
305
|
-
__param(3,
|
|
306
|
-
__param(4, ILanguageService)
|
|
304
|
+
__param(3, IMarkdownRendererService)
|
|
307
305
|
], ParameterHintsWidget);
|
|
308
306
|
export { ParameterHintsWidget };
|
|
309
|
-
registerColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize(
|
|
307
|
+
registerColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize(1306, 'Foreground color of the active item in the parameter hint.'));
|
|
310
308
|
//# sourceMappingURL=parameterHintsWidget.js.map
|
|
@@ -1 +1 @@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QAAQ,CAAC,IAAsC,EAAE,4DAA4D,CAAC,CAAC,CAAC","file":"parameterHintsWidget.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 * as dom from '../../../../base/browser/dom.js';\nimport * as aria from '../../../../base/browser/ui/aria/aria.js';\nimport { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { IMarkdownString } from '../../../../base/common/htmlContent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { escapeRegExpCharacters } from '../../../../base/common/strings.js';\nimport { assertReturnsDefined } from '../../../../base/common/types.js';\nimport './parameterHints.css';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport * as languages from '../../../common/languages.js';\nimport { ILanguageService } from '../../../common/languages/language.js';\nimport { IMarkdownRenderResult, MarkdownRenderer } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js';\nimport { ParameterHintsModel } from './parameterHintsModel.js';\nimport { Context } from './provideSignatureHelp.js';\nimport * as nls from '../../../../nls.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { IOpenerService } from '../../../../platform/opener/common/opener.js';\nimport { listHighlightForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js';\nimport { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\n\nconst $ = dom.$;\n\nconst parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));\nconst parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));\n\nexport class ParameterHintsWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly ID = 'editor.widget.parameterHintsWidget';\n\n\tprivate readonly markdownRenderer: MarkdownRenderer;\n\tprivate readonly renderDisposeables = this._register(new DisposableStore());\n\tprivate readonly keyVisible: IContextKey<boolean>;\n\tprivate readonly keyMultipleSignatures: IContextKey<boolean>;\n\n\tprivate domNodes?: {\n\t\treadonly element: HTMLElement;\n\t\treadonly signature: HTMLElement;\n\t\treadonly docs: HTMLElement;\n\t\treadonly overloads: HTMLElement;\n\t\treadonly scrollbar: DomScrollableElement;\n\t};\n\n\tprivate visible: boolean = false;\n\tprivate announcedLabel: string | null = null;\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tallowEditorOverflow = true;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\tprivate readonly model: ParameterHintsModel,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IOpenerService openerService: IOpenerService,\n\t\t@ILanguageService languageService: ILanguageService\n\t) {\n\t\tsuper();\n\n\t\tthis.markdownRenderer = new MarkdownRenderer({ editor }, languageService, openerService);\n\n\t\tthis.keyVisible = Context.Visible.bindTo(contextKeyService);\n\t\tthis.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);\n\t}\n\n\tprivate createParameterHintDOMNodes() {\n\t\tconst element = $('.editor-widget.parameter-hints-widget');\n\t\tconst wrapper = dom.append(element, $('.phwrapper'));\n\t\twrapper.tabIndex = -1;\n\n\t\tconst controls = dom.append(wrapper, $('.controls'));\n\t\tconst previous = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon)));\n\t\tconst overloads = dom.append(controls, $('.overloads'));\n\t\tconst next = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsNextIcon)));\n\n\t\tthis._register(dom.addDisposableListener(previous, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.previous();\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(next, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.next();\n\t\t}));\n\n\t\tconst body = $('.body');\n\t\tconst scrollbar = new DomScrollableElement(body, {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t});\n\t\tthis._register(scrollbar);\n\t\twrapper.appendChild(scrollbar.getDomNode());\n\n\t\tconst signature = dom.append(body, $('.signature'));\n\t\tconst docs = dom.append(body, $('.docs'));\n\n\t\telement.style.userSelect = 'text';\n\n\t\tthis.domNodes = {\n\t\t\telement,\n\t\t\tsignature,\n\t\t\toverloads,\n\t\t\tdocs,\n\t\t\tscrollbar,\n\t\t};\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.hide();\n\n\t\tthis._register(this.editor.onDidChangeCursorSelection(e => {\n\t\t\tif (this.visible) {\n\t\t\t\tthis.editor.layoutContentWidget(this);\n\t\t\t}\n\t\t}));\n\n\t\tconst updateFont = () => {\n\t\t\tif (!this.domNodes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\t\tconst element = this.domNodes.element;\n\t\t\telement.style.fontSize = `${fontInfo.fontSize}px`;\n\t\t\telement.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`;\n\t\t\telement.style.setProperty('--vscode-parameterHintsWidget-editorFontFamily', fontInfo.fontFamily);\n\t\t\telement.style.setProperty('--vscode-parameterHintsWidget-editorFontFamilyDefault', EDITOR_FONT_DEFAULTS.fontFamily);\n\t\t};\n\n\t\tupdateFont();\n\n\t\tthis._register(Event.chain(\n\t\t\tthis.editor.onDidChangeConfiguration.bind(this.editor),\n\t\t\t$ => $.filter(e => e.hasChanged(EditorOption.fontInfo))\n\t\t)(updateFont));\n\n\t\tthis._register(this.editor.onDidLayoutChange(e => this.updateMaxHeight()));\n\t\tthis.updateMaxHeight();\n\t}\n\n\tpublic show(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\n\t\tthis.keyVisible.set(true);\n\t\tthis.visible = true;\n\t\tsetTimeout(() => {\n\t\t\tthis.domNodes?.element.classList.add('visible');\n\t\t}, 100);\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tpublic hide(): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyVisible.reset();\n\t\tthis.visible = false;\n\t\tthis.announcedLabel = null;\n\t\tthis.domNodes?.element.classList.remove('visible');\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (this.visible) {\n\t\t\treturn {\n\t\t\t\tposition: this.editor.getPosition(),\n\t\t\t\tpreference: [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW]\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic render(hints: languages.SignatureHelp): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst multiple = hints.signatures.length > 1;\n\t\tthis.domNodes.element.classList.toggle('multiple', multiple);\n\t\tthis.keyMultipleSignatures.set(multiple);\n\n\t\tthis.domNodes.signature.innerText = '';\n\t\tthis.domNodes.docs.innerText = '';\n\n\t\tconst signature = hints.signatures[hints.activeSignature];\n\t\tif (!signature) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst code = dom.append(this.domNodes.signature, $('.code'));\n\t\tconst hasParameters = signature.parameters.length > 0;\n\t\tconst activeParameterIndex = signature.activeParameter ?? hints.activeParameter;\n\n\t\tif (!hasParameters) {\n\t\t\tconst label = dom.append(code, $('span'));\n\t\t\tlabel.textContent = signature.label;\n\t\t} else {\n\t\t\tthis.renderParameters(code, signature, activeParameterIndex);\n\t\t}\n\n\t\tconst activeParameter: languages.ParameterInformation | undefined = signature.parameters[activeParameterIndex];\n\t\tif (activeParameter?.documentation) {\n\t\t\tconst documentation = $('span.documentation');\n\t\t\tif (typeof activeParameter.documentation === 'string') {\n\t\t\t\tdocumentation.textContent = activeParameter.documentation;\n\t\t\t} else {\n\t\t\t\tconst renderedContents = this.renderMarkdownDocs(activeParameter.documentation);\n\t\t\t\tdocumentation.appendChild(renderedContents.element);\n\t\t\t}\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, documentation));\n\t\t}\n\n\t\tif (signature.documentation === undefined) {\n\t\t\t/** no op */\n\t\t} else if (typeof signature.documentation === 'string') {\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, signature.documentation));\n\t\t} else {\n\t\t\tconst renderedContents = this.renderMarkdownDocs(signature.documentation);\n\t\t\tdom.append(this.domNodes.docs, renderedContents.element);\n\t\t}\n\n\t\tconst hasDocs = this.hasDocs(signature, activeParameter);\n\n\t\tthis.domNodes.signature.classList.toggle('has-docs', hasDocs);\n\t\tthis.domNodes.docs.classList.toggle('empty', !hasDocs);\n\n\t\tthis.domNodes.overloads.textContent =\n\t\t\tString(hints.activeSignature + 1).padStart(hints.signatures.length.toString().length, '0') + '/' + hints.signatures.length;\n\n\t\tif (activeParameter) {\n\t\t\tlet labelToAnnounce = '';\n\t\t\tconst param = signature.parameters[activeParameterIndex];\n\t\t\tif (Array.isArray(param.label)) {\n\t\t\t\tlabelToAnnounce = signature.label.substring(param.label[0], param.label[1]);\n\t\t\t} else {\n\t\t\t\tlabelToAnnounce = param.label;\n\t\t\t}\n\t\t\tif (param.documentation) {\n\t\t\t\tlabelToAnnounce += typeof param.documentation === 'string' ? `, ${param.documentation}` : `, ${param.documentation.value}`;\n\t\t\t}\n\t\t\tif (signature.documentation) {\n\t\t\t\tlabelToAnnounce += typeof signature.documentation === 'string' ? `, ${signature.documentation}` : `, ${signature.documentation.value}`;\n\t\t\t}\n\n\t\t\t// Select method gets called on every user type while parameter hints are visible.\n\t\t\t// We do not want to spam the user with same announcements, so we only announce if the current parameter changed.\n\n\t\t\tif (this.announcedLabel !== labelToAnnounce) {\n\t\t\t\taria.alert(nls.localize('hint', \"{0}, hint\", labelToAnnounce));\n\t\t\t\tthis.announcedLabel = labelToAnnounce;\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.layoutContentWidget(this);\n\t\tthis.domNodes.scrollbar.scanDomNode();\n\t}\n\n\tprivate renderMarkdownDocs(markdown: IMarkdownString): IMarkdownRenderResult {\n\t\tconst renderedContents = this.renderDisposeables.add(this.markdownRenderer.render(markdown, {\n\t\t\tasyncRenderCallback: () => {\n\t\t\t\tthis.domNodes?.scrollbar.scanDomNode();\n\t\t\t}\n\t\t}));\n\t\trenderedContents.element.classList.add('markdown-docs');\n\t\treturn renderedContents;\n\t}\n\n\tprivate hasDocs(signature: languages.SignatureInformation, activeParameter: languages.ParameterInformation | undefined): boolean {\n\t\tif (activeParameter && typeof activeParameter.documentation === 'string' && assertReturnsDefined(activeParameter.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (activeParameter && typeof activeParameter.documentation === 'object' && assertReturnsDefined(activeParameter.documentation).value.length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'string' && assertReturnsDefined(signature.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'object' && assertReturnsDefined(signature.documentation.value).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate renderParameters(parent: HTMLElement, signature: languages.SignatureInformation, activeParameterIndex: number): void {\n\t\tconst [start, end] = this.getParameterLabelOffsets(signature, activeParameterIndex);\n\n\t\tconst beforeSpan = document.createElement('span');\n\t\tbeforeSpan.textContent = signature.label.substring(0, start);\n\n\t\tconst paramSpan = document.createElement('span');\n\t\tparamSpan.textContent = signature.label.substring(start, end);\n\t\tparamSpan.className = 'parameter active';\n\n\t\tconst afterSpan = document.createElement('span');\n\t\tafterSpan.textContent = signature.label.substring(end);\n\n\t\tdom.append(parent, beforeSpan, paramSpan, afterSpan);\n\t}\n\n\tprivate getParameterLabelOffsets(signature: languages.SignatureInformation, paramIdx: number): [number, number] {\n\t\tconst param = signature.parameters[paramIdx];\n\t\tif (!param) {\n\t\t\treturn [0, 0];\n\t\t} else if (Array.isArray(param.label)) {\n\t\t\treturn param.label;\n\t\t} else if (!param.label.length) {\n\t\t\treturn [0, 0];\n\t\t} else {\n\t\t\tconst regex = new RegExp(`(\\\\W|^)${escapeRegExpCharacters(param.label)}(?=\\\\W|$)`, 'g');\n\t\t\tregex.test(signature.label);\n\t\t\tconst idx = regex.lastIndex - param.label.length;\n\t\t\treturn idx >= 0\n\t\t\t\t? [idx, regex.lastIndex]\n\t\t\t\t: [0, 0];\n\t\t}\n\t}\n\n\tnext(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.next();\n\t}\n\n\tprevious(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.previous();\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\t\treturn this.domNodes!.element;\n\t}\n\n\tgetId(): string {\n\t\treturn ParameterHintsWidget.ID;\n\t}\n\n\tprivate updateMaxHeight(): void {\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\t\tconst height = Math.max(this.editor.getLayoutInfo().height / 4, 250);\n\t\tconst maxHeight = `${height}px`;\n\t\tthis.domNodes.element.style.maxHeight = maxHeight;\n\t\tconst wrapper = this.domNodes.element.getElementsByClassName('phwrapper') as HTMLCollectionOf<HTMLElement>;\n\t\tif (wrapper.length) {\n\t\t\twrapper[0].style.maxHeight = maxHeight;\n\t\t}\n\t}\n}\n\nregisterColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize('editorHoverWidgetHighlightForeground', 'Foreground color of the active item in the parameter hint.'));\n"]}
|
|
1
|
+
{"version":3,"sources":["vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;AAEhG,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,0CAA0C,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAC;AAGhH,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAe,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAEhB,MAAM,sBAAsB,GAAG,YAAY,CAAC,sBAAsB,EAAE,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAwB,EAAE,oCAAoC,CAAC,CAAC,CA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/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 * as dom from '../../../../base/browser/dom.js';\nimport * as aria from '../../../../base/browser/ui/aria/aria.js';\nimport { DomScrollableElement } from '../../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { Codicon } from '../../../../base/common/codicons.js';\nimport { Event } from '../../../../base/common/event.js';\nimport { IMarkdownString } from '../../../../base/common/htmlContent.js';\nimport { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';\nimport { escapeRegExpCharacters } from '../../../../base/common/strings.js';\nimport { assertReturnsDefined } from '../../../../base/common/types.js';\nimport './parameterHints.css';\nimport { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from '../../../browser/editorBrowser.js';\nimport { EditorOption } from '../../../common/config/editorOptions.js';\nimport { EDITOR_FONT_DEFAULTS } from '../../../common/config/fontInfo.js';\nimport * as languages from '../../../common/languages.js';\nimport { IMarkdownRendererService } from '../../../browser/widget/markdownRenderer/browser/markdownRenderer.js';\nimport { IRenderedMarkdown } from '../../../../base/browser/markdownRenderer.js';\nimport { ParameterHintsModel } from './parameterHintsModel.js';\nimport { Context } from './provideSignatureHelp.js';\nimport * as nls from '../../../../nls.js';\nimport { IContextKey, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';\nimport { listHighlightForeground, registerColor } from '../../../../platform/theme/common/colorRegistry.js';\nimport { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';\nimport { ThemeIcon } from '../../../../base/common/themables.js';\n\nconst $ = dom.$;\n\nconst parameterHintsNextIcon = registerIcon('parameter-hints-next', Codicon.chevronDown, nls.localize('parameterHintsNextIcon', 'Icon for show next parameter hint.'));\nconst parameterHintsPreviousIcon = registerIcon('parameter-hints-previous', Codicon.chevronUp, nls.localize('parameterHintsPreviousIcon', 'Icon for show previous parameter hint.'));\n\nexport class ParameterHintsWidget extends Disposable implements IContentWidget {\n\n\tprivate static readonly ID = 'editor.widget.parameterHintsWidget';\n\n\tprivate readonly renderDisposeables = this._register(new DisposableStore());\n\tprivate readonly keyVisible: IContextKey<boolean>;\n\tprivate readonly keyMultipleSignatures: IContextKey<boolean>;\n\n\tprivate domNodes?: {\n\t\treadonly element: HTMLElement;\n\t\treadonly signature: HTMLElement;\n\t\treadonly docs: HTMLElement;\n\t\treadonly overloads: HTMLElement;\n\t\treadonly scrollbar: DomScrollableElement;\n\t};\n\n\tprivate visible: boolean = false;\n\tprivate announcedLabel: string | null = null;\n\n\t// Editor.IContentWidget.allowEditorOverflow\n\tallowEditorOverflow = true;\n\n\tconstructor(\n\t\tprivate readonly editor: ICodeEditor,\n\t\tprivate readonly model: ParameterHintsModel,\n\t\t@IContextKeyService contextKeyService: IContextKeyService,\n\t\t@IMarkdownRendererService private readonly markdownRendererService: IMarkdownRendererService,\n\t) {\n\t\tsuper();\n\n\t\tthis.keyVisible = Context.Visible.bindTo(contextKeyService);\n\t\tthis.keyMultipleSignatures = Context.MultipleSignatures.bindTo(contextKeyService);\n\t}\n\n\tprivate createParameterHintDOMNodes() {\n\t\tconst element = $('.editor-widget.parameter-hints-widget');\n\t\tconst wrapper = dom.append(element, $('.phwrapper'));\n\t\twrapper.tabIndex = -1;\n\n\t\tconst controls = dom.append(wrapper, $('.controls'));\n\t\tconst previous = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsPreviousIcon)));\n\t\tconst overloads = dom.append(controls, $('.overloads'));\n\t\tconst next = dom.append(controls, $('.button' + ThemeIcon.asCSSSelector(parameterHintsNextIcon)));\n\n\t\tthis._register(dom.addDisposableListener(previous, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.previous();\n\t\t}));\n\n\t\tthis._register(dom.addDisposableListener(next, 'click', e => {\n\t\t\tdom.EventHelper.stop(e);\n\t\t\tthis.next();\n\t\t}));\n\n\t\tconst body = $('.body');\n\t\tconst scrollbar = new DomScrollableElement(body, {\n\t\t\talwaysConsumeMouseWheel: true,\n\t\t});\n\t\tthis._register(scrollbar);\n\t\twrapper.appendChild(scrollbar.getDomNode());\n\n\t\tconst signature = dom.append(body, $('.signature'));\n\t\tconst docs = dom.append(body, $('.docs'));\n\n\t\telement.style.userSelect = 'text';\n\n\t\tthis.domNodes = {\n\t\t\telement,\n\t\t\tsignature,\n\t\t\toverloads,\n\t\t\tdocs,\n\t\t\tscrollbar,\n\t\t};\n\n\t\tthis.editor.addContentWidget(this);\n\t\tthis.hide();\n\n\t\tthis._register(this.editor.onDidChangeCursorSelection(e => {\n\t\t\tif (this.visible) {\n\t\t\t\tthis.editor.layoutContentWidget(this);\n\t\t\t}\n\t\t}));\n\n\t\tconst updateFont = () => {\n\t\t\tif (!this.domNodes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fontInfo = this.editor.getOption(EditorOption.fontInfo);\n\t\t\tconst element = this.domNodes.element;\n\t\t\telement.style.fontSize = `${fontInfo.fontSize}px`;\n\t\t\telement.style.lineHeight = `${fontInfo.lineHeight / fontInfo.fontSize}`;\n\t\t\telement.style.setProperty('--vscode-parameterHintsWidget-editorFontFamily', fontInfo.fontFamily);\n\t\t\telement.style.setProperty('--vscode-parameterHintsWidget-editorFontFamilyDefault', EDITOR_FONT_DEFAULTS.fontFamily);\n\t\t};\n\n\t\tupdateFont();\n\n\t\tthis._register(Event.chain(\n\t\t\tthis.editor.onDidChangeConfiguration.bind(this.editor),\n\t\t\t$ => $.filter(e => e.hasChanged(EditorOption.fontInfo))\n\t\t)(updateFont));\n\n\t\tthis._register(this.editor.onDidLayoutChange(e => this.updateMaxHeight()));\n\t\tthis.updateMaxHeight();\n\t}\n\n\tpublic show(): void {\n\t\tif (this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\n\t\tthis.keyVisible.set(true);\n\t\tthis.visible = true;\n\t\tsetTimeout(() => {\n\t\t\tthis.domNodes?.element.classList.add('visible');\n\t\t}, 100);\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tpublic hide(): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.keyVisible.reset();\n\t\tthis.visible = false;\n\t\tthis.announcedLabel = null;\n\t\tthis.domNodes?.element.classList.remove('visible');\n\t\tthis.editor.layoutContentWidget(this);\n\t}\n\n\tgetPosition(): IContentWidgetPosition | null {\n\t\tif (this.visible) {\n\t\t\treturn {\n\t\t\t\tposition: this.editor.getPosition(),\n\t\t\t\tpreference: [ContentWidgetPositionPreference.ABOVE, ContentWidgetPositionPreference.BELOW]\n\t\t\t};\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic render(hints: languages.SignatureHelp): void {\n\t\tthis.renderDisposeables.clear();\n\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst multiple = hints.signatures.length > 1;\n\t\tthis.domNodes.element.classList.toggle('multiple', multiple);\n\t\tthis.keyMultipleSignatures.set(multiple);\n\n\t\tthis.domNodes.signature.innerText = '';\n\t\tthis.domNodes.docs.innerText = '';\n\n\t\tconst signature = hints.signatures[hints.activeSignature];\n\t\tif (!signature) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst code = dom.append(this.domNodes.signature, $('.code'));\n\t\tconst hasParameters = signature.parameters.length > 0;\n\t\tconst activeParameterIndex = signature.activeParameter ?? hints.activeParameter;\n\n\t\tif (!hasParameters) {\n\t\t\tconst label = dom.append(code, $('span'));\n\t\t\tlabel.textContent = signature.label;\n\t\t} else {\n\t\t\tthis.renderParameters(code, signature, activeParameterIndex);\n\t\t}\n\n\t\tconst activeParameter: languages.ParameterInformation | undefined = signature.parameters[activeParameterIndex];\n\t\tif (activeParameter?.documentation) {\n\t\t\tconst documentation = $('span.documentation');\n\t\t\tif (typeof activeParameter.documentation === 'string') {\n\t\t\t\tdocumentation.textContent = activeParameter.documentation;\n\t\t\t} else {\n\t\t\t\tconst renderedContents = this.renderMarkdownDocs(activeParameter.documentation);\n\t\t\t\tdocumentation.appendChild(renderedContents.element);\n\t\t\t}\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, documentation));\n\t\t}\n\n\t\tif (signature.documentation === undefined) {\n\t\t\t/** no op */\n\t\t} else if (typeof signature.documentation === 'string') {\n\t\t\tdom.append(this.domNodes.docs, $('p', {}, signature.documentation));\n\t\t} else {\n\t\t\tconst renderedContents = this.renderMarkdownDocs(signature.documentation);\n\t\t\tdom.append(this.domNodes.docs, renderedContents.element);\n\t\t}\n\n\t\tconst hasDocs = this.hasDocs(signature, activeParameter);\n\n\t\tthis.domNodes.signature.classList.toggle('has-docs', hasDocs);\n\t\tthis.domNodes.docs.classList.toggle('empty', !hasDocs);\n\n\t\tthis.domNodes.overloads.textContent =\n\t\t\tString(hints.activeSignature + 1).padStart(hints.signatures.length.toString().length, '0') + '/' + hints.signatures.length;\n\n\t\tif (activeParameter) {\n\t\t\tlet labelToAnnounce = '';\n\t\t\tconst param = signature.parameters[activeParameterIndex];\n\t\t\tif (Array.isArray(param.label)) {\n\t\t\t\tlabelToAnnounce = signature.label.substring(param.label[0], param.label[1]);\n\t\t\t} else {\n\t\t\t\tlabelToAnnounce = param.label;\n\t\t\t}\n\t\t\tif (param.documentation) {\n\t\t\t\tlabelToAnnounce += typeof param.documentation === 'string' ? `, ${param.documentation}` : `, ${param.documentation.value}`;\n\t\t\t}\n\t\t\tif (signature.documentation) {\n\t\t\t\tlabelToAnnounce += typeof signature.documentation === 'string' ? `, ${signature.documentation}` : `, ${signature.documentation.value}`;\n\t\t\t}\n\n\t\t\t// Select method gets called on every user type while parameter hints are visible.\n\t\t\t// We do not want to spam the user with same announcements, so we only announce if the current parameter changed.\n\n\t\t\tif (this.announcedLabel !== labelToAnnounce) {\n\t\t\t\taria.alert(nls.localize('hint', \"{0}, hint\", labelToAnnounce));\n\t\t\t\tthis.announcedLabel = labelToAnnounce;\n\t\t\t}\n\t\t}\n\n\t\tthis.editor.layoutContentWidget(this);\n\t\tthis.domNodes.scrollbar.scanDomNode();\n\t}\n\n\tprivate renderMarkdownDocs(markdown: IMarkdownString): IRenderedMarkdown {\n\t\tconst renderedContents = this.renderDisposeables.add(this.markdownRendererService.render(markdown, {\n\t\t\teditor: this.editor,\n\t\t\tasyncRenderCallback: () => {\n\t\t\t\tthis.domNodes?.scrollbar.scanDomNode();\n\t\t\t}\n\t\t}));\n\t\trenderedContents.element.classList.add('markdown-docs');\n\t\treturn renderedContents;\n\t}\n\n\tprivate hasDocs(signature: languages.SignatureInformation, activeParameter: languages.ParameterInformation | undefined): boolean {\n\t\tif (activeParameter && typeof activeParameter.documentation === 'string' && assertReturnsDefined(activeParameter.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (activeParameter && typeof activeParameter.documentation === 'object' && assertReturnsDefined(activeParameter.documentation).value.length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'string' && assertReturnsDefined(signature.documentation).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (signature.documentation && typeof signature.documentation === 'object' && assertReturnsDefined(signature.documentation.value).length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate renderParameters(parent: HTMLElement, signature: languages.SignatureInformation, activeParameterIndex: number): void {\n\t\tconst [start, end] = this.getParameterLabelOffsets(signature, activeParameterIndex);\n\n\t\tconst beforeSpan = document.createElement('span');\n\t\tbeforeSpan.textContent = signature.label.substring(0, start);\n\n\t\tconst paramSpan = document.createElement('span');\n\t\tparamSpan.textContent = signature.label.substring(start, end);\n\t\tparamSpan.className = 'parameter active';\n\n\t\tconst afterSpan = document.createElement('span');\n\t\tafterSpan.textContent = signature.label.substring(end);\n\n\t\tdom.append(parent, beforeSpan, paramSpan, afterSpan);\n\t}\n\n\tprivate getParameterLabelOffsets(signature: languages.SignatureInformation, paramIdx: number): [number, number] {\n\t\tconst param = signature.parameters[paramIdx];\n\t\tif (!param) {\n\t\t\treturn [0, 0];\n\t\t} else if (Array.isArray(param.label)) {\n\t\t\treturn param.label;\n\t\t} else if (!param.label.length) {\n\t\t\treturn [0, 0];\n\t\t} else {\n\t\t\tconst regex = new RegExp(`(\\\\W|^)${escapeRegExpCharacters(param.label)}(?=\\\\W|$)`, 'g');\n\t\t\tregex.test(signature.label);\n\t\t\tconst idx = regex.lastIndex - param.label.length;\n\t\t\treturn idx >= 0\n\t\t\t\t? [idx, regex.lastIndex]\n\t\t\t\t: [0, 0];\n\t\t}\n\t}\n\n\tnext(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.next();\n\t}\n\n\tprevious(): void {\n\t\tthis.editor.focus();\n\t\tthis.model.previous();\n\t}\n\n\tgetDomNode(): HTMLElement {\n\t\tif (!this.domNodes) {\n\t\t\tthis.createParameterHintDOMNodes();\n\t\t}\n\t\treturn this.domNodes!.element;\n\t}\n\n\tgetId(): string {\n\t\treturn ParameterHintsWidget.ID;\n\t}\n\n\tprivate updateMaxHeight(): void {\n\t\tif (!this.domNodes) {\n\t\t\treturn;\n\t\t}\n\t\tconst height = Math.max(this.editor.getLayoutInfo().height / 4, 250);\n\t\tconst maxHeight = `${height}px`;\n\t\tthis.domNodes.element.style.maxHeight = maxHeight;\n\t\tconst wrapper = this.domNodes.element.getElementsByClassName('phwrapper') as HTMLCollectionOf<HTMLElement>;\n\t\tif (wrapper.length) {\n\t\t\twrapper[0].style.maxHeight = maxHeight;\n\t\t}\n\t}\n}\n\nregisterColor('editorHoverWidget.highlightForeground', listHighlightForeground, nls.localize('editorHoverWidgetHighlightForeground', 'Foreground color of the active item in the parameter hint.'));\n"]}
|
|
@@ -53,7 +53,7 @@ registerSingleton(IPeekViewService, class {
|
|
|
53
53
|
}, 1 /* InstantiationType.Delayed */);
|
|
54
54
|
export var PeekContext;
|
|
55
55
|
(function (PeekContext) {
|
|
56
|
-
PeekContext.inPeekEditor = new RawContextKey('inReferenceSearchEditor', true, nls.localize(
|
|
56
|
+
PeekContext.inPeekEditor = new RawContextKey('inReferenceSearchEditor', true, nls.localize(1307, "Whether the current code editor is embedded inside peek"));
|
|
57
57
|
PeekContext.notInPeekEditor = PeekContext.inPeekEditor.toNegated();
|
|
58
58
|
})(PeekContext || (PeekContext = {}));
|
|
59
59
|
let PeekContextController = class PeekContextController {
|
|
@@ -149,7 +149,7 @@ let PeekViewWidget = class PeekViewWidget extends ZoneWidget {
|
|
|
149
149
|
this._actionbarWidget = new ActionBar(actionsContainer, actionBarOptions);
|
|
150
150
|
this._disposables.add(this._actionbarWidget);
|
|
151
151
|
if (!noCloseAction) {
|
|
152
|
-
this._actionbarWidget.push(this._disposables.add(new Action('peekview.close', nls.localize(
|
|
152
|
+
this._actionbarWidget.push(this._disposables.add(new Action('peekview.close', nls.localize(1308, "Close"), ThemeIcon.asClassName(Codicon.close), true, () => {
|
|
153
153
|
this.dispose();
|
|
154
154
|
return Promise.resolve();
|
|
155
155
|
})), { label: false, icon: true });
|
|
@@ -216,20 +216,20 @@ PeekViewWidget = __decorate([
|
|
|
216
216
|
__param(2, IInstantiationService)
|
|
217
217
|
], PeekViewWidget);
|
|
218
218
|
export { PeekViewWidget };
|
|
219
|
-
export const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
220
|
-
export const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: Color.white, light: Color.black, hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
221
|
-
export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161', hcDark: '#FFFFFF99', hcLight: '#292929' }, nls.localize(
|
|
222
|
-
export const peekViewBorder = registerColor('peekView.border', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(
|
|
223
|
-
export const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
224
|
-
export const peekViewResultsMatchForeground = registerColor('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
225
|
-
export const peekViewResultsFileForeground = registerColor('peekViewResult.fileForeground', { dark: Color.white, light: '#1E1E1E', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
226
|
-
export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hcDark: null, hcLight: null }, nls.localize(
|
|
227
|
-
export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hcDark: Color.white, hcLight: editorForeground }, nls.localize(
|
|
228
|
-
export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hcDark: Color.black, hcLight: Color.white }, nls.localize(
|
|
229
|
-
export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', peekViewEditorBackground, nls.localize(
|
|
230
|
-
export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', peekViewEditorBackground, nls.localize(
|
|
231
|
-
export const peekViewEditorStickyScrollGutterBackground = registerColor('peekViewEditorStickyScrollGutter.background', peekViewEditorBackground, nls.localize(
|
|
232
|
-
export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hcDark: null, hcLight: null }, nls.localize(
|
|
233
|
-
export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hcDark: null, hcLight: null }, nls.localize(
|
|
234
|
-
export const peekViewEditorMatchHighlightBorder = registerColor('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(
|
|
219
|
+
export const peekViewTitleBackground = registerColor('peekViewTitle.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(1309, 'Background color of the peek view title area.'));
|
|
220
|
+
export const peekViewTitleForeground = registerColor('peekViewTitleLabel.foreground', { dark: Color.white, light: Color.black, hcDark: Color.white, hcLight: editorForeground }, nls.localize(1310, 'Color of the peek view title.'));
|
|
221
|
+
export const peekViewTitleInfoForeground = registerColor('peekViewTitleDescription.foreground', { dark: '#ccccccb3', light: '#616161', hcDark: '#FFFFFF99', hcLight: '#292929' }, nls.localize(1311, 'Color of the peek view title info.'));
|
|
222
|
+
export const peekViewBorder = registerColor('peekView.border', { dark: editorInfoForeground, light: editorInfoForeground, hcDark: contrastBorder, hcLight: contrastBorder }, nls.localize(1312, 'Color of the peek view borders and arrow.'));
|
|
223
|
+
export const peekViewResultsBackground = registerColor('peekViewResult.background', { dark: '#252526', light: '#F3F3F3', hcDark: Color.black, hcLight: Color.white }, nls.localize(1313, 'Background color of the peek view result list.'));
|
|
224
|
+
export const peekViewResultsMatchForeground = registerColor('peekViewResult.lineForeground', { dark: '#bbbbbb', light: '#646465', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1314, 'Foreground color for line nodes in the peek view result list.'));
|
|
225
|
+
export const peekViewResultsFileForeground = registerColor('peekViewResult.fileForeground', { dark: Color.white, light: '#1E1E1E', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1315, 'Foreground color for file nodes in the peek view result list.'));
|
|
226
|
+
export const peekViewResultsSelectionBackground = registerColor('peekViewResult.selectionBackground', { dark: '#3399ff33', light: '#3399ff33', hcDark: null, hcLight: null }, nls.localize(1316, 'Background color of the selected entry in the peek view result list.'));
|
|
227
|
+
export const peekViewResultsSelectionForeground = registerColor('peekViewResult.selectionForeground', { dark: Color.white, light: '#6C6C6C', hcDark: Color.white, hcLight: editorForeground }, nls.localize(1317, 'Foreground color of the selected entry in the peek view result list.'));
|
|
228
|
+
export const peekViewEditorBackground = registerColor('peekViewEditor.background', { dark: '#001F33', light: '#F2F8FC', hcDark: Color.black, hcLight: Color.white }, nls.localize(1318, 'Background color of the peek view editor.'));
|
|
229
|
+
export const peekViewEditorGutterBackground = registerColor('peekViewEditorGutter.background', peekViewEditorBackground, nls.localize(1319, 'Background color of the gutter in the peek view editor.'));
|
|
230
|
+
export const peekViewEditorStickyScrollBackground = registerColor('peekViewEditorStickyScroll.background', peekViewEditorBackground, nls.localize(1320, 'Background color of sticky scroll in the peek view editor.'));
|
|
231
|
+
export const peekViewEditorStickyScrollGutterBackground = registerColor('peekViewEditorStickyScrollGutter.background', peekViewEditorBackground, nls.localize(1321, 'Background color of the gutter part of sticky scroll in the peek view editor.'));
|
|
232
|
+
export const peekViewResultsMatchHighlight = registerColor('peekViewResult.matchHighlightBackground', { dark: '#ea5c004d', light: '#ea5c004d', hcDark: null, hcLight: null }, nls.localize(1322, 'Match highlight color in the peek view result list.'));
|
|
233
|
+
export const peekViewEditorMatchHighlight = registerColor('peekViewEditor.matchHighlightBackground', { dark: '#ff8f0099', light: '#f5d802de', hcDark: null, hcLight: null }, nls.localize(1323, 'Match highlight color in the peek view editor.'));
|
|
234
|
+
export const peekViewEditorMatchHighlightBorder = registerColor('peekViewEditor.matchHighlightBorder', { dark: null, light: null, hcDark: activeContrastBorder, hcLight: activeContrastBorder }, nls.localize(1324, 'Match highlight border in the peek view editor.'));
|
|
235
235
|
//# sourceMappingURL=peekView.js.map
|
|
@@ -10,5 +10,5 @@ import { registerColor } from '../../../../platform/theme/common/colorUtils.js';
|
|
|
10
10
|
import { PlaceholderTextContribution } from './placeholderTextContribution.js';
|
|
11
11
|
import { wrapInReloadableClass1 } from '../../../../platform/observable/common/wrapInReloadableClass.js';
|
|
12
12
|
registerEditorContribution(PlaceholderTextContribution.ID, wrapInReloadableClass1(() => PlaceholderTextContribution), 0 /* EditorContributionInstantiation.Eager */);
|
|
13
|
-
registerColor('editor.placeholder.foreground', ghostTextForeground, localize(
|
|
13
|
+
registerColor('editor.placeholder.foreground', ghostTextForeground, localize(1325, 'Foreground color of the placeholder text in the editor.'));
|
|
14
14
|
//# sourceMappingURL=placeholderText.contribution.js.map
|
|
@@ -12,7 +12,7 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
12
12
|
super({ canAcceptInBackground: true });
|
|
13
13
|
}
|
|
14
14
|
provideWithoutTextEditor(picker) {
|
|
15
|
-
const label = localize(
|
|
15
|
+
const label = localize(1326, "Open a text editor first to go to a line.");
|
|
16
16
|
picker.items = [{ label }];
|
|
17
17
|
picker.ariaLabel = label;
|
|
18
18
|
return Disposable.None;
|
|
@@ -91,17 +91,17 @@ export class AbstractGotoLineQuickAccessProvider extends AbstractEditorNavigatio
|
|
|
91
91
|
// Location valid: indicate this as picker label
|
|
92
92
|
if (this.isValidLineNumber(editor, lineNumber)) {
|
|
93
93
|
if (this.isValidColumn(editor, lineNumber, column)) {
|
|
94
|
-
return localize(
|
|
94
|
+
return localize(1327, "Go to line {0} and character {1}.", lineNumber, column);
|
|
95
95
|
}
|
|
96
|
-
return localize(
|
|
96
|
+
return localize(1328, "Go to line {0}.", lineNumber);
|
|
97
97
|
}
|
|
98
98
|
// Location invalid: show generic label
|
|
99
99
|
const position = editor.getPosition() || { lineNumber: 1, column: 1 };
|
|
100
100
|
const lineCount = this.lineCount(editor);
|
|
101
101
|
if (lineCount > 1) {
|
|
102
|
-
return localize(
|
|
102
|
+
return localize(1329, "Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.", position.lineNumber, position.column, lineCount);
|
|
103
103
|
}
|
|
104
|
-
return localize(
|
|
104
|
+
return localize(1330, "Current Line: {0}, Character: {1}. Type a line number to navigate to.", position.lineNumber, position.column);
|
|
105
105
|
}
|
|
106
106
|
isValidLineNumber(editor, lineNumber) {
|
|
107
107
|
if (!lineNumber || typeof lineNumber !== 'number') {
|