better error lsp server (#1850)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-03-21 15:14:55 -07:00
committed by GitHub
parent 2d39fd32ce
commit e773e932b0

View File

@ -33,10 +33,12 @@ export default class Server {
this.#fromServer, this.#fromServer,
fileSystemManager fileSystemManager
) )
if (type_ === 'copilot') {
if (!token || token === '') { if (!token || token === '') {
throw new Error('auth token is required for copilot') throw new Error(
type_ + ': auth token is required for lsp server to start'
)
} }
if (type_ === 'copilot') {
await copilotLspRun(config, token) await copilotLspRun(config, token)
} else if (type_ === 'kcl') { } else if (type_ === 'kcl') {
await kclLspRun(config, token || '') await kclLspRun(config, token || '')