Web workers for the lsp servers (#2136)

* put the lsps into a web worker

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove extraneous logs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove trash toml lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* less logs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* less logs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes for tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* for playwright go back to the shitty lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-04-16 21:36:19 -07:00
committed by GitHub
parent 35c3103186
commit f0b9de2c1c
24 changed files with 412 additions and 167 deletions

View File

@ -134,27 +134,14 @@ async function getUser(context: UserContext) {
token: context.token,
hostname: VITE_KC_API_BASE_URL,
}).catch((err) => console.error('error from Tauri getUser', err))
const tokenPromise = !isTauri()
? fetch(withBaseURL('/user/api-tokens?limit=1'), {
method: 'GET',
credentials: 'include',
headers,
})
.then(async (res) => {
const result: Models['ApiTokenResultsPage_type'] = await res.json()
return result.items[0].token
})
.catch((err) => console.error('error from Browser getUser', err))
: context.token
const user = await userPromise
const token = await tokenPromise
if ('error_code' in user) throw new Error(user.message)
return {
user,
token,
token: context.token,
}
}