From 9b97f9bffa31a83651617e64f3ee68454349ce5c Mon Sep 17 00:00:00 2001 From: Jordan Pittman Date: Fri, 9 May 2025 15:17:23 -0400 Subject: [PATCH 1/4] Add test --- .../src/util/find.test.ts | 81 ++++++++++++++++++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/packages/tailwindcss-language-service/src/util/find.test.ts b/packages/tailwindcss-language-service/src/util/find.test.ts index 170217c0..e4003cf3 100644 --- a/packages/tailwindcss-language-service/src/util/find.test.ts +++ b/packages/tailwindcss-language-service/src/util/find.test.ts @@ -1,6 +1,16 @@ import { test } from 'vitest' -import { findClassListsInHtmlRange, findClassNameAtPosition } from './find' -import { js, html, pug, createDocument } from './test-utils' +import { + findClassListsInHtmlRange, + findClassNameAtPosition, + findHelperFunctionsInDocument, +} from './find' +import { js, html, pug, createDocument, css } from './test-utils' +import type { Range } from 'vscode-languageserver-textdocument' + +const range = (startLine: number, startCol: number, endLine: number, endCol: number): Range => ({ + start: { line: startLine, character: startCol }, + end: { line: endLine, character: endCol }, +}) test('class regex works in astro', async ({ expect }) => { let file = createDocument({ @@ -875,3 +885,70 @@ test('Can find class name inside JS/TS functions in