Skip to content

Commit

Permalink
chore: update readme for VSCode extension (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Apr 13, 2024
1 parent 97b8117 commit b32c979
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 25 deletions.
35 changes: 35 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,41 @@ switch t := t.(type) {

Then when a new case is added to the sum type, `go-check-sumtype` will detect the missing case statically.

## VSCode extension

The preferred way to develop the FTL VSCode extension is to open a VSCode instance in the `extensions/vscode` directory. This will load the extension in a new VSCode window. From there, the `launch.json` and `tasks.json` files are configured to run the extension in a new window.

## Building the extension

```bash
just build-extension
```

## Packaging the extension

To package the extension, run:

```bash
just package-extension
```

This will create a `.vsix` file in the `extensions/vscode` directory.

## Publishing the extension

To publish the extension, run:

```bash
just publish-extension
```

This will publish the extension to the FTL marketplace. This command will require you to have a Personal Access Token (PAT) with the `Marketplace` scope. You can create a PAT [here](https://dev.azure.com/ftl-org/_usersSettings/tokens).

## Useful links

- [VSCode extension samples](https://github.com/microsoft/vscode-extension-samples)
- [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)

## Communications

### Issues
Expand Down
49 changes: 25 additions & 24 deletions extensions/vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
# FTL VSCode extension
# FTL for Visual Studio Code

## Getting started
[The VS Code FTL extension](https://marketplace.visualstudio.com/items?itemName=FTL.ftl)
provides support for
[FTL](https://github.com/TBD54566975/ftl) within VSCode including LSP integration and useful commands for manageing FTL projects.

Within the FTL.vscode-workspace, select the `VSCode Extensions` workspace. Select "Run and Debug" on the activity bar, then select `Run Extension`. This will open a new VSCode window with the extension running.
## Requirements

In the extension development host, open an FTL project (with `ftl-project.toml` or `ftl.toml` files).
- FTL 0.169.0 or newer

If you get any errors, you might need to build the extension first (see below).
## Quick Start

## Building the extension
1. Install [FTL](https://github.com/TBD54566975/ftl) 0.169.0 or newer.

We use `just` for our command line tasks. To build the extension, run:
```bash
just build-extension
```
2. Install this extension.

## Packaging the extension
3. Open any FTL project with a `ftl-project.toml` or `ftl.toml` file.

To package the extension, run:
```bash
just package-extension
```
4. The extension will automatically activate and provide support for FTL projects.

This will create a `.vsix` file in the `extensions/vscode` directory.
> [!IMPORTANT]
> If you have installed FTL with hermit (or other dependency management tools), you may need to specify the path to the FTL binary in the extension settings.
## Publishing the extension
Example:

To publish the extension, run:
```bash
just publish-extension
```json
{
"ftl.executablePath": "bin/ftl"
}
```

This will publish the extension to the FTL marketplace. This command will require you to have a Personal Access Token (PAT) with the `Marketplace` scope. You can create a PAT [here](https://dev.azure.com/ftl-org/_usersSettings/tokens).
You can also configure additional command line arguments for the FTL binary in the settings.

## Useful links
Example:

- [VSCode extension samples](https://github.com/microsoft/vscode-extension-samples)
- [Extension Guidelines](https://code.visualstudio.com/api/references/extension-guidelines)
```json
{
"ftl.devCommandFlags": ["--recreate", "--parallelism=4"]
}
```
2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "FTL",
"publisher": "ftl",
"description": "VSCode extension for FTL",
"version": "0.0.1",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "https://github.com/TBD54566975/ftl-vscode"
Expand Down

0 comments on commit b32c979

Please sign in to comment.