@adecore/editor-react 0.62.1 → 0.63.0
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/README.md +2 -2
- package/dist/AnchoredPopup.d.ts +2 -1
- package/dist/CompletionPopup.js +0 -2
- package/dist/DiffView.d.ts +1 -28
- package/dist/EditorView.js +0 -1
- package/dist/HoverSections.d.ts +1 -8
- package/dist/HoverSections.js +2 -2
- package/dist/LanguagePopups.js +30 -14
- package/dist/PanelResizeHandle.js +0 -1
- package/dist/PeekPanel.js +0 -1
- package/dist/PickPopup.js +0 -1
- package/dist/RenderedDocs.js +0 -2
- package/dist/SplitDiffView.d.ts +1 -1
- package/dist/SymbolPicker.js +0 -1
- package/dist/call-hierarchy-model.js +0 -4
- package/dist/call-hierarchy.d.ts +9 -2
- package/dist/call-hierarchy.js +51 -67
- package/dist/clipboard-history.d.ts +3 -0
- package/dist/clipboard-history.js +0 -1
- package/dist/code-actions-model.js +1 -1
- package/dist/code-actions.d.ts +14 -2
- package/dist/code-actions.js +14 -9
- package/dist/code-authors.js +4 -12
- package/dist/code-vision-model.d.ts +0 -1
- package/dist/code-vision-model.js +1 -2
- package/dist/code-vision.d.ts +11 -3
- package/dist/code-vision.js +13 -18
- package/dist/completion-call.d.ts +1 -1
- package/dist/completion-call.js +2 -1
- package/dist/completion-model.d.ts +5 -4
- package/dist/completion-model.js +4 -4
- package/dist/completion.d.ts +13 -4
- package/dist/completion.js +19 -18
- package/dist/context-menu-rows.d.ts +2 -1
- package/dist/context-menu.d.ts +9 -3
- package/dist/context-menu.js +17 -19
- package/dist/definition-link.d.ts +8 -2
- package/dist/definition-link.js +4 -2
- package/dist/diagnostics-model.d.ts +6 -8
- package/dist/diagnostics-model.js +1 -54
- package/dist/diagnostics.d.ts +9 -7
- package/dist/diagnostics.js +6 -4
- package/dist/diff-view-props.d.ts +28 -0
- package/dist/diff-view-props.js +1 -0
- package/dist/doc-comment-model.js +0 -2
- package/dist/document-colors.d.ts +9 -4
- package/dist/document-colors.js +7 -4
- package/dist/document-links.d.ts +2 -3
- package/dist/document-links.js +2 -3
- package/dist/document-query.d.ts +2 -2
- package/dist/edit-locations.js +4 -22
- package/dist/editor-language.d.ts +12 -7
- package/dist/editor-language.js +54 -45
- package/dist/emmet.d.ts +3 -2
- package/dist/folding.d.ts +2 -4
- package/dist/folding.js +1 -2
- package/dist/format-on-type.d.ts +8 -2
- package/dist/format-on-type.js +8 -6
- package/dist/highlights.d.ts +2 -6
- package/dist/highlights.js +3 -3
- package/dist/history.d.ts +8 -2
- package/dist/history.js +4 -2
- package/dist/host-types.d.ts +39 -22
- package/dist/hover-content.js +0 -1
- package/dist/hover.d.ts +13 -2
- package/dist/hover.js +25 -28
- package/dist/index.d.ts +19 -9
- package/dist/index.js +5 -2
- package/dist/inlay-hints.d.ts +12 -21
- package/dist/inlay-hints.js +16 -15
- package/dist/inline-completion.d.ts +30 -10
- package/dist/inline-completion.js +346 -102
- package/dist/key-priority.d.ts +1 -1
- package/dist/key-priority.js +2 -2
- package/dist/language-context.d.ts +30 -0
- package/dist/language-context.js +1 -0
- package/dist/language-ids.d.ts +0 -1
- package/dist/language-ids.js +0 -32
- package/dist/line-text.js +0 -1
- package/dist/linked-editing.d.ts +2 -4
- package/dist/linked-editing.js +1 -3
- package/dist/live-templates.d.ts +14 -2
- package/dist/live-templates.js +15 -10
- package/dist/locales/en.d.ts +357 -0
- package/dist/locales/en.js +356 -0
- package/dist/locales/nl.d.ts +357 -0
- package/dist/locales/nl.js +356 -0
- package/dist/markup-context.d.ts +7 -6
- package/dist/markup-context.js +0 -1
- package/dist/markup.d.ts +8 -2
- package/dist/markup.js +19 -20
- package/dist/models.d.ts +2 -1
- package/dist/models.js +2 -1
- package/dist/navigation-history.d.ts +7 -0
- package/dist/navigation.d.ts +11 -8
- package/dist/navigation.js +9 -20
- package/dist/panel-size.d.ts +4 -0
- package/dist/paste-history.d.ts +8 -2
- package/dist/paste-history.js +4 -2
- package/dist/patch-layout.d.ts +0 -4
- package/dist/patch-layout.js +1 -1
- package/dist/peek-model.js +0 -1
- package/dist/peek.d.ts +8 -2
- package/dist/peek.js +31 -42
- package/dist/pick.d.ts +4 -2
- package/dist/pick.js +38 -15
- package/dist/popups.d.ts +25 -20
- package/dist/popups.js +31 -15
- package/dist/positions.d.ts +7 -0
- package/dist/positions.js +54 -0
- package/dist/postfix.d.ts +11 -2
- package/dist/postfix.js +10 -6
- package/dist/project-language.d.ts +11 -3
- package/dist/project-language.js +40 -9
- package/dist/project-problems.d.ts +7 -1
- package/dist/project-problems.js +2 -1
- package/dist/rename-model.js +1 -1
- package/dist/rename.d.ts +2 -2
- package/dist/rename.js +17 -22
- package/dist/rendered-docs.d.ts +8 -2
- package/dist/rendered-docs.js +5 -4
- package/dist/selection-ranges.d.ts +2 -2
- package/dist/semantic-tokens.d.ts +2 -4
- package/dist/semantic-tokens.js +2 -2
- package/dist/shortcut-keys.d.ts +2 -1
- package/dist/signature.d.ts +2 -2
- package/dist/signature.js +9 -15
- package/dist/snippet-field-transforms.js +1 -1
- package/dist/snippet-insert.d.ts +4 -2
- package/dist/snippet-insert.js +9 -15
- package/dist/snippet-session.d.ts +9 -4
- package/dist/snippet-session.js +14 -14
- package/dist/snippet-transform-format.d.ts +2 -1
- package/dist/snippet-transform-queue.d.ts +2 -4
- package/dist/snippet-transform-queue.js +5 -37
- package/dist/snippet.d.ts +2 -1
- package/dist/surround-constructs.d.ts +1 -1
- package/dist/surround.d.ts +13 -2
- package/dist/surround.js +15 -8
- package/dist/symbol-links.d.ts +0 -1
- package/dist/symbol-links.js +1 -1
- package/dist/symbol-picker-model.d.ts +0 -1
- package/dist/symbol-picker-model.js +1 -2
- package/dist/symbol-picker.d.ts +2 -2
- package/dist/symbol-picker.js +5 -10
- package/dist/symbols.d.ts +4 -3
- package/dist/template-builtins.d.ts +1 -1
- package/dist/template-builtins.js +0 -1
- package/dist/template-context.d.ts +3 -3
- package/dist/template-context.js +2 -11
- package/dist/template-types.d.ts +20 -0
- package/dist/template-types.js +1 -0
- package/dist/templates.d.ts +5 -20
- package/dist/templates.js +0 -1
- package/dist/testing.d.ts +6 -0
- package/dist/testing.js +42 -0
- package/dist/use-problem-counts.d.ts +1 -1
- package/dist/word-diff.d.ts +1 -1
- package/dist/word-diff.js +16 -25
- package/dist/workspace-edit.d.ts +1 -24
- package/dist/workspace-edit.js +0 -1
- package/package.json +10 -9
- package/src/AnchoredPopup.tsx +1 -1
- package/src/CompletionPopup.tsx +0 -2
- package/src/DiffView.tsx +6 -38
- package/src/EditorView.tsx +0 -1
- package/src/HoverSections.tsx +2 -2
- package/src/LanguagePopups.tsx +20 -14
- package/src/PanelResizeHandle.tsx +0 -1
- package/src/PeekPanel.tsx +0 -1
- package/src/PickPopup.tsx +0 -1
- package/src/RenderedDocs.tsx +0 -2
- package/src/SplitDiffView.tsx +1 -1
- package/src/SymbolPicker.tsx +0 -1
- package/src/call-hierarchy-model.ts +0 -7
- package/src/call-hierarchy.ts +32 -31
- package/src/clipboard-history.ts +5 -2
- package/src/code-actions-model.ts +1 -4
- package/src/code-actions.ts +26 -10
- package/src/code-authors.ts +4 -15
- package/src/code-vision-model.ts +1 -2
- package/src/code-vision.ts +23 -19
- package/src/completion-call.ts +2 -2
- package/src/completion-model.ts +12 -7
- package/src/completion.ts +31 -16
- package/src/context-menu-rows.ts +1 -1
- package/src/context-menu.ts +19 -10
- package/src/definition-link.ts +12 -4
- package/src/diagnostics-model.ts +8 -55
- package/src/diagnostics.ts +11 -20
- package/src/diff-view-props.ts +38 -0
- package/src/doc-comment-model.ts +0 -2
- package/src/document-colors.ts +14 -6
- package/src/document-links.ts +5 -6
- package/src/document-query.ts +3 -3
- package/src/edit-locations.ts +4 -19
- package/src/editor-language.ts +74 -39
- package/src/emmet.ts +2 -3
- package/src/folding.ts +4 -5
- package/src/format-on-type.ts +14 -7
- package/src/highlights.ts +6 -6
- package/src/history.ts +12 -4
- package/src/host-types.ts +52 -33
- package/src/hover-content.ts +0 -1
- package/src/hover.ts +29 -22
- package/src/index.ts +25 -14
- package/src/inlay-hints.ts +23 -17
- package/src/inline-completion.ts +340 -90
- package/src/key-priority.ts +2 -2
- package/src/language-context.ts +60 -0
- package/src/language-ids.ts +0 -34
- package/src/line-text.ts +0 -1
- package/src/linked-editing.ts +4 -6
- package/src/live-templates.ts +27 -13
- package/src/locales/en.ts +356 -0
- package/src/locales/nl.ts +356 -0
- package/src/markup-context.ts +6 -9
- package/src/markup.ts +19 -10
- package/src/models.ts +2 -1
- package/src/navigation-history.ts +11 -0
- package/src/navigation.ts +18 -20
- package/src/panel-size.ts +8 -0
- package/src/paste-history.ts +12 -4
- package/src/patch-layout.ts +1 -1
- package/src/peek-model.ts +0 -1
- package/src/peek.ts +22 -18
- package/src/pick.ts +30 -16
- package/src/popups.ts +61 -40
- package/src/positions.ts +54 -0
- package/src/postfix.ts +21 -8
- package/src/project-language.ts +63 -14
- package/src/project-problems.ts +10 -2
- package/src/proposal-model.ts +0 -1
- package/src/rename-model.ts +1 -1
- package/src/rename.ts +21 -24
- package/src/rendered-docs.ts +13 -6
- package/src/selection-ranges.ts +2 -2
- package/src/semantic-tokens.ts +5 -5
- package/src/shortcut-keys.ts +1 -1
- package/src/signature.ts +8 -8
- package/src/snippet-field-transforms.ts +1 -1
- package/src/snippet-insert.ts +21 -14
- package/src/snippet-session.ts +25 -24
- package/src/snippet-transform-format.ts +1 -1
- package/src/snippet-transform-queue.ts +5 -51
- package/src/snippet.ts +1 -1
- package/src/surround-constructs.ts +1 -1
- package/src/surround.ts +24 -12
- package/src/symbol-links.ts +1 -1
- package/src/symbol-picker-model.ts +1 -4
- package/src/symbol-picker.ts +6 -7
- package/src/symbols.ts +3 -4
- package/src/template-builtins.ts +1 -2
- package/src/template-context.ts +5 -14
- package/src/template-types.ts +43 -0
- package/src/templates.ts +9 -45
- package/src/testing.ts +52 -0
- package/src/use-problem-counts.ts +1 -1
- package/src/word-diff.ts +17 -28
- package/src/workspace-edit.ts +1 -34
- package/dist/locales/en.json +0 -356
- package/dist/locales/nl.json +0 -356
- package/src/locales/en.json +0 -356
- package/src/locales/nl.json +0 -356
package/src/language-ids.ts
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
/* Highlighter ids mapped to the LSP id of the same language. */
|
|
2
|
-
const LSP_IDS: Record<string, string> = {
|
|
3
|
-
typescript: 'typescript',
|
|
4
|
-
tsx: 'typescriptreact',
|
|
5
|
-
javascript: 'javascript',
|
|
6
|
-
jsx: 'javascriptreact',
|
|
7
|
-
vue: 'vue',
|
|
8
|
-
php: 'php',
|
|
9
|
-
css: 'css',
|
|
10
|
-
scss: 'scss',
|
|
11
|
-
less: 'less',
|
|
12
|
-
html: 'html',
|
|
13
|
-
json: 'json',
|
|
14
|
-
jsonc: 'jsonc',
|
|
15
|
-
yaml: 'yaml',
|
|
16
|
-
python: 'python',
|
|
17
|
-
shellscript: 'shellscript',
|
|
18
|
-
docker: 'dockerfile',
|
|
19
|
-
twig: 'twig',
|
|
20
|
-
sql: 'sql',
|
|
21
|
-
rust: 'rust',
|
|
22
|
-
markdown: 'markdown',
|
|
23
|
-
toml: 'toml',
|
|
24
|
-
lua: 'lua',
|
|
25
|
-
go: 'go',
|
|
26
|
-
swift: 'swift',
|
|
27
|
-
zig: 'zig'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/* The LSP language id of a file, or null when no language server here knows its language. */
|
|
31
|
-
export function lspLanguageIdOf(language: string | undefined): string | null {
|
|
32
|
-
return language === undefined ? null : (LSP_IDS[language] ?? null);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
1
|
const SHIKI_IDS: Record<string, string> = { typescriptreact: 'tsx', javascriptreact: 'jsx' };
|
|
36
2
|
|
|
37
3
|
/* The highlighter id of an LSP language id, for code a server sends back to be drawn. */
|
package/src/line-text.ts
CHANGED
|
@@ -4,7 +4,6 @@ export function lineTextOf(editor: Editor, line: number): string {
|
|
|
4
4
|
return editor.textInRange({ start: { line, character: 0 }, end: { line, character: Number.MAX_SAFE_INTEGER } });
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
/* The text of a position's line up to the position. */
|
|
8
7
|
export function textBeforeOf(editor: Editor, position: EditorPosition): string {
|
|
9
8
|
return editor.textInRange({ start: { line: position.line, character: 0 }, end: position });
|
|
10
9
|
}
|
package/src/linked-editing.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { EditorTextChange } from '@adecore/editor';
|
|
2
2
|
import type { LinkedEditingRanges } from '@adecore/lsp';
|
|
3
|
-
import type {
|
|
3
|
+
import type { LanguageContext } from './language-context.ts';
|
|
4
4
|
import { realTimers, type Timers } from './timers.ts';
|
|
5
5
|
|
|
6
6
|
const METHOD = 'textDocument/linkedEditingRange';
|
|
7
|
-
/* How long the caret rests before the ranges around it are asked. */
|
|
8
7
|
const DELAY_MS = 100;
|
|
9
8
|
|
|
10
9
|
interface Span {
|
|
@@ -19,7 +18,7 @@ interface Session {
|
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
/* The server's word pattern, anchored, or null when it gave none or one that does not compile. */
|
|
22
|
-
|
|
21
|
+
function wordPatternOf(ranges: LinkedEditingRanges): RegExp | null {
|
|
23
22
|
if (ranges.wordPattern === undefined) {
|
|
24
23
|
return null;
|
|
25
24
|
}
|
|
@@ -37,7 +36,7 @@ export function wordPatternOf(ranges: LinkedEditingRanges): RegExp | null {
|
|
|
37
36
|
* than one caret.
|
|
38
37
|
*/
|
|
39
38
|
export class LinkedEditingFeature {
|
|
40
|
-
private readonly language:
|
|
39
|
+
private readonly language: LanguageContext;
|
|
41
40
|
private readonly timers: Timers;
|
|
42
41
|
private session: Session | null = null;
|
|
43
42
|
private timer: unknown = null;
|
|
@@ -46,7 +45,7 @@ export class LinkedEditingFeature {
|
|
|
46
45
|
private mirroring = false;
|
|
47
46
|
private enabled = true;
|
|
48
47
|
|
|
49
|
-
constructor(language:
|
|
48
|
+
constructor(language: LanguageContext, timers: Timers = realTimers) {
|
|
50
49
|
this.language = language;
|
|
51
50
|
this.timers = timers;
|
|
52
51
|
const { editor } = language;
|
|
@@ -64,7 +63,6 @@ export class LinkedEditingFeature {
|
|
|
64
63
|
return this.enabled && service.linkedEditingRanges !== undefined && service.supports(METHOD, this.language.uri);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
/* Whether ranges are linked now. */
|
|
68
66
|
get isActive(): boolean {
|
|
69
67
|
return this.session !== null;
|
|
70
68
|
}
|
package/src/live-templates.ts
CHANGED
|
@@ -2,16 +2,19 @@ import type { EditorPosition, EditorRange } from '@adecore/editor';
|
|
|
2
2
|
import type { CompletionItem } from '@adecore/lsp';
|
|
3
3
|
import { identifierPrefix, isIdentifierCharacter } from './completion-model.ts';
|
|
4
4
|
import type { LocalCompletionItem } from './completion.ts';
|
|
5
|
-
import {
|
|
6
|
-
import type { EditorLanguage } from './editor-language.ts';
|
|
5
|
+
import type { CompletionFeature } from './completion.ts';
|
|
7
6
|
import { KEY_PRIORITY } from './key-priority.ts';
|
|
7
|
+
import type { LanguageContext } from './language-context.ts';
|
|
8
8
|
import { textBeforeOf } from './line-text.ts';
|
|
9
|
+
import type { MarkupFeature } from './markup.ts';
|
|
10
|
+
import type { PickFeature } from './pick.ts';
|
|
11
|
+
import { comparePositions } from './positions.ts';
|
|
9
12
|
import { PostfixFeature } from './postfix.ts';
|
|
10
13
|
import { isShortcut } from './shortcut-keys.ts';
|
|
11
|
-
import { bodyWithIndentUnit, dedentLines, indentUnitOf, insertSnippet, type SnippetPlacement } from './snippet-insert.ts';
|
|
14
|
+
import { bodyWithIndentUnit, dedentLines, indentUnitOf, insertSnippet, type InsertingSnippets, type SnippetPlacement } from './snippet-insert.ts';
|
|
12
15
|
import { escapeSnippetText } from './snippet.ts';
|
|
13
16
|
import { SNIPPET_KIND, sortAfterServer, templateApplies, templateContextAt, type TemplateContext } from './template-context.ts';
|
|
14
|
-
import type { LiveTemplate } from './
|
|
17
|
+
import type { LiveTemplate } from './template-types.ts';
|
|
15
18
|
|
|
16
19
|
const TOAST_ID = 'language-templates';
|
|
17
20
|
const IDENTIFIER_START = /[\p{L}_$]/u;
|
|
@@ -28,7 +31,6 @@ interface CustomKey {
|
|
|
28
31
|
readonly expand: (() => boolean) | null;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
/* Sorts the rows of a list of templates by group, then key. */
|
|
32
34
|
function grouped(template: LiveTemplate): string {
|
|
33
35
|
return `${template.group ?? template.languages[0]}\u0000${template.key}`;
|
|
34
36
|
}
|
|
@@ -49,6 +51,14 @@ function prefixLength(key: string, before: string): number {
|
|
|
49
51
|
return 0;
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
/* The sibling features TemplatesFeature drives, which the editor language hands over. */
|
|
55
|
+
interface TemplatesPeers {
|
|
56
|
+
readonly completion: Pick<CompletionFeature, 'addSource' | 'close' | 'showItems'>;
|
|
57
|
+
readonly markup: Pick<MarkupFeature, 'abbreviationAt'>;
|
|
58
|
+
readonly pick: Pick<PickFeature, 'open'>;
|
|
59
|
+
readonly snippets: InsertingSnippets;
|
|
60
|
+
}
|
|
61
|
+
|
|
52
62
|
/*
|
|
53
63
|
* Live templates: a key typed before the caret and Tab expands a snippet, Insert Live Template lists the ones that
|
|
54
64
|
* apply, and Save as Live Template hands a selection to the host. The templates come from the registry of the
|
|
@@ -56,12 +66,14 @@ function prefixLength(key: string, before: string): number {
|
|
|
56
66
|
* wins over it, as in IntelliJ.
|
|
57
67
|
*/
|
|
58
68
|
export class TemplatesFeature {
|
|
59
|
-
private readonly language:
|
|
69
|
+
private readonly language: LanguageContext;
|
|
70
|
+
private readonly peers: TemplatesPeers;
|
|
60
71
|
private readonly postfix: PostfixFeature;
|
|
61
72
|
|
|
62
|
-
constructor(language:
|
|
73
|
+
constructor(language: LanguageContext, peers: TemplatesPeers) {
|
|
63
74
|
this.language = language;
|
|
64
|
-
this.
|
|
75
|
+
this.peers = peers;
|
|
76
|
+
this.postfix = new PostfixFeature(language, peers);
|
|
65
77
|
|
|
66
78
|
language.onDispose(
|
|
67
79
|
language.onKey((event) => {
|
|
@@ -85,7 +97,7 @@ export class TemplatesFeature {
|
|
|
85
97
|
}, KEY_PRIORITY.templates)
|
|
86
98
|
);
|
|
87
99
|
|
|
88
|
-
language.onDispose(
|
|
100
|
+
language.onDispose(peers.completion.addSource({ items: (request) => [...this.rows(request.position), ...this.postfix.rows(request.position)] }));
|
|
89
101
|
}
|
|
90
102
|
|
|
91
103
|
/*
|
|
@@ -93,7 +105,8 @@ export class TemplatesFeature {
|
|
|
93
105
|
* nothing to expand, and where the key is an Emmet abbreviation, which the markup feature expands on the same Tab.
|
|
94
106
|
*/
|
|
95
107
|
expand(): boolean {
|
|
96
|
-
const { editor
|
|
108
|
+
const { editor } = this.language;
|
|
109
|
+
const { completion } = this.peers;
|
|
97
110
|
const selections = editor.getSelections();
|
|
98
111
|
|
|
99
112
|
if (editor.isReadOnly?.() === true || selections.some((selection) => comparePositions(selection.start, selection.end) !== 0)) {
|
|
@@ -131,7 +144,8 @@ export class TemplatesFeature {
|
|
|
131
144
|
|
|
132
145
|
/* Lists the templates that apply, only the ones whose key or description fits the word before the caret when some do. */
|
|
133
146
|
insert(): void {
|
|
134
|
-
const { editor,
|
|
147
|
+
const { editor, project } = this.language;
|
|
148
|
+
const { completion } = this.peers;
|
|
135
149
|
|
|
136
150
|
if (editor.isReadOnly?.() === true) {
|
|
137
151
|
return;
|
|
@@ -200,7 +214,7 @@ export class TemplatesFeature {
|
|
|
200
214
|
|
|
201
215
|
/* The keys that compete with a live template for Tab: an Emmet abbreviation, then a postfix key. */
|
|
202
216
|
private customKey(): CustomKey | null {
|
|
203
|
-
const abbreviation = this.
|
|
217
|
+
const abbreviation = this.peers.markup.abbreviationAt();
|
|
204
218
|
|
|
205
219
|
return abbreviation === null ? this.postfix.key() : { start: abbreviation, expand: null };
|
|
206
220
|
}
|
|
@@ -262,7 +276,7 @@ export class TemplatesFeature {
|
|
|
262
276
|
}
|
|
263
277
|
|
|
264
278
|
private run(template: LiveTemplate, placements: readonly SnippetPlacement[]): Promise<boolean> {
|
|
265
|
-
return insertSnippet(this.language, bodyWithIndentUnit(template.body, indentUnitOf(this.language.editor)), placements);
|
|
279
|
+
return insertSnippet(this.language, this.peers.snippets, bodyWithIndentUnit(template.body, indentUnitOf(this.language.editor)), placements);
|
|
266
280
|
}
|
|
267
281
|
|
|
268
282
|
/* The rows for the word before the caret, each a template whose key starts with it. */
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
language: {
|
|
3
|
+
hover: {
|
|
4
|
+
quickFix: 'Quick fix…',
|
|
5
|
+
quickFixNone: 'No quick fixes',
|
|
6
|
+
definition: 'Go to definition',
|
|
7
|
+
references_one: '{{formatted}} reference',
|
|
8
|
+
references_other: '{{formatted}} references',
|
|
9
|
+
line: 'Line {{line}}',
|
|
10
|
+
none: 'No information here'
|
|
11
|
+
},
|
|
12
|
+
inlay: {
|
|
13
|
+
failed: 'Could not run hint action: {{message}}'
|
|
14
|
+
},
|
|
15
|
+
edit: {
|
|
16
|
+
staged_one: '{{count}} unsaved file',
|
|
17
|
+
staged_other: '{{count}} unsaved files',
|
|
18
|
+
stagedMore: '{{names}} and {{count}} more',
|
|
19
|
+
saveAll: 'Save all',
|
|
20
|
+
notSaved: 'Could not save {{name}}'
|
|
21
|
+
},
|
|
22
|
+
actions: {
|
|
23
|
+
show: 'Show code actions',
|
|
24
|
+
none: 'No code actions here',
|
|
25
|
+
unavailable: 'Code actions unavailable here',
|
|
26
|
+
organized: 'Imports already organized',
|
|
27
|
+
noFormatter: 'No formatter for this file',
|
|
28
|
+
readOnly: 'Read-only file',
|
|
29
|
+
failed: 'Could not apply action: {{message}}',
|
|
30
|
+
refused: 'Edit refused',
|
|
31
|
+
moreLines: '{{count}} more lines',
|
|
32
|
+
otherFiles_one: 'and {{count}} other file',
|
|
33
|
+
otherFiles_other: 'and {{count}} other files',
|
|
34
|
+
moves_one: 'moves {{count}} file',
|
|
35
|
+
moves_other: 'moves {{count}} files',
|
|
36
|
+
creates_one: 'creates {{count}} file',
|
|
37
|
+
creates_other: 'creates {{count}} files',
|
|
38
|
+
deletes_one: 'deletes {{count}} file',
|
|
39
|
+
deletes_other: 'deletes {{count}} files',
|
|
40
|
+
groups: {
|
|
41
|
+
quickfix: 'Quick fix',
|
|
42
|
+
rewrite: 'Rewrite',
|
|
43
|
+
extract: 'Extract',
|
|
44
|
+
inline: 'Inline',
|
|
45
|
+
move: 'Move',
|
|
46
|
+
refactor: 'Refactor',
|
|
47
|
+
source: 'Source',
|
|
48
|
+
other: 'Other'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
rename: {
|
|
52
|
+
unavailable: 'Rename unavailable in this file',
|
|
53
|
+
nothing: 'Nothing to rename here',
|
|
54
|
+
refused: 'New name refused',
|
|
55
|
+
stale: 'The text changed before the rename finished. Try again.',
|
|
56
|
+
failed: 'Could not rename: {{message}}',
|
|
57
|
+
occurrences_one: '{{formatted}} occurrence',
|
|
58
|
+
occurrences_other: '{{formatted}} occurrences',
|
|
59
|
+
occurrencesFiles_one: '{{formatted}} occurrence in {{files}} files',
|
|
60
|
+
occurrencesFiles_other: '{{formatted}} occurrences in {{files}} files',
|
|
61
|
+
rename: 'Rename',
|
|
62
|
+
preview: 'Preview',
|
|
63
|
+
cancel: 'Cancel',
|
|
64
|
+
apply: 'Rename',
|
|
65
|
+
suggestions: 'Suggested names',
|
|
66
|
+
useSuggestion: 'Use suggestion',
|
|
67
|
+
operations: {
|
|
68
|
+
create: 'Creates',
|
|
69
|
+
rename: 'Moves',
|
|
70
|
+
delete: 'Deletes'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
markup: {
|
|
74
|
+
wrap: 'Wrap with abbreviation',
|
|
75
|
+
placeholder: 'Abbreviation, such as div.card>p',
|
|
76
|
+
apply: 'Wrap',
|
|
77
|
+
invalid: 'Not an abbreviation'
|
|
78
|
+
},
|
|
79
|
+
navigation: {
|
|
80
|
+
unavailable: 'Not available here',
|
|
81
|
+
none: 'Nothing found',
|
|
82
|
+
failed: 'Could not look it up: {{message}}',
|
|
83
|
+
titles: {
|
|
84
|
+
definition: 'Definitions',
|
|
85
|
+
declaration: 'Declarations',
|
|
86
|
+
typeDefinition: 'Type definitions',
|
|
87
|
+
implementation: 'Implementations',
|
|
88
|
+
symbol: 'Matches'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
panel: {
|
|
92
|
+
resize: 'Resize panel'
|
|
93
|
+
},
|
|
94
|
+
peek: {
|
|
95
|
+
unavailable: 'References unavailable in this file',
|
|
96
|
+
none: 'No references found',
|
|
97
|
+
failed: 'Could not look up references: {{message}}',
|
|
98
|
+
references_one: '{{formatted}} reference',
|
|
99
|
+
references_other: '{{formatted}} references',
|
|
100
|
+
close: 'Close',
|
|
101
|
+
collapse: 'Collapse',
|
|
102
|
+
expand: 'Expand',
|
|
103
|
+
definitions_one: '{{formatted}} definition',
|
|
104
|
+
definitions_other: '{{formatted}} definitions',
|
|
105
|
+
noDefinition: 'No definition found',
|
|
106
|
+
unavailableDefinition: 'Definitions unavailable in this file'
|
|
107
|
+
},
|
|
108
|
+
callHierarchy: {
|
|
109
|
+
unavailable: 'Calls unavailable in this file',
|
|
110
|
+
none: 'No calls here',
|
|
111
|
+
failed: 'Could not look up calls: {{message}}',
|
|
112
|
+
label: 'Call hierarchy',
|
|
113
|
+
direction: 'Direction',
|
|
114
|
+
incoming: 'Callers',
|
|
115
|
+
outgoing: 'Callees',
|
|
116
|
+
close: 'Close',
|
|
117
|
+
loading: 'Loading…',
|
|
118
|
+
noIncoming: 'No callers',
|
|
119
|
+
noOutgoing: 'No callees',
|
|
120
|
+
retry: 'Could not load calls: {{message}}. Click to try again',
|
|
121
|
+
more_one: 'Show {{formatted}} more call ({{hidden}} left)',
|
|
122
|
+
more_other: 'Show {{formatted}} more calls ({{hidden}} left)',
|
|
123
|
+
sites_one: '{{formatted}} call',
|
|
124
|
+
sites_other: '{{formatted}} calls',
|
|
125
|
+
site: 'Call {{current}} of {{total}}',
|
|
126
|
+
previousSite: 'Previous call',
|
|
127
|
+
nextSite: 'Next call',
|
|
128
|
+
typesUnavailable: 'Type hierarchy unavailable in this file',
|
|
129
|
+
typesNone: 'No type here',
|
|
130
|
+
typesFailed: 'Could not look up types: {{message}}',
|
|
131
|
+
typesLabel: 'Type hierarchy',
|
|
132
|
+
supertypes: 'Supertypes',
|
|
133
|
+
subtypes: 'Subtypes',
|
|
134
|
+
noSupertypes: 'No supertypes',
|
|
135
|
+
noSubtypes: 'No subtypes',
|
|
136
|
+
announce: {
|
|
137
|
+
incoming_one: '{{count}} caller of {{name}}',
|
|
138
|
+
incoming_other: '{{count}} callers of {{name}}',
|
|
139
|
+
outgoing_one: '{{count}} callee of {{name}}',
|
|
140
|
+
outgoing_other: '{{count}} callees of {{name}}',
|
|
141
|
+
supertypes_one: '{{count}} supertype of {{name}}',
|
|
142
|
+
supertypes_other: '{{count}} supertypes of {{name}}',
|
|
143
|
+
subtypes_one: '{{count}} subtype of {{name}}',
|
|
144
|
+
subtypes_other: '{{count}} subtypes of {{name}}'
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
colors: {
|
|
148
|
+
swatch: 'Color {{color}}',
|
|
149
|
+
title: 'Color',
|
|
150
|
+
other: 'Pick another color…'
|
|
151
|
+
},
|
|
152
|
+
codeVision: {
|
|
153
|
+
usagesNone: 'No usages',
|
|
154
|
+
usages_one: '{{formatted}} usage',
|
|
155
|
+
usages_other: '{{formatted}} usages',
|
|
156
|
+
newCode: 'new *',
|
|
157
|
+
lines_one: '{{formatted}} line',
|
|
158
|
+
lines_other: '{{formatted}} lines',
|
|
159
|
+
uncommitted: 'Uncommitted',
|
|
160
|
+
latest: 'Latest change',
|
|
161
|
+
showCommit: 'Show commit'
|
|
162
|
+
},
|
|
163
|
+
symbols: {
|
|
164
|
+
unavailable: 'Symbols unavailable in this file',
|
|
165
|
+
failed: 'Could not read symbols: {{message}}',
|
|
166
|
+
placeholder: 'Go to symbol in {{file}}',
|
|
167
|
+
navigate: 'Navigate',
|
|
168
|
+
open: 'Open',
|
|
169
|
+
workspace: 'Workspace symbols',
|
|
170
|
+
line: 'Go to line',
|
|
171
|
+
none: 'No matching symbols',
|
|
172
|
+
workspaceHint: 'Type a symbol name',
|
|
173
|
+
lineHint: 'Type a line number',
|
|
174
|
+
goToLine: 'Go to line {{line}}',
|
|
175
|
+
groups: {
|
|
176
|
+
namespaces: 'Namespaces',
|
|
177
|
+
classes: 'Classes',
|
|
178
|
+
interfaces: 'Interfaces',
|
|
179
|
+
enums: 'Enums',
|
|
180
|
+
functions: 'Functions',
|
|
181
|
+
methods: 'Methods',
|
|
182
|
+
properties: 'Properties',
|
|
183
|
+
variables: 'Variables',
|
|
184
|
+
constants: 'Constants',
|
|
185
|
+
other: 'Other'
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
context: {
|
|
189
|
+
refactor: 'Refactor',
|
|
190
|
+
cut: 'Cut',
|
|
191
|
+
copy: 'Copy',
|
|
192
|
+
paste: 'Paste',
|
|
193
|
+
renameSymbol: 'Rename symbol…',
|
|
194
|
+
goTo: {
|
|
195
|
+
menu: 'Go to',
|
|
196
|
+
definition: 'Definition',
|
|
197
|
+
declaration: 'Declaration',
|
|
198
|
+
typeDefinition: 'Type definition',
|
|
199
|
+
implementation: 'Implementation'
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
snippet: {
|
|
203
|
+
choices: 'Snippet choice'
|
|
204
|
+
},
|
|
205
|
+
completion: {
|
|
206
|
+
tooLarge: 'Too large to insert',
|
|
207
|
+
insert: 'Insert',
|
|
208
|
+
replace: 'Replace',
|
|
209
|
+
details: 'Details',
|
|
210
|
+
none: 'No suggestions',
|
|
211
|
+
transformBusy: 'The snippet is not ready yet. Try again.',
|
|
212
|
+
transformFailed: 'Could not fill in the snippet',
|
|
213
|
+
failed: 'Could not insert suggestion: {{message}}'
|
|
214
|
+
},
|
|
215
|
+
history: {
|
|
216
|
+
recent: 'Recent locations'
|
|
217
|
+
},
|
|
218
|
+
pasteHistory: {
|
|
219
|
+
title: 'Choose content to paste',
|
|
220
|
+
empty: 'Nothing copied yet'
|
|
221
|
+
},
|
|
222
|
+
templates: {
|
|
223
|
+
none: 'No templates defined in this context',
|
|
224
|
+
selectToSave: 'Select the text to save as a live template'
|
|
225
|
+
},
|
|
226
|
+
postfix: {
|
|
227
|
+
expressions: 'Expressions'
|
|
228
|
+
},
|
|
229
|
+
surround: {
|
|
230
|
+
title: 'Surround with',
|
|
231
|
+
selectTemplate: 'Select template',
|
|
232
|
+
liveTemplates: 'Live templates',
|
|
233
|
+
configure: 'Configure live templates…',
|
|
234
|
+
comments: '{{construct}} comments',
|
|
235
|
+
none: 'Surround with has no options here',
|
|
236
|
+
noTemplates: 'No surround templates defined in this context',
|
|
237
|
+
unwrap: {
|
|
238
|
+
title: 'Choose the statement to unwrap or remove',
|
|
239
|
+
if: "Unwrap 'if...'",
|
|
240
|
+
else: "Unwrap 'else...'",
|
|
241
|
+
removeElse: "Remove 'else...'",
|
|
242
|
+
for: "Unwrap 'for...'",
|
|
243
|
+
while: "Unwrap 'while...'",
|
|
244
|
+
do: "Unwrap 'do...'",
|
|
245
|
+
try: "Unwrap 'try...'",
|
|
246
|
+
removeCatch: "Remove 'catch...'",
|
|
247
|
+
removeFinally: "Remove 'finally...'",
|
|
248
|
+
braces: 'Unwrap braces',
|
|
249
|
+
tag: 'Remove enclosing tag: {{name}}'
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
announce: {
|
|
253
|
+
problem: '{{severity}}: {{message}}',
|
|
254
|
+
severity: {
|
|
255
|
+
error: 'Error',
|
|
256
|
+
warning: 'Warning',
|
|
257
|
+
info: 'Information',
|
|
258
|
+
hint: 'Hint'
|
|
259
|
+
},
|
|
260
|
+
field: 'Field {{current}} of {{total}}',
|
|
261
|
+
fieldChoices_one: 'Field {{current}} of {{total}}, {{count}} choice',
|
|
262
|
+
fieldChoices_other: 'Field {{current}} of {{total}}, {{count}} choices'
|
|
263
|
+
},
|
|
264
|
+
fold: {
|
|
265
|
+
fold: 'Fold lines {{start}} to {{end}}',
|
|
266
|
+
unfold: 'Unfold lines {{start}} to {{end}}'
|
|
267
|
+
},
|
|
268
|
+
docs: {
|
|
269
|
+
label: 'Rendered documentation',
|
|
270
|
+
labelNamed: 'Rendered documentation: {{- summary}}',
|
|
271
|
+
render: 'Show rendered documentation',
|
|
272
|
+
showSource: 'Show documentation source',
|
|
273
|
+
tags: {
|
|
274
|
+
deprecated: 'Deprecated',
|
|
275
|
+
template: 'Type parameters',
|
|
276
|
+
param: 'Parameters',
|
|
277
|
+
property: 'Properties',
|
|
278
|
+
type: 'Type',
|
|
279
|
+
var: 'Variable',
|
|
280
|
+
return: 'Returns',
|
|
281
|
+
yield: 'Yields',
|
|
282
|
+
throws: 'Throws',
|
|
283
|
+
see: 'See also',
|
|
284
|
+
example: 'Example',
|
|
285
|
+
since: 'Since',
|
|
286
|
+
version: 'Version',
|
|
287
|
+
author: 'Author'
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
commands: {
|
|
292
|
+
goToDefinition: 'Go to definition',
|
|
293
|
+
goToTypeDefinition: 'Go to type definition',
|
|
294
|
+
goToImplementation: 'Go to implementation',
|
|
295
|
+
callHierarchy: 'Call hierarchy',
|
|
296
|
+
typeHierarchy: 'Type hierarchy',
|
|
297
|
+
peekReferences: 'Peek references',
|
|
298
|
+
renameSymbol: 'Rename symbol',
|
|
299
|
+
codeActions: 'Code actions',
|
|
300
|
+
formatDocument: 'Format document',
|
|
301
|
+
formatSelection: 'Format selection'
|
|
302
|
+
},
|
|
303
|
+
find: {
|
|
304
|
+
label: 'Find',
|
|
305
|
+
count: '{{current}} / {{total}}',
|
|
306
|
+
countLimited: '{{current}} / {{total}}+',
|
|
307
|
+
none: 'No results',
|
|
308
|
+
invalid: 'Invalid regular expression',
|
|
309
|
+
caseSensitive: 'Match case',
|
|
310
|
+
wholeWord: 'Match whole word',
|
|
311
|
+
regex: 'Use regular expression',
|
|
312
|
+
inSelection: 'In selection',
|
|
313
|
+
noSelection: 'No selection',
|
|
314
|
+
selectAll: 'Select all matches',
|
|
315
|
+
previous: 'Previous match',
|
|
316
|
+
next: 'Next match',
|
|
317
|
+
close: 'Close',
|
|
318
|
+
replace: {
|
|
319
|
+
label: 'Replace with',
|
|
320
|
+
one: 'Replace',
|
|
321
|
+
all: 'All',
|
|
322
|
+
allLabel: 'Replace all',
|
|
323
|
+
preserveCase: 'Preserve case',
|
|
324
|
+
toggle: 'Show replace',
|
|
325
|
+
hide: 'Hide replace',
|
|
326
|
+
failed: {
|
|
327
|
+
limit: 'Too much to replace at once (more than {{edits}} matches or {{characters}} characters)',
|
|
328
|
+
timeout: 'Replace timed out. Nothing changed',
|
|
329
|
+
unavailable: 'Replace is not available right now',
|
|
330
|
+
error: 'Could not replace. Nothing changed'
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
countMore: '{{total}}+ matches',
|
|
334
|
+
searching: 'Searching…',
|
|
335
|
+
large: 'This document is large. Press Enter to search',
|
|
336
|
+
replaced: 'Replaced {{count}} matches',
|
|
337
|
+
failed: {
|
|
338
|
+
timeout: 'Search timed out. Press Enter to try again',
|
|
339
|
+
unavailable: 'Regex search is unavailable',
|
|
340
|
+
invalid: 'Invalid regular expression',
|
|
341
|
+
error: 'Could not finish the search'
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
diff: {
|
|
345
|
+
hidden: 'Show {{count}} hidden lines',
|
|
346
|
+
contextLimit: 'Context limit reached',
|
|
347
|
+
oldSide: 'Before',
|
|
348
|
+
newSide: 'After',
|
|
349
|
+
noNewline: 'No final newline',
|
|
350
|
+
added: 'Added, new line {{number}}',
|
|
351
|
+
removed: 'Removed, old line {{number}}',
|
|
352
|
+
unchanged: 'Old line {{old}}, new line {{new}}',
|
|
353
|
+
addedLine: 'Added line',
|
|
354
|
+
removedLine: 'Removed line'
|
|
355
|
+
}
|
|
356
|
+
};
|