Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions wasm-language-server/bin/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const sharedWebOptions = {
target: 'es2020',
platform: 'browser',
sourcemap: true,
define: {
'IS_DESKTOP': 'false'
}
};

/** @type BuildOptions */
Expand All @@ -33,12 +36,15 @@ const sharedDesktopOptions = {
target: 'es2020',
platform: 'node',
sourcemap: true,
define: {
'IS_DESKTOP': 'true'
}
};

/** @type BuildOptions */
const desktopOptions = {
entryPoints: ['client/src/extension.ts'],
outfile: 'client/dist/desktop/extension.js',
outfile: 'client/out/extension.js',
format: 'cjs',
...sharedDesktopOptions,
};
Expand Down Expand Up @@ -68,4 +74,4 @@ createContexts().then(contexts => {
}
}).then(() => { return undefined; }).catch(console.error);
}
}).catch(console.error);
}).catch(console.error);
10 changes: 8 additions & 2 deletions wasm-language-server/client/bin/esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const sharedWebOptions = {
target: 'es2020',
platform: 'browser',
sourcemap: true,
define: {
'IS_DESKTOP': 'false'
}
};

/** @type BuildOptions */
Expand All @@ -33,12 +36,15 @@ const sharedDesktopOptions = {
target: 'es2020',
platform: 'node',
sourcemap: true,
define: {
'IS_DESKTOP': 'true'
}
};

/** @type BuildOptions */
const desktopOptions = {
entryPoints: ['src/extension.ts'],
outfile: 'dist/desktop/extension.js',
outfile: 'out/extension.js',
format: 'cjs',
...sharedDesktopOptions,
};
Expand Down Expand Up @@ -68,4 +74,4 @@ createContexts().then(contexts => {
}
}).then(() => { return undefined; }).catch(console.error);
}
}).catch(console.error);
}).catch(console.error);
6 changes: 3 additions & 3 deletions wasm-language-server/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"@types/node": "^22"
},
"scripts": {
"compile": "tsc -b",
"compile": "npm run esbuild",
"watch": "tsc -b -w",
"lint": "eslint",
"esbuild": "^0.25.0"
"esbuild": "node ./bin/esbuild.js"
}
}
}
13 changes: 11 additions & 2 deletions wasm-language-server/client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */

// declared in esbuild.js
declare const IS_DESKTOP: boolean;

import { ExtensionContext, Uri, window, workspace, commands } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, RequestType } from 'vscode-languageclient/node';
import { LanguageClient, ServerOptions, RequestType, LanguageClientOptions } from 'vscode-languageclient';
if (IS_DESKTOP) {
require('vscode-languageclient/node');
} else {
require('vscode-languageclient/browser');
}

import { Wasm, ProcessOptions } from '@vscode/wasm-wasi/v1';
import { createStdioOptions, createUriConverters, startServer } from '@vscode/wasm-wasi-lsp';

Expand Down Expand Up @@ -63,4 +72,4 @@ export async function activate(context: ExtensionContext) {

export function deactivate() {
return client.stop();
}
}
2 changes: 1 addition & 1 deletion wasm-language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@
"esbuild": "node ./bin/esbuild.js",
"serve": "serve --cors -l 5000 --ssl-cert $HOME/certs/localhost.pem --ssl-key $HOME/certs/localhost-key.pem"
}
}
}