Open the project in Visual Studio Code. Make sure node modules are up to date.
$ yarn
Build the extension bundles.
$ yarn run compile
Alternatively, continuously re-compile the extension any time the code changes.
$ yarn run watch
Launch the extension in debug mode by pressing F5.
To build a vsix
file, run the package
script.
$ yarn run package
- Make sure the language is defined in the
LANGUAGES
array insrc/languageResolver.ts
. - Add an instance of the agent to
LANGUAGE_AGENTS
insrc/languageResolver.ts
. - Verify the
readonly
propertylanguage
of theAppMapAgent
implementation contains the same value as theid
field as the language definition in theLANGUAGES
array insrc/languageResolver.ts
. This creates a link between the agent and the language. - Make sure there's a corresponding analyzer in
src/analyzers
. This implements the quick requirement check for the Getting started page.
Where $APPMAP_JS_PATH
is the path to a clone of
getappmap/appmap-js
:
$ yarn link --all $APPMAP_JS_PATH
Note that this command will add a resolutions
property to your package.json
containing paths
local to your filesystem. Take care not to commit this change.
The vscode
packaging appears to be incompatible with yarn v2. You can downgrade to yarn v1 like
so:
$ rm .yarn/releases/yarn-berry.js .yarnrc.yml
$ yarn run package
After uninstallation, VSCode leaves the extensions folders on the filesystem which can cause weird problems, especially when re-installing an older version. To completely erase old extensions and their code, delete the appland.appmap.* folders in:
- Windows:
%USERPROFILE%\.vscode\extensions
- Mac:
~/.vscode/extensions
- Linux:
~/.vscode/extensions
The extension uses vscode.ExtensionContext.workspaceState
and
vscode.ExtensionContext.globalState
for storage of the state of user's activities. To erase the
saved state, run this command in VSCode: AppMap: Reset Usage State
This command is implemented in src/utils.ts
registerUtilityCommands()
. If you are adding new
stored states, please update this function to reset the new stored states.
This app uses a customized version of @vscode/test-electron. Integration tests are located in
test/integration
and test/system
. Unlike the default VSCode integration test script, each test
case is run in its own Electron process. This keeps state changes from leaking across tests.
There are some unit tests which don't run in VSCode and mock it as required. These are located in
test/unit
. The web view part also has its own (currently rather limited) set of tests in
web/test
.
You can run the whole suite or select a specific set of tests:
$ yarn run test
$ yarn run test:unit
$ yarn run test:web-client
$ yarn run test:system
$ yarn run test:integration
Note the integration tests (so, test:system
and test:integration
) require that yarn run pretest
be executed first. Then, compile the extension with yarn run compile
or by keeping yarn run watch
running in the background.
By downloading and using AppMap you agree to the Terms and Conditions.