Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial implementation of the sprocket extension. #1

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Packaged extensions
*.vsix
5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
11 changes: 11 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
112 changes: 110 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,111 @@
# Sprocket VS Code extension
# Sprocket VS Code Extension

More coming soon!
This Visual Studio Code extension provides support for the [Workflow Description Language](https://openwdl.org/).

## Prerequisites

### Setup

To build the extension, Node.js, `npm`, and `yarn` must be installed.

To install Node.js, follow [these instructions](https://nodejs.org/en/download/package-manager/current).

To install `yarn`, run the following command:

```bash
npm install -g yarn
```

Finally, install the project dependencies by running the following command:

```bash
yarn install
```

Ensure the Yarn binaries directory is on your path by adding the following to
your shell profile:

```bash
export PATH="$(yarn global bin):$PATH"
```

### Building

To build the extension, run the following command:

```bash
yarn compile
```

This command will automatically be run when you start the extension in the
development environment or when packaging the extension.

### Running

To run the extension, you must have the `sprocket` command line tool installed
on your PATH.

To install `sprocket`, ensure you a [Rust Toolchain](https://rustup.rs/)
installed.

With Rust installed, you can install `sprocket` using the following command:

```bash
cargo install --git https://github.com/stjude-rust-labs/sprocket
```

Alternatively, a path to the `sprocket` binary can be provided in the extension
by setting the `sprocket.server.path` configuration option.

## Features

- Syntax highlighting
- Document and workspace diagnostics

***More features will be added in the future.***

## Running The Development Extension

To run the extension, open this directory in VS Code and press `F5`.

This will open a new VS Code window with the extension automatically loaded.

## Installing The Extension

To install the extension, you can package it as a `.vsix` file and install it.

To package the extension, install the `vsce` tool:

```
yarn global add @vscode/vsce
```

Then package the extension by running:

```bash
vsce package --yarn
```

This will generate a `sprocket-vscode-<version>.vsix` file that you can install in VS Code using the `Extensions: install from VSIX` command.

# Known Issues

- The extension is in an early stage of development and may not work as
expected.
- The extension requires a separate installation of the `sprocket` command line
tool; in the future, the extension will automatically install the tool.
- When `sprocket` unexpectedly terminates, the extension does not automatically
restart it and you must manually restart the extension host to recover from
the error; this will change in the future as the extension becomes more
stable.

# Configuration

The extension provides the following configuration options:

- `sprocket.server.path`: The path to the `sprocket` command line tool. By
default, the extension assumes that `sprocket` is on your PATH.
- `sprocket.server.verbose`: Passes the `--verbose` flag to `sprocket` when
running it.
- `sprocket.server.lint`: Passes the `--lint` flag to `sprocket` when running
it; this enables additional linting checks that are not enabled by default.
Loading