diff --git a/src/extension.ts b/src/extension.ts index 99d162933ee803a16a26301169a5628508dd54a0..2601445166499b800b0a3b452dfcd5b63d73cde5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -675,15 +675,6 @@ ) ) tw = await getTailwind() - - this._providers.push( - createScreenCompletionItemProvider({ - config: tailwind.config, - languages: [...CSS_TYPES, 'postcss', 'vue'] - }) - ) - - tw = await getTailwind() const htmlElements = require('./htmlElements.js') } @@ -742,51 +733,3 @@ } catch (err) { return } } - -function createScreenCompletionItemProvider({ - languages, - config -}): vscode.Disposable { - return vscode.languages.registerCompletionItemProvider( - languages, - { - provideCompletionItems: ( - document: vscode.TextDocument, - position: vscode.Position - ): vscode.CompletionItem[] => { - let range: vscode.Range = new vscode.Range( - new vscode.Position(0, 0), - position - ) - let text: string = document.getText(range) - - if ( - document.languageId === 'vue' && - !(text.indexOf('') === -1) - ) - return [] - - let line = text.split(/[\n\r]/).pop() - - if (/@screen $/.test(line)) { - return Object.keys(dlv(config, 'screens', {})).map((screen, i) => { - let item = new vscode.CompletionItem( - screen, - vscode.CompletionItemKind.Constant - ) - item.insertText = new vscode.SnippetString(`${screen} {\n\t$0\n}`) - item.detail = - typeof config.screens[screen] === 'string' - ? config.screens[screen] - : '' - item.sortText = naturalExpand(i.toString()) - return item - }) - } - - return [] - } - }, - ' ' - ) -}