Skip to content

Commit

Permalink
Bring back VS Code extension from before #85
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Dec 29, 2023
1 parent 376c686 commit c7676b3
Show file tree
Hide file tree
Showing 12 changed files with 1,632 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.DS_Store
*.tgz
*.vsix
/packages/core/README.md
/packages/vscode/*.png
dist/
node_modules/
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ Or, if you want to host on your local network, e.g. to test on your phone:
make site-deps && npm run --workspace=@rose-lang/site dev -- --host
```

## VS Code

The VS Code extension is built as part of `make` or `make all`, but you can also
just build it by itself:

```sh
make vscode
```

Then `packages/vscode` will contain a `*.vsix` file that you can install in VS
Code by right-clicking it and clicking the **Install Extension VSIX** button.

[git]: https://git-scm.com/downloads
[make]: https://en.wikipedia.org/wiki/Make_(software)
[node]: https://nodejs.org/en/download
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ prettier: npm
npx prettier --check .

# build `packages/`
packages: core site
packages: core site vscode

# run JavaScript tests
test-js: test-core test-site
Expand All @@ -50,3 +50,17 @@ site: site-deps
# test
test-site: site-deps
npm run --workspace=@rose-lang/site test -- run --no-threads

## `packages/vscode`

# fetch encircled icon
packages/vscode/encircled-rose.png:
node fetch.js https://github.com/rose-lang/rose-icons/raw/efcc218832d65970a47bed597ee11cecd3d1cc3c/png/encircled-rose.png $@

# fetch plain icon
packages/vscode/plain-rose.png:
node fetch.js https://github.com/rose-lang/rose-icons/raw/efcc218832d65970a47bed597ee11cecd3d1cc3c/png/plain-rose.png $@

# build
vscode: npm packages/vscode/encircled-rose.png packages/vscode/plain-rose.png
npm run --workspace=rose-vscode build
5 changes: 5 additions & 0 deletions fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as fs from "fs/promises";
import fetch from "node-fetch";

const [url, path] = process.argv.slice(2);
await fs.writeFile(path, Buffer.from(await (await fetch(url)).arrayBuffer()));
Loading

0 comments on commit c7676b3

Please sign in to comment.