✨ 配置命令提示符.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
// 触发提示前缀
|
||||
export const triggerPrefix = '_';
|
||||
|
||||
// 触发提示前缀
|
||||
export const templatePrefix = '@{{ ';
|
||||
|
||||
// 触发提示后缀
|
||||
export const templateSuffix = ' }}';
|
||||
|
||||
// 模板参数
|
||||
export interface TemplateParam {
|
||||
name?: string;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { TemplateParam } from './const';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import { builtinsParams } from './const';
|
||||
import { builtinsParams, templatePrefix, templateSuffix, triggerPrefix } from './const';
|
||||
import * as monaco from 'monaco-editor';
|
||||
import { language } from 'monaco-editor/esm/vs/basic-languages/shell/shell.js';
|
||||
|
||||
@@ -48,9 +48,9 @@
|
||||
// 内置参数提示
|
||||
builtinsParams.forEach(s => {
|
||||
suggestions.push({
|
||||
label: '_' + s.name,
|
||||
label: triggerPrefix + s.name,
|
||||
kind: monaco.languages.CompletionItemKind.Variable,
|
||||
insertText: `@{{ ${s.name} }}`,
|
||||
insertText: templatePrefix + s.name + templateSuffix,
|
||||
detail: s.desc || '',
|
||||
documentation: s.desc || '',
|
||||
});
|
||||
@@ -61,9 +61,9 @@
|
||||
return;
|
||||
}
|
||||
suggestions.push({
|
||||
label: '_' + s.name,
|
||||
label: triggerPrefix + s.name,
|
||||
kind: monaco.languages.CompletionItemKind.Field,
|
||||
insertText: `@{{ ${s.name} }}`,
|
||||
insertText: templatePrefix + s.name + templateSuffix,
|
||||
detail: s.desc || '',
|
||||
documentation: s.desc || '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user