Skip to content

Commit

Permalink
refactor(test-utils): update startLanguageServer to accept multiple w…
Browse files Browse the repository at this point in the history
…orkspace folders

Closes #229
  • Loading branch information
johnsoncodehk committed Aug 18, 2024
1 parent 9b7d91e commit 8af381d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/test-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function startLanguageServer(serverModule: string, cwd?: string | URL) {
process: childProcess,
connection,
async initialize(
rootUri: string,
rootUri: string | _.WorkspaceFolder[],
initializationOptions: _._InitializeParams['initializationOptions'],
capabilities: _.ClientCapabilities = {},
locale?: string
Expand All @@ -65,16 +65,14 @@ export function startLanguageServer(serverModule: string, cwd?: string | URL) {
_.InitializeRequest.type,
{
processId: childProcess.pid ?? null,
rootUri,
rootUri: typeof rootUri === 'string' ? rootUri : null,
workspaceFolders: Array.isArray(rootUri) ? rootUri : null,
initializationOptions,
capabilities,
locale,
} satisfies _.InitializeParams
);
await connection.sendNotification(
_.InitializedNotification.type,
{} satisfies _.InitializedParams
);
await connection.sendNotification(_.InitializedNotification.type, {} satisfies _.InitializedParams);
running = true;
return result;
},
Expand Down

0 comments on commit 8af381d

Please sign in to comment.