Skip to content

Commit

Permalink
Fix bug with overriding options object (#19)
Browse files Browse the repository at this point in the history
Recently, with the addition of supporting running LSP as a standalone
process, the `connect` function was changed.

This changed the promise such that the options object was now the result
of the `connection.onInitialized` function rather than the result of
the callback from `connection.onInitialize`, which seems like an error
in understanding the API of the LSP library

This reverts that change, but still returns the value options out of the
promise, though it is likely an uneeded change.

Automated testing for this would be ideal, but as there doesn't seem to
be any infrastructure for that currently, that is out of scope of this
commit
  • Loading branch information
addisonj authored Apr 28, 2024
1 parent a4ba348 commit 4d43130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function connect(
});

return new Promise((resolve) => {
const options = connection.onInitialized(() => resolve(options));
connection.onInitialized(() => resolve(options));
connection.listen();
return options
});
Expand Down

0 comments on commit 4d43130

Please sign in to comment.