Skip to content

Commit

Permalink
move everything from vscode folder to root
Browse files Browse the repository at this point in the history
  • Loading branch information
rszyma committed Nov 16, 2023
1 parent ae0cc93 commit a5f9a69
Show file tree
Hide file tree
Showing 37 changed files with 111 additions and 260 deletions.
File renamed without changes.
6 changes: 1 addition & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./kls

steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -33,7 +29,7 @@ jobs:

- name: Test with wasm-pack
run: wasm-pack test --headless --firefox

- name: Lint and Format
run: |
rustup component add clippy
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
**/out
yarn-error.log
.vscode
.vscode-test
*.vsix


# A symbolic link to a local development kanata repo for testing changes.
kanata-local
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Change Log

### Unreleased

* no changes yet

### 0.3.0

* Fixed: Unknown key in defsrc while it is defined in deflocalkeys (#3)
* Updated kanata to ef23c68

### 0.2.0

* Invalid deflocalkeys-win and deflocalkeys-wintercept blocks now properly report errors (#1)
* Added missing syntax highlighting,
* Added the same help text as kanata uses to inform users where to look for help,
* Updated kanata submodule to 5dc3296

### 0.1.0

* Added syntax highlighting.
* Added parse errors checking.
* Added support for includes.
* Used kanata-parser version: 3ccbcd1
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

## Building from source

Requirements:
- Latest stable version of Rust with `cargo` available on your system PATH.
- `wasm-pack` 0.12.1+ installed and available on your system PATH.
- VS Code 1.80.0+.

1. Run commands:
```bash
git clone https://github.com/rszyma/vscode-kanata.git &&
cd vscode-kanata &&
git submodule init &&
git submodule update &&
make package
# or alternatively build in release mode:
# make CARGO_FLAGS=--release package
```
2. To install:
- Right click on `kanata.vsix` file in VS Code file explorer and "Install Extension VSIX"...
- ...or run `code --install-extension kanata.vsix` and restart VS Code.


## Bumping version of kanata

This project directly embeds kanata's parser during compilation. It's located in project root in `/kanata`. Any updates to kanata must be manually checked out. The following command bumps version of kanata to the latest commit on [kanata main branch](https://github.com/jtroo/kanata/tree/main):

```bash
git submodule update --remote
```
2 changes: 1 addition & 1 deletion vscode/Makefile → Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package: wasm
CARGO_FLAGS ?= --dev

wasm: clean
$(MAKE) CARGO_FLAGS=$(CARGO_FLAGS) OUT_DIR=$$(pwd)/out -C ../kls build
$(MAKE) CARGO_FLAGS=$(CARGO_FLAGS) OUT_DIR=$$(pwd)/out -C kls build

node_modules: package.json
yarn install
Expand Down
71 changes: 48 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,59 @@
# vscode-kanata
[![GitHub Repo stars](https://img.shields.io/github/stars/rszyma/vscode-kanata)](https://github.com/rszyma/vscode-kanata)
[![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/rszyma.vscode-kanata)](https://marketplace.visualstudio.com/items?itemName=rszyma.vscode-kanata)

A VS Code extension that adds language support for [kanata](https://github.com/jtroo/kanata) configuration files .
A VS Code extension that adds language support for [kanata](https://github.com/jtroo/kanata) configuration files.

### Features
## Features

A list of features is available [here](./vscode/README.md#features)
Kanata config files are detected by `.kbd` file extension.

### Installing from source
### Syntax highlighting

Requirements:
- Latest stable version of Rust with `cargo` available on your system PATH.
- `wasm-pack` 0.12.1+ installed and available on your system PATH.
- VS Code 1.80.0+.
keywords, action identifiers, alias handles etc.

1. Run commands:
```bash
git clone https://github.com/rszyma/vscode-kanata.git &&
cd vscode-kanata &&
git submodule init &&
git submodule update &&
cd vscode &&
make package
# or alternatively build in release mode:
# make CARGO_FLAGS=--release package
```
2. To install:
- Right click on `kanata.vsix` file in VS Code file explorer and "Install Extension VSIX"...
- ...or run `code --install-extension kanata.vsix` and restart VS Code.
<p><img src="assets/syntax-highlighting-showcase.png"/></p>

### Credits
### Checking for config errors

Config will be parsed and validated, when saving document.

<p><img src="assets/config-parsing-showcase.gif"/></p>

Note: kanata parser is embedded directly in this extension, so it might happen
that this extension don't yet support the latest features of kanata. Version bumps of
kanata are usually done every release and indicated in [change log](/CHANGELOG.md).

### Support for including other files

If you use [`include`](https://github.com/jtroo/kanata/blob/main/docs/config.adoc#include-other-files)
configuration items in your kanata config, make sure to adjust the following settings:
- `vscode-kanata.includesAndWorkspaces`
- `vscode-kanata.mainConfigFile`

Important: Absolute paths in `include` blocks that point outside the opened workspace aren't supported.

Also, if you work with multiple main files, and find yourself switching `mainConfigFile` often,
there's a handy command palette entry:
- `Kanata: Set current file as main`

## Contributing

Contributions are welcome, feel free to open an issue or a PR.

### Bug reports

If you encounter a bug, please report it here: https://github.com/rszyma/vscode-kanata/issues

### Building

See [this document](CONTRIBUTING.md) for build instructions.

## Release notes

See the [change log](CHANGELOG.md).

## Credits

- https://github.com/jtroo/kanata/ - provides kanata-parser crate
- https://github.com/osohq/oso - used this as vscode extension template (with a lot of things removed)
Expand Down
Binary file added assets/config-parsing-showcase.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added assets/syntax-highlighting-showcase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion kls/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions kls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kls"
version = "0.3.0"
version = "0.0.0"
authors = ["rszyma <[email protected]>"]
description = "Language server for kanata keyboard remapper"
keywords = ["kanata", "lsp", "vscode"]
Expand All @@ -20,7 +20,7 @@ bench = false
# Uncomment below and comment out above for testing local changes.
# Otherwise any changes to the local files will not reflect in the compiled
# binary.
kanata-parser = { path = "../kanata/parser" }
kanata-parser = { path = "../kanata-local/parser" }

console_error_panic_hook = "0.1.6"
js-sys = "0.3.53"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion vscode/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"displayName": "Kanata Configuration Language",
"author": "rszyma",
"publisher": "rszyma",
"icon": "kanata_icon.png",
"icon": "assets/kanata_icon.png",
"description": "Language support for kanata configuration files",
"keywords": [
"kanata",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions vscode/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions vscode/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions vscode/.prettierrc.js

This file was deleted.

13 changes: 0 additions & 13 deletions vscode/.vscodeignore

This file was deleted.

1 change: 0 additions & 1 deletion vscode/.yarnrc

This file was deleted.

Loading

0 comments on commit a5f9a69

Please sign in to comment.