Thank you so much for being interested in contributing to our project! Before submitting your contribution, please read the following guidelines.
- Ensure you have
yarn
setup on your machine (see more details here) - Run
yarn install
to install dependencies. - Run
yarn bundle
to bundle all the code in theshared
package for use in theclient
andextension
packages. - Run
yarn mvn:prepare
to collect necessary build artifacts (download the LSP jars, etc.).
- Make necessary changes to the code.
- If you changed any code in the
shared
package, make sure to runyarn bundle
again.
- If you changed any code in the
- If there are new versions of the LSP jars you need to use, make sure to run
yarn mvn:prepare
again. - Run
yarn webpack
to generate the output files for running the extension. - Navigate to
packages/extension/dist/extension.js
and pressF5
in your VSCode IDE to launch a debugging session of the extension. Ensure that your VSCode IDE is using the launch.json file provided in the repo.
Note that
extension.js
must be opened in the active editor, else VSCode will not be able to find the extension to debug
Alternatively, you can use the
Run and Debug
menu in VSCode, ensure theLaunch Legend Extension
configuration is selected, and click theStart Debugging
button.
If the extension errors out related to
storageUri.fsPath
, make sure in the debug workspace, open a folder: the above error usually happens the first time debug is on and no workspace folder is specified.
- You can now place breakpoints on any code in the
extension
package..
Any
console.log
will output inDEBUG CONSOLE
tab in VSCode; while runtime log message will be output to corresponding channels in the debugger instance.
- If you make changes to the code, rerun
yarn webpack
and restart the debugger to have the changes in effect.
The project is structured into 3 packages within the repo:
- extension: This package contains code that runs exclusively on the extension host and interacts directly with the VS Code APIs. Nothing in this directory should import anything from @finos/legend-vscode-extension-dependencies unless it is simply a
type
import, as doing so will cause the webpack bundling to break, since components from the @finos/legend-vscode-extension-dependencies library require polyfills that we don't provide when bundling the extension code. - client: This package contains code that runs within iframes in VS Code. Most of the core UI logic lives here, and all the components that we import from @finos/legend-vscode-extension-dependencies are implemented here. You can safely import from @finos/legend-vscode-extension-dependencies in this directory.
- shared: This package contains code that is shared between the extension and client packages. Because code here is used within the extension package, nothing in the shared package should import anything from @finos/legend-vscode-extension-dependencies unless it is simply a
type
import.