refactor: 所有文件都支持"zz."

This commit is contained in:
宁宁 2020-02-21 22:50:42 +08:00
parent dbb58a1ed3
commit a16608c3e5
2 changed files with 3 additions and 9 deletions

View File

@ -80,13 +80,7 @@
"onCommand:extension.rule58", "onCommand:extension.rule58",
"onCommand:extension.rule59", "onCommand:extension.rule59",
"onCommand:extension.rule60", "onCommand:extension.rule60",
"onLanguage:html", "*"
"onLanguage:vue",
"onLanguage:jsx",
"onLanguage:js",
"onLanguage:mjs",
"onLanguage:ts",
"onLanguage:plaintext"
], ],
"main": "./out/extension.js", "main": "./out/extension.js",
"contributes": { "contributes": {
@ -377,4 +371,4 @@
"dependencies": { "dependencies": {
"transliteration": "^2.1.8" "transliteration": "^2.1.8"
} }
} }

View File

@ -6,7 +6,7 @@ import { COMPLETION_TRIGGER_ID } from './constant';
export default function (context: ExtensionContext, RULES: Rule[]) { export default function (context: ExtensionContext, RULES: Rule[]) {
// commands.registerCommand('functions.insertRegex', insertRule); // commands.registerCommand('functions.insertRegex', insertRule);
const disposable = languages.registerCompletionItemProvider('plaintext', { const disposable = languages.registerCompletionItemProvider('*', {
provideCompletionItems(document, position) { provideCompletionItems(document, position) {
const linePrefix = document.lineAt(position).text.substr(0, position.character); const linePrefix = document.lineAt(position).text.substr(0, position.character);
if (!linePrefix.endsWith(COMPLETION_TRIGGER_ID)) return; if (!linePrefix.endsWith(COMPLETION_TRIGGER_ID)) return;