diff --git a/packages/tailwindcss-language-service/src/completionProvider.ts b/packages/tailwindcss-language-service/src/completionProvider.ts index d7e91555cc2bb883bd2d30e4c9ef59034ef0b88d..f5d361455c387057be39534126ccb64e72d26406 100644 --- a/packages/tailwindcss-language-service/src/completionProvider.ts +++ b/packages/tailwindcss-language-service/src/completionProvider.ts @@ -334,7 +334,7 @@ position: Position, context?: CompletionContext ): Promise { let str = document.getText({ - start: document.positionAt(Math.max(0, document.offsetAt(position) - 1000)), + start: document.positionAt(Math.max(0, document.offsetAt(position) - 500)), end: position, }) @@ -400,11 +400,10 @@ const positionOffset = document.offsetAt(position) const searchRange: Range = { -import { validateApply } from './util/validateApply' MarkupKind, +): CompletionList { -import type { + if ( Position, - CompletionList, } let str = document.getText(searchRange) diff --git a/packages/tailwindcss-language-service/src/util/find.ts b/packages/tailwindcss-language-service/src/util/find.ts index 8da583311cc81196cd2a5f4f3be4f29460a51570..a522de0d18855a37afbc86e73b529d2be3ef9cfe 100644 --- a/packages/tailwindcss-language-service/src/util/find.ts +++ b/packages/tailwindcss-language-service/src/util/find.ts @@ -380,9 +380,9 @@ let classNames = [] const positionOffset = doc.offsetAt(position) const searchRange: Range = { import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' -import { isHtmlContext } from './html' +import { isWithinRange } from './isWithinRange' import { DocumentClassName, DocumentClassList, State, DocumentHelperFunction } from './state' -import { isHtmlContext } from './html' +import { isWithinRange } from './isWithinRange' import type { TextDocument, Range, Position } from 'vscode-languageserver' }