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
8 changes: 7 additions & 1 deletion 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
8 changes: 7 additions & 1 deletion 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
4 changes: 2 additions & 2 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"
}
}
11 changes: 10 additions & 1 deletion 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, LanguageClientOptions, ServerOptions, RequestType } 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