-
Notifications
You must be signed in to change notification settings - Fork 0
3.0 | Building
Before you can build the language server, you have to install all the dependencies (they will be placed into the node_modules folder), and generate code. After that, you can build the code by using the build, or the watch scripts, and you can build it in production mode with build-production. If you want to know more about building the language server, there are step-by-step instructions for Windows, and for Linux.
The language server's source code is written in TypeScript, which is a typed superset of JavaScript. When you build the code, each TypeScript file is transpiled to a JavaScript file by the TypeScript Compiler. You can find the configuration in the tsconfig.json file.
After the TypeScript Compiler finishes the transpilation, Webpack bundles together all the JavaScript files into a single file (technically, the whole TypeScript transpilation is part of the bundling). You can find the configuration in the webpack.config.js file. Webpack uses pkg to generate executables.
The language server actually has 2 versions: a desktop, and a web version. The desktop version can run in any IDEs supporting the Language Server Protocol, using Windows, Mac, and Linux, while the web version can run in the browser, for example, in github.dev, or vscode.dev. The web version has some limitations, for example, it can't run executables.
After building the language server, the out folder will contain the build artifacts: server-desktop.js, server-web.js, and the corresponding mappings. If you built the language server in production mode, you'll find the server-desktop-linux, server-desktop-macos, and the server-desktop-win.exe files in the bin folder. These x64, and operating system-specific executables are wrapping Node.js, and the language server into one file. This way, extensions can directly run the language server, instead of forcing the user to install Node.js.