Files
vscode-extension-samples/codelens-sample/README.md

33 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2018-10-16 19:31:54 -03:00
# CodeLens Sample
This is a sample extension that shows the usage of the CodeLens API.
It is not intended as a production quality extension.
- Create a new file
- Write anything
- Click on the CodeLens for action example
2022-04-23 23:21:11 +09:00
- Can be enabled or disabled by command palette
2018-10-16 19:31:54 -03:00
2019-10-03 16:02:43 -03:00
## Demo
2018-10-16 19:31:54 -03:00
2019-10-03 16:02:43 -03:00
![demo](demo.gif)
2018-10-16 19:31:54 -03:00
2019-10-03 16:02:43 -03:00
## VS Code API
2018-10-16 19:31:54 -03:00
2019-10-03 16:54:55 -03:00
### `languages` module
2019-10-03 16:02:43 -03:00
2019-10-03 16:54:55 -03:00
- [`languages.registerCodeLensProvider`](https://code.visualstudio.com/api/references/vscode-api#languages.registerCodeLensProvider)
2019-10-03 16:02:43 -03:00
### CodeLens Provider
2019-10-03 16:54:55 -03:00
- [`CodeLensProvider`](https://code.visualstudio.com/api/references/vscode-api#CodeLensProvider)
2019-10-03 16:02:43 -03:00
- [`CodeLensProvider.provideCodeLenses`](https://code.visualstudio.com/api/references/vscode-api#CodeLensProvider.provideCodeLenses)
- [`CodeLensProvider.resolveCodeLens`](https://code.visualstudio.com/api/references/vscode-api#CodeLensProvider.resolveCodeLens)
## Running the Sample
- Run `npm install` in terminal to install dependencies
- Run the `Run Extension` target in the Debug View. This will:
- Start a task `npm: watch` to compile the code
- Run the extension in a new VS Code window