diff --git a/packages/tailwindcss-language-server/tests/env/custom-languages.test.js b/packages/tailwindcss-language-server/tests/env/custom-languages.test.js index c59e076d..34725c6f 100644 --- a/packages/tailwindcss-language-server/tests/env/custom-languages.test.js +++ b/packages/tailwindcss-language-server/tests/env/custom-languages.test.js @@ -1,6 +1,6 @@ import { test } from 'vitest' import { init } from '../common' -import { HoverRequest } from 'vscode-languageserver' +import { CompletionRequest, HoverRequest } from 'vscode-languageserver' test('Unknown languages do not provide completions', async ({ expect }) => { let c = await init('basic') @@ -16,6 +16,14 @@ test('Unknown languages do not provide completions', async ({ expect }) => { }) expect(hover).toEqual(null) + + let completion = await c.sendRequest(CompletionRequest.type, { + textDocument, + position: { line: 0, character: 13 }, + context: { triggerKind: 1 }, + }) + + expect(completion).toBe(null) }) test('Custom languages may be specified via init options (deprecated)', async ({ expect }) => { @@ -43,6 +51,14 @@ test('Custom languages may be specified via init options (deprecated)', async ({ }, range: { start: { line: 0, character: 12 }, end: { line: 0, character: 21 } }, }) + + let completion = await c.sendRequest(CompletionRequest.type, { + textDocument, + position: { line: 0, character: 13 }, + context: { triggerKind: 1 }, + }) + + expect(completion.items.length).toBe(11509) }) test('Custom languages may be specified via settings', async ({ expect }) => { @@ -74,6 +90,14 @@ test('Custom languages may be specified via settings', async ({ expect }) => { }, range: { start: { line: 0, character: 12 }, end: { line: 0, character: 21 } }, }) + + let completion = await c.sendRequest(CompletionRequest.type, { + textDocument, + position: { line: 0, character: 13 }, + context: { triggerKind: 1 }, + }) + + expect(completion.items.length).toBe(11509) }) test('Custom languages are merged from init options and settings', async ({ expect }) => { @@ -101,6 +125,12 @@ test('Custom languages are merged from init options and settings', async ({ expe position: { line: 0, character: 13 }, }) + let completion = await c.sendRequest(CompletionRequest.type, { + textDocument, + position: { line: 0, character: 13 }, + context: { triggerKind: 1 }, + }) + textDocument = await c.openDocument({ lang: 'other-lang', text: '