-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9fad4a9
commit af85225
Showing
5 changed files
with
89 additions
and
20 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
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 |
---|---|---|
@@ -1,24 +1,36 @@ | ||
![Test](https://github.com/DanielHauge/ebnf-lsp/actions/workflows/rust.yml/badge.svg) | ||
|
||
# EBNF Lsp | ||
# EBNFER | ||
|
||
An implementation of the language server protocol (LSP) for EBNF grammars. | ||
|
||
## Features | ||
|
||
- [x] Syntax error diagnostics | ||
- [x] Hover information | ||
- [x] Multi definitions handling | ||
- [X] Semantic tokens (Root rule) | ||
- [x] Diagnostics | ||
- [x] Hover | ||
- [x] References | ||
- [x] Completion | ||
- [X] Semantic tokens Root rule | ||
- [x] Document formatting | ||
- [x] Rename | ||
- [x] Go to definition | ||
- [x] Multi definition hover information | ||
- [x] Document symbols | ||
- [x] supress unused diagnostics rule | ||
- [x] Code actions | ||
- [ ] General document highlighting | ||
- [x] Code actions (supress unused warning) | ||
|
||
## Installation | ||
|
||
Build from source or install via cargo: | ||
|
||
## Roadmap features | ||
```bash | ||
cargo install ebnfer | ||
``` | ||
|
||
## Further development | ||
|
||
- [ ] Vs Code extension - w. general document highlighting | ||
- [ ] Workspace support - multiple files | ||
|
||
## Inspired | ||
|
||
This project is inspired by the ebnf analysis crate on crates.io - [ebnf](https://github.com/RubixDev/ebnf). | ||
Also inspired by the following youtube video: [Learn By Building: Language Server Protocol - TJ Devries](https://www.youtube.com/watch?v=YsdlcQoHqPY). |
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
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 |
---|---|---|
@@ -1,3 +1,56 @@ | ||
World = "World!"; | ||
Hello = "Hello"; | ||
Hello_There = Hello , ' ' , World; | ||
Program = { Statement } ; | ||
Statement = { Assignment | ||
| IfStatement | ||
| WhileStatement | ||
| PrintStatement | ||
| BlockStatement } ; | ||
Assignment = Identifier | ||
, '=' | ||
, ExpressionTwo | ||
, ';' ; | ||
IfStatement = 'if' | ||
, ExpressionTwo | ||
, BlockStatement | ||
, [ 'else' | ||
, BlockStatement ] ; | ||
(* #[allow(unused)] *) | ||
Unused = 'Hello' ; | ||
WhileStatement = 'while' | ||
, ExpressionTwo | ||
, BlockStatement ; | ||
PrintStatement = 'print' | ||
, ExpressionTwo | ||
, ';' ; | ||
BlockStatement = '{' | ||
, { Statement } | ||
, '}' ; | ||
Identifier = [ 'a' - 'z' | ||
| 'A' - 'Z' ] | ||
, { [ 'a' - 'z' | ||
| 'A' - 'Z' | ||
| '0' - '9' ] } ; | ||
(* #[allow(unused)] *) | ||
NotUsed = 'Hello' ; | ||
ExpressionTwo = Term | ||
| ExpressionTwo | ||
, '+' | ||
, Term ; | ||
Term = Factor | ||
| Term | ||
, '*' | ||
, Factor ; | ||
Factor = Identifier | ||
| Number | ||
| '(' | ||
, ExpressionTwo | ||
, ')' ; | ||
Number = [ '0' - '9' ] | ||
, { [ '0' - '9' ] } ; |
This file was deleted.
Oops, something went wrong.