You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-4Lines changed: 33 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,16 @@ Once the parser is stable, and a robust and scalable data model is implemented,
15
15
At this point however, this is merely a proof of concept for building both a concrete syntax tree and an abstract syntax tree from a potentially malformed PostgreSQL source code. The `postgres_lsp` crate was created only to proof that it works e2e, and is just a very basic language server with semantic highlighting and error diagnostics. Before actual feature development can start, we have to do a bit of groundwork.
16
16
17
17
1._Finish the parser_
18
-
- The parser works, but the enum values for all the different syntax elements and internal conversations are manually written or copied, and, in some places, only cover a few elements required for a simple select statement. To have full coverage without possibilities for a copy and past error, they should be generated from pg_query.rs source code.
19
-
- There are a few cases such as nested and named dollar quoted strings that cause the parser to fail due to limitations of the regex-based lexer. Nothing that is impossible to fix, or requires any change in the approach though.
18
+
- The parser works, but the enum values for all the different syntax elements and internal conversations are manually written or copied, and, in some places, only cover a few elements required for a simple select statement. To have full coverage without possibilities for a copy and paste error, they should be generated from pg_query.rs source code.
19
+
- There are a few cases such as nested and named dollar quoted strings that cause the parser to fail due to limitations of the regex-based lexer. Nothing that is impossible to fix, or requires any fundamental change in the parser though.
20
20
2._Implement a robust and scalable data model_
21
-
- TODO
21
+
- This is still in a research phase
22
+
- A great rationale on the importance of the data model in a language server can be found [here](https://matklad.github.io/2023/05/06/zig-language-server-and-cancellation.html)
23
+
-`rust-analyzer`s [`base-db` crate](https://github.com/rust-lang/rust-analyzer/tree/master/crates/base-db) will serve as a role model
24
+
- The [`salsa`](https://github.com/salsa-rs/salsa) crate will most likely be the underlying data structure
22
25
3._Setup the language server properly_
23
-
- TODO
26
+
- This is still in a research phase
27
+
- Once again `rust-analyzer` will serve as a role model, and we will most likely implement the same queueing and cancellation approach
24
28
4._Implement basic language server features_
25
29
- Semantic Highlighting
26
30
- Syntax Error Diagnostics
@@ -37,7 +41,32 @@ At this point however, this is merely a proof of concept for building both a con
37
41
- Jump to definition
38
42
- ... anything you can think of really
39
43
44
+
## Installation (do not do this yet!)
45
+
46
+
### Neovim
47
+
48
+
Add the postgres_lsp executable to your path, and add the following to your config to use it.
49
+
50
+
```lua
51
+
require('lspconfig.configs').postgres_lsp= {
52
+
default_config= {
53
+
name='postgres_lsp',
54
+
cmd= {'postgres_lsp'},
55
+
filetypes= {'sql'},
56
+
single_file_support=true,
57
+
root_dir=util.root_pattern'root-file.txt'
58
+
}
59
+
}
60
+
61
+
lsp.configure("postgres_lsp", {force_setup=true})
62
+
```
63
+
64
+
## Contributors
65
+
66
+
-[psteinroe](https://github.com/psteinroe)
67
+
40
68
## Acknowledgments
41
69
42
70
-[rust-analyzer](https://github.com/rust-lang/rust-analyzer) for implementing such a robust, well documented, and feature-rich language server. Great place to learn from.
43
71
-[squawk](https://github.com/sbdchd/squawk) and [pganalyze](https://pganalyze.com) for inspiring the use of libg_query.
72
+
-[copple](https://github.com/kiwicopple) for the support and trust.
0 commit comments