Skip to content

Commit

Permalink
Switch to using WASM files for tree-sitter parsing (#6)
Browse files Browse the repository at this point in the history
* Remove dependency on native OpenFOAM parser

- Allows running in environments where OpenFOAM is not installed
- Full dependency on Tree-Sitter grammar for implementing basic LSP
  features

* Switch to using own version of tree-sitter

* Use upgraded tree-sitter

* Basic support for workspace symbols

* Basic support for workspace diagnostics

* Update README

* Update package-lock

* Add textdocument to deps

* Fix when keywords auto-completion is triggered

* Upgrade deps

* Switch to using  backend

* Correct package.json

* Update package-lock.json
  • Loading branch information
FoamScience authored Jan 6, 2022
1 parent d4cc6b0 commit 2cda8ff
Show file tree
Hide file tree
Showing 19 changed files with 8,544 additions and 353 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build & Test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm install
- run: npm test
38 changes: 38 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish package to NPM

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ We're supporting the following features (`*` for partial or limited support):
- [x] Common keywords `*`
- [x] Snippets (with documentation) `*`
- [ ] Valid entries based on the "Banana Trick" `?`
- **Document symbols** [Complete, works on a single file]
- **Document symbols** [Complete]
- [x] Uses the Tree-Sitter grammar for OpenFOAM
- [x] Can penetrate lists and peek inside
- [x] Workspace-wide symbols
- **Jump to Definition** [Complete, works on a single file]
- [x] Macro expansion of absolute paths
- [x] Macro expansion of dictionary-relative paths
Expand All @@ -29,7 +30,7 @@ We're supporting the following features (`*` for partial or limited support):
- **Diagnostics** [Not fully implemented Yet,]
- [x] Can handle most default `FATAL ERROR`s and `FATAL IO ERROR`s
- [x] Needs to run the solver, so you'll get one error at a time
- [ ] Workspace-wide
- [x] Workspace-wide
- [ ] Support for warnings
- [ ] Custom error regular expressions

Expand Down Expand Up @@ -89,7 +90,7 @@ give up some features for things to work on other editors.
### Can I run it on Windows?

Sure, you can. It's basically a piece of C++/JavaScript technology which has nothing to
do with OpenFOAM code base (other parsing than its file format, of course).
do with OpenFOAM code base (other than parsing its file format, of course).

Currently the only feature which has a slim chance of working on Windows
is the "diagnostics" feature, because it needs to fire the case's solver to see if it errors
Expand Down
Binary file added languages/foam.wasm
Binary file not shown.
Loading

0 comments on commit 2cda8ff

Please sign in to comment.