-
Notifications
You must be signed in to change notification settings - Fork 0
4.0 | Source code
The extension has 2 entry points: client-desktop.ts's activate
function starts the extension in desktop environment, while client-web.ts's activate
function starts the extension when it runs in the browser.
In the desktop version, first, I add a command to let the user select a shader config by using the context menu (this is not part of the Language Server Protocol). Then I configure and start the language server. In development mode I run the language server's JavaScript file in Node.js because it's faster to build and easier to debug. However, in production mode, I run a platform-specific executable of the language server, so that the user doesn't have to install Node.js. Since it's an executable, I have to make sure it actually has the permission to be executed. So, in production mode on Linux and on MacOS if the file is not executable, I try to make it executable. If it's now executable, I start it, if it's not, I fallback to Node.js. This means that we don't have the permission to make a file executable and Node.js is not installed, the extension will fail. In production mode the client and the server communicates over the standard IO, but in development mode, it uses Node.js-specific IPC. And that's it, everything else is handled by the language server and VS Code itself.