Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 committed Dec 2, 2024
1 parent fa868c3 commit a973774
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/cairols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ export async function setupLanguageServer(ctx: Context): Promise<SetupResult | u
ctx.log.debug(`using CairoLS: ${quoteServerExecutable(run)}`);

const serverOptions = { run, debug: run };
// We pass client options to maintain compability with older LS binaries.
// Any pre 2.9.0 LS doesn't register files it wants to be informed about, it was done on the client side instead.
const clientOptions: lc.LanguageClientOptions = {
documentSelector: [
{ scheme: "file", language: "cairo" },
{ scheme: "vfs", language: "cairo" },
],
};

const client = new lc.LanguageClient(
"cairoLanguageServer",
"Cairo Language Server",
serverOptions,
{},
clientOptions,
);

client.registerFeature(new SemanticTokensFeature(client));
Expand Down

0 comments on commit a973774

Please sign in to comment.