|
| 1 | +# VSCode Trace Server extension |
| 2 | + |
| 3 | +This file contains information that could be interesting to developers, that want to modify, build, test, and debug this extension. |
| 4 | + |
| 5 | +For general information, see the main [README.md](README.md) |
| 6 | + |
| 7 | + |
| 8 | +* This is a TypeScript extension, officially named `vscode-trace-server`. |
| 9 | +* It is meant as companion to the [vscode-trace-extension][vscode-trace-extension]. |
| 10 | +* It registers `Trace Server:` start/stop commands, for a default instance locally. |
| 11 | +* It depends on the [tsp-typescript-client][client] for server health check purposes. |
| 12 | + |
| 13 | +This extension was started from Code's [guide][guide] and related [sample][sample]. |
| 14 | + |
| 15 | +## Documentation |
| 16 | + |
| 17 | +This README is the usual entry point for documenting this extension. |
| 18 | + |
| 19 | +* One may refer to the [contribution guide](CONTRIBUTING.md) for how to contribute. |
| 20 | +* Please also refer to the [security policy](SECURITY.md) on a need basis. |
| 21 | +* The usual [license description](LICENSE.md) file accompanies these too. |
| 22 | + |
| 23 | +## Build |
| 24 | + |
| 25 | +Run `yarn`, which should automatically include `yarn install`. |
| 26 | + |
| 27 | +* This extension is bundled using `webpack`, originally based on [the guide][guide]. |
| 28 | +* There is only a modest automated CI test suite being run on GitHub |
| 29 | + |
| 30 | +## Test |
| 31 | + |
| 32 | +Run `yarn test` on a need basis. |
| 33 | + |
| 34 | +Alternatively, launch `Extension Tests` under `Run and Debug`. |
| 35 | + |
| 36 | +## Installation |
| 37 | + |
| 38 | +1. After [having built](#build) at least once, run `yarn vsce:package` ([more][vsce]) at will. |
| 39 | +1. [Install][install] the hereby generated `vscode-trace-server-*.vsix` file. |
| 40 | +1. Alternatively, simply launch the packaged extension using `Run Extension`. |
| 41 | +1. Through `Command Palette`, the `Trace Server:` start/stop commands should be available. |
| 42 | + |
| 43 | +This extension can be installed in either one (or many) of: |
| 44 | + |
| 45 | +* [VS Code][code] or [Codium][codium]/Code-OSS, or |
| 46 | +* a [Theia][theia] application such as [Blueprint][blueprint]. |
| 47 | + |
| 48 | +The dependent [Trace Viewer for VSCode][vscode-trace-extension] extension renders a `Trace Server` |
| 49 | +[status bar item][item]. A note: |
| 50 | + |
| 51 | +Reinstalling an amended extension that has the same version requires removing the unpacked extension, found under one of the following folders: |
| 52 | + |
| 53 | +* [Theia Blueprint][blueprint]: extracts installed extensions under `/tmp/vscode-unpacked/`. |
| 54 | +* VSCode: extracts the installed extensions under the user's home, in folder `.vscode/extensions/`. |
| 55 | + |
| 56 | +Alternatively, you may step the extension's version to avoid this issue. |
| 57 | + |
| 58 | +## Debugging |
| 59 | + |
| 60 | +* One may launch the extension using `Run Extension`, to debug it with breakpoints, as usual. |
| 61 | +* The same can be done for tests, launching `Extension Tests` to debug them. |
| 62 | +* The enabled breakpoints get bound only upon exercising the extension. |
| 63 | + |
| 64 | +## Development |
| 65 | + |
| 66 | +The usual [Prettier][prettier] and [ESLint][eslint] combo in VS Code or Codium OSS is used. |
| 67 | + |
| 68 | +* [This matcher][matcher] is also used, since the originally generated extension per [guide]. |
| 69 | +* Markdown gets linted with the (usual) [vscode-markdownlint][markdownlint] extension. |
| 70 | +* [SonarLint][sonarlint] is also assumed while further developing this extension. |
| 71 | + |
| 72 | +These are actual [recommended extensions herein](.vscode/extensions.json). |
| 73 | + |
| 74 | +* Beside using [the extension][prettier], one may run `prettier` from the CLI: |
| 75 | + |
| 76 | +```bash |
| 77 | +# confirm formatting is ok: |
| 78 | +yarn format:check |
| 79 | +# correct the formatting: |
| 80 | +yarn format:write |
| 81 | + |
| 82 | +``` |
| 83 | + |
| 84 | + |
| 85 | +[backlog]: https://github.com/eclipse-cdt-cloud/vscode-trace-extension/issues/15 |
| 86 | +[blueprint]: https://theia-ide.org/docs/blueprint_download |
| 87 | +[client]: https://github.com/eclipse-cdt-cloud/tsp-typescript-client |
| 88 | +[code]: https://code.visualstudio.com |
| 89 | +[codium]: https://vscodium.com |
| 90 | +[eslint]: https://open-vsx.org/extension/dbaeumer/vscode-eslint |
| 91 | +[guide]: https://code.visualstudio.com/api/get-started/your-first-extension |
| 92 | +[install]: https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix |
| 93 | +[item]: https://github.com/eclipse-cdt-cloud/vscode-trace-extension/pull/120 |
| 94 | +[markdownlint]: https://open-vsx.org/extension/DavidAnson/vscode-markdownlint |
| 95 | +[matcher]: https://open-vsx.org/extension/amodio/tsl-problem-matcher |
| 96 | +[prettier]: https://open-vsx.org/extension/esbenp/prettier-vscode |
| 97 | +[sample]: https://github.com/microsoft/vscode-extension-samples/blob/main/helloworld-sample |
| 98 | +[server]: https://git.eclipse.org/r/plugins/gitiles/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/refs/heads/master/trace-server/#running-the-server |
| 99 | +[sonarlint]: https://open-vsx.org/extension/SonarSource/sonarlint-vscode |
| 100 | +[theia]: https://theia-ide.org |
| 101 | +[tsp]: https://github.com/eclipse-cdt-cloud/trace-server-protocol |
| 102 | +[vsce]: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#vsce |
| 103 | +[vscode-trace-extension]: https://github.com/eclipse-cdt-cloud/vscode-trace-extension |
0 commit comments