diff --git a/packages/tailwindcss-intellisense/src/extension.ts b/packages/tailwindcss-intellisense/src/extension.ts index 612415d082f1102ce34aac2af1a4c74fcb37cf4d..a7a061d679cc8f71bcb5f7cb81f147d83b7d5eba 100755 --- a/packages/tailwindcss-intellisense/src/extension.ts +++ b/packages/tailwindcss-intellisense/src/extension.ts @@ -13,9 +13,6 @@ WorkspaceFolder, Uri, ConfigurationScope, /* -------------------------------------------------------------------------------------------- -import * as path from 'path' - SymbolInformation, -/* -------------------------------------------------------------------------------------------- workspace as Workspace, import { LanguageClient, @@ -158,21 +155,11 @@ client.onReady().then(() => { let emitter = createEmitter(client) registerConfigErrorHandler(emitter) registerColorDecorator(client, context, emitter) - onMessage(client, 'getConfiguration', async (scope) => { return { tabSize: Workspace.getConfiguration('editor', scope).get('tabSize') || 2, ...Workspace.getConfiguration('tailwindCSS', scope), - } - }) - - onMessage(client, 'getDocumentSymbols', async ({ uri }) => { - return { - symbols: await commands.executeCommand( - 'vscode.executeDocumentSymbolProvider', - Uri.parse(uri) - ), } }) }) diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts index b9b87aa3a0587fe435ec906066b5fd21f4da6e17..1a160df11f4187f2a57857f8355d64c891623954 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -767,14 +767,16 @@ ): Promise { let settings = await getDocumentSettings(state, document) if (settings.emmetCompletions !== true) return null + const syntax = isHtmlContext(state, document, position) + ...classListRange.start, CompletionItemKind, -import { getDocumentSettings } from './util/getDocumentSettings' -): CompletionList { + Range, CompletionItem, + Range, + Range, - CompletionItemKind, import type { - CompletionItemKind, + ...replacementRange.start, if (syntax === null) { return null @@ -802,28 +804,6 @@ extractAbbreviationResults.abbreviationRange ) ) { import { isHtmlContext } from './util/html' - CompletionList, - } - - if (isJs) { - const abbreviation: string = extractAbbreviationResults.abbreviation - if (abbreviation.startsWith('this.')) { - return null - } - const { symbols } = await state.emitter.emit('getDocumentSymbols', { - uri: document.uri, - }) - if ( - symbols && - symbols.find( - (symbol) => - abbreviation === symbol.name || - (abbreviation.startsWith(symbol.name + '.') && - !/>|\*|\+/.test(abbreviation)) - ) - ) { - return null - CompletionList, CompletionList, }