Skip to content

Commit

Permalink
Reviewed input method, launch.json, ts build config, color themes
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaprieto committed Dec 16, 2022
1 parent 4ac22e4 commit acc1953
Show file tree
Hide file tree
Showing 28 changed files with 4,056 additions and 5,655 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescriptno-unused-vars': 'off',
'@typescript-eslint/no-explitcit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'header/header': [
'error',
'block',
Expand Down
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
}
16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,21 @@
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: build"
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
}
]
}
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// 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
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
Expand Down
37 changes: 37 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// 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": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": ["npm: watch", "npm: watch-tests"],
"problemMatcher": []
}
]
}
14 changes: 10 additions & 4 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
.vscode/**
.vscode-test/**
test/**
!out/extension.js
node_modules/**
src/**
.gitignore
.yarnrc
webpack.config.js
vsc-extension-quickstart.md
**/jsconfig.json
**/tsconfig.json
**/.eslintrc.json
node_modules
src/**
**/*.map
**/*.ts
checklist.md
HACKING.md
13 changes: 13 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ and let it run in the current VSCode instance.
npm run watch
```

Also, make sure to run the following command to install the dependencies.

```bash
npm install
```

Now, with the `vscode-juvix` folder open in VSCode, press `F5` to start a new VSCode instance with the extension loaded. The extension will be reloaded automatically on changes. If not, you can press '`' to load the changes.

On the client side, the Juvix plugin will create an output channel called `Juvix` where you can see the output of the extension.
Expand All @@ -31,6 +37,13 @@ vsce package

This will create a `.vsix` file in the root directory of the project. You can install this file in VSCode by pressing `F1` and typing `Extensions: Install from VSIX...`.

Not forgetting to update the version in the `package.json` file. Note that the version must be in the format `x.x.x` where `x` is a number. For example, `0.0.1`.
Tag the corresponding commit with the version number.

```bash
git tag vX.X.X
```

## Publishing

The following steps assume that you have a publisher account.
Expand Down
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# Juvix Plugin for VSCode

This extension provides support for the Juvix programming language.
This VS Code extension provides support for [Juvix Lang](https://github.com/anoma/juvix).

<p align="center">
<img src="https://github.com/anoma/vscode-juvix/raw/main/assets/juvix-vscode-extension.png" >
</p>

## Quick start

Find "Juvix" in the VSCode marketplace and install it. Otherwise, launch VS Code Quick Open (<kbd>Ctrl</kbd><kbd>P</kbd>), paste the following command, and press enter.
Find "Juvix" in the VSCode marketplace and install it. Otherwise, launch VS Code Quick Open (<kbd>Ctrl</kbd><kbd>P</kbd>), and paste the following command followed by pressing enter.

```
ext install heliax.juvix-mode
```

## Juvix main commands
## Pre-requisites

To be able to use the extension, you need to have the latest binary of Juvix installed. You can find detailed installation instructions [here](https://docs.juvix.org/#installation). If you are using MacOS, you can install Juvix using Homebrew.

```bash
brew tap anoma/juvix
brew install juvix
```

Once you have Juvix installed, you can check the version by running the following command.

```bash
juvix --version
```

## Usage

The extension provides semantic syntax highlighting for Juvix files. It also provides a command palette with the following commands. You must edit Juvix files within a workspace folder. Otherwise, the extension will not work properly.

| Command | Keymap |
| :-------- | :---------------------: |
Expand All @@ -23,8 +40,18 @@ ext install heliax.juvix-mode
| run | <kbd>Ctrl+Shift+R</kbd> |
| doctor | <kbd>Ctrl+Shift+D</kbd> |

Find out other commands in the Command Pallete.
Find out other commands in the Command Pallete (press <kbd>Ctrl</kbd><kbd>P</kbd>
and type `Juvix` to see all the related commands).

## Configuration

This extension provides configurations using the VSCode's configuration UI settings.

## Features

- Command palette with typechecking, compilation, and running Juvix files.
- Semantic syntax highlighting.
- Support for light and dark themes.
- Support for Unicode input (e.g. λ, Π, Σ, etc.), as pressing <kbd>\</kbd> + `alpha` to type α.
- Support for user configuration options.
- Support for Juvix's REPL (coming soon).
Binary file modified assets/juvix-vscode-extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit acc1953

Please sign in to comment.