Skip to content

Commit 00a0a62

Browse files
committed
wip
1 parent 77586d1 commit 00a0a62

File tree

1 file changed

+14
-0
lines changed
  • packages/tailwindcss-language-server/tests

1 file changed

+14
-0
lines changed

packages/tailwindcss-language-server/tests/common.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ export async function init(
9191
projectDetails = project
9292
})
9393

94+
// TODO: This shouldn't be needed
95+
// The server should either delay requests *or*
96+
// openDocument shouldn't return until the project its a part of has been
97+
// built otherwise all requests will return nothing and it's not something
98+
// we can await directly right now
99+
//
100+
// Like maybe documentReady should be delayed by project build state?
101+
// because otherwise the document isn't really ready anyway
102+
let projectBuilt = new Promise<void>((resolve) => {
103+
client.conn.onNotification('@/tailwindCSS/projectReloaded', () => resolve())
104+
})
105+
94106
return {
95107
client,
96108
fixtureUri(fixture: string) {
@@ -130,6 +142,8 @@ export async function init(
130142
settings,
131143
})
132144

145+
await projectBuilt
146+
133147
return {
134148
get uri() {
135149
return doc.uri.toString()

0 commit comments

Comments
 (0)