-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #505 from googlefonts/merge-fea-rs
Merge fea-rs repo
- Loading branch information
Showing
555 changed files
with
56,709 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
check: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
|
||
- name: rustfmt check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: cargo doc | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: doc | ||
args: --all-features --document-private-items | ||
|
||
clippy-lint: | ||
name: Clippy lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
profile: minimal | ||
override: true | ||
|
||
- name: cargo clippy --all-features | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-features --all-targets -- -D warnings | ||
|
||
- name: cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all-targets --no-default-features -- -D warnings | ||
|
||
test-all-targets: | ||
name: cargo test all-targets | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: getsentry/[email protected] | ||
id: venv | ||
with: | ||
python-version: 3.10.7 | ||
requirement-files: requirements.txt | ||
- run: pip install -r requirements.txt | ||
if: steps.venv.outputs.cache-hit != 'true' | ||
|
||
- name: install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: cargo test all-targets | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --all-targets --all-features | ||
|
||
|
||
test-basic: | ||
name: cargo test basic | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: getsentry/[email protected] | ||
id: venv | ||
with: | ||
python-version: 3.10.7 | ||
requirement-files: requirements.txt | ||
- run: pip install -r requirements.txt | ||
if: steps.venv.outputs.cache-hit != 'true' | ||
|
||
- name: install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: cargo test basic | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ Cargo.lock | |
.venv/ | ||
|
||
.DS_Store | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,6 @@ members = [ | |
"glyphs2fontir", | ||
"ufo2fontir", | ||
"fontc", | ||
"fea-rs", | ||
"fea-lsp", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "fea-lsp" | ||
version = "0.1.0" | ||
edition = "2018" | ||
publish = false | ||
|
||
[dependencies] | ||
fea-rs = {version = "0", path = "../fea-rs"} | ||
lspower = "1.1.0" | ||
tokio = { version = "1.3", features = ["io-std", "io-util", "macros", "net", "rt-multi-thread", "sync", "time"] } | ||
serde_json = "1.0" | ||
anyhow = "1.0" | ||
env_logger = "0.10" | ||
|
||
# cargo-release settings | ||
[package.metadata.release] | ||
release = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# FEA Language Server | ||
|
||
This crate is an experimental [language server][] for Adobe OpenType Feature | ||
files. | ||
|
||
It is an experiment, and not supported or intended for use. | ||
|
||
[language server]: https://microsoft.github.io/language-server-protocol/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules/** | ||
client/node_modules/** | ||
client/out/** | ||
server/node_modules/** | ||
server/out/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/**@type {import('eslint').Linter.Config} */ | ||
// eslint-disable-next-line no-undef | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: [ | ||
'@typescript-eslint', | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
rules: { | ||
'semi': [2, "always"], | ||
'@typescript-eslint/no-unused-vars': 0, | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/explicit-module-boundary-types': 0, | ||
'@typescript-eslint/no-non-null-assertion': 0, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
out | ||
node_modules | ||
client/server | ||
.vscode-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. | ||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp | ||
|
||
// List of extensions which should be recommended for users of this workspace. | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"name": "Launch Client", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}"], | ||
"outFiles": ["${workspaceRoot}/client/out/**/*.js"], | ||
"preLaunchTask": { | ||
"type": "npm", | ||
"script": "watch" | ||
} | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach to Server", | ||
"port": 6009, | ||
"restart": true, | ||
"outFiles": ["${workspaceRoot}/server/out/**/*.js"] | ||
}, | ||
{ | ||
"name": "Language Server E2E Test", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceRoot}", | ||
"--extensionTestsPath=${workspaceRoot}/client/out/test/index", | ||
"${workspaceRoot}/client/testFixture" | ||
], | ||
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"] | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "Client + Server", | ||
"configurations": ["Launch Client", "Attach to Server"] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"editor.insertSpaces": false, | ||
"typescript.tsc.autoDetect": "off", | ||
"typescript.preferences.quoteStyle": "single", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "compile", | ||
"group": "build", | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "never" | ||
}, | ||
"problemMatcher": [ | ||
"$tsc" | ||
] | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"isBackground": true, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"panel": "dedicated", | ||
"reveal": "never" | ||
}, | ||
"problemMatcher": [ | ||
"$tsc-watch" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.vscode/** | ||
**/*.ts | ||
**/*.map | ||
.gitignore | ||
**/tsconfig.json | ||
**/tsconfig.base.json | ||
contributing.md | ||
.travis.yml | ||
client/node_modules/** | ||
!client/node_modules/vscode-jsonrpc/** | ||
!client/node_modules/vscode-languageclient/** | ||
!client/node_modules/vscode-languageserver-protocol/** | ||
!client/node_modules/vscode-languageserver-types/** | ||
!client/node_modules/{minimatch,brace-expansion,concat-map,balanced-match}/** | ||
!client/node_modules/{semver,lru-cache,yallist}/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# VSCode Extension | ||
|
||
This is very hacky and probably not a great experience right now; it was | ||
intended as a proof of concept. Use at your peril. | ||
|
||
|
||
Installation: | ||
|
||
this extension is not published, and has to be run manually. First, you will | ||
need to compile the `fea-lsp` crate in the parent directory, and move the | ||
binary somewhere where you can easily find it, such as `~/.fea-lsp/fea-lsp`. | ||
|
||
Then from from this directory, run: | ||
|
||
```sh | ||
npm install | ||
npm run compile | ||
``` | ||
|
||
Open this directory in VSCode. From the 'run and debug' sidebar, run the 'Launch | ||
Client' command. This will open a new VSCode window with the extenstion enabled. | ||
|
||
To actually make it work, you need to point it the location of the `fea-lsp` | ||
binary you compiled earlier. Open VSCode settings, and search for 'fea'. At the | ||
bottom you should find a setting "fea-lsp > Server: Path", where you can enter | ||
the path to the binary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"comments": { | ||
// symbol used for single line comment. Remove this entry if your language does not support line comments | ||
"lineComment": "#" | ||
}, | ||
// symbols used as brackets | ||
"brackets": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"], | ||
["<", ">"] | ||
], | ||
// symbols that are auto closed when typing | ||
"autoClosingPairs": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"], | ||
["\"", "\""] | ||
], | ||
// symbols that can be used to surround a selection | ||
"surroundingPairs": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"], | ||
["<", ">"], | ||
["\"", "\""] | ||
] | ||
} | ||
|
Oops, something went wrong.