Run yarn install
in the project root to install the development dependencies.
You can also package up the extension with
yarn global add vsce
to get the Extension Manager,yarn install
to build the extensionvsce package
which creates an extension package athaskell-<version>.vsix
.
Note: that if you get errors running vsce package
, it might help running yarn run pretest
directly, since that gives the actual error output of the TypeScript compilation.
- Launch VS Code, press
File
>Open Folder
, open thevscode-haskell
folder; - press
F5
to open a new window with thevscode-haskell
loaded (this will overwrite existing ones, e.g. from the marketplace); - open a Haskell file with the new editor to test the LSP client;
You are now ready to make changes and debug. You can,
- set breakpoints in your code inside
src/extension.ts
to debug your extension; - find output from your extension in the debug console;
- make changes to the code, and then
- relaunch the extension from the debug toolbar
Note: you can also reload (Ctrl+R
or Cmd+R
on macOS) the VS Code window with your extension to load your changes
prettier is automatically run on each commit via husky. If you are developing within VS Code, the settings are set to auto format on save.
The configurations for prettier are located in .prettierrc
.
A brief overview of the files,
package.json
contains the basic information about the package, see the full manifest for more, such as telling VS Code which scope the LSP works on (Haskell and Literate Haskell in our case), and possible configurationsrc/extension.ts
is the main entrypoint to the extension, and handles launching the language server.src/hlsBinaries.ts
handles automatically installing the pre-builthaskell-language-server
binariessrc/utils.ts
has some functions for downloading files and checking if executables are on the pathsrc/docsBrowser.ts
contains the logic for displaying the documentation browser (e.g. hover over a type likemapM_
and clickDocumentation
orSource
)
We recommend checking out Your First VS Code Extension and Creating a Language Server for some introduction to VS Code extensions.