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
+15-39Lines changed: 15 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,24 @@ A Language Server for Postgres. Not SQL with flavors, just Postgres.
6
6
7
7
## Status
8
8
9
-
🚧 This is in active development and is only ready for collaborators. The majority of work is still ahead, but we've verified that the approach works. We're making this public so that we can develop it in the open with input from the community.
9
+
🚧 This is in active development and is only ready for collaborators. You can find the current roadmap and opportunities to contribute in https://github.com/supabase-community/postgres_lsp/issues/136.
10
10
11
11
## Features
12
12
13
13
The [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) is an open protocol between code editors and servers to provide code intelligence tools such as code completion and syntax highlighting. This project implements such a language server for Postgres, significantly enhancing the developer experience within your favorite editor by adding:
14
14
15
-
- Semantic Highlighting
15
+
- Lint
16
+
- Hover
17
+
- Typechecking
16
18
- Syntax Error Diagnostics
17
-
-Show SQL comments on hover
19
+
-Inlay Hints
18
20
- Auto-Completion
19
21
- Code actions such as `Execute the statement under the cursor`, or `Execute the current file`
20
-
-Configurable Code Formatting
22
+
-Formatter
21
23
- ... and many more
22
24
25
+
We plan to support all of the above for SQL and PL/pgSQL function bodies too!
26
+
23
27
## Motivation
24
28
25
29
Despite the rising popularity of Postgres, support for the PL/pgSQL in IDEs and editors is limited. While there are some _generic_ SQL Language Servers[^1] offering the Postgres syntax as a "flavor" within the parser, they usually fall short due to the ever-evolving and complex syntax of PostgreSQL. There are a few proprietary IDEs[^2] that work well, but the features are only available within the respective IDE.
@@ -28,39 +32,14 @@ This Language Server is designed to support Postgres, and only Postgres. The ser
28
32
29
33
Once the parser is stable, and a robust and scalable data model is implemented, the language server will not only provide basic features such as semantic highlighting, code completion and syntax error diagnostics, but also serve as the user interface for all the great tooling of the Postgres ecosystem.
30
34
31
-
## Roadmap
32
-
33
-
This is 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 to prove that it works end-to-end, and is just a very basic language server with semantic highlighting and error diagnostics. Before further feature development, we have to complete a bit of groundwork:
34
-
35
-
1._Finish the parser_
36
-
- ✅ The core parser algorithm is implemented. Check out [this blog post](https://supabase.com/blog/postgres-language-server-implementing-parser) for details.
37
-
- 🚧 But we need help from the community to finalize it: https://github.com/supabase/postgres_lsp/issues/51.
38
-
2._Implement a robust and scalable data model_
39
-
- RFC posted here https://github.com/supabase/postgres_lsp/discussions/107
40
-
3._Setup the language server properly_
41
-
- This is still in a research phase
42
-
- Once again `rust-analyzer` will serve as a role model, and we will most likely implement the same queueing and cancellation approach
43
-
4._Implement basic language server features_
44
-
- Semantic Highlighting
45
-
- Syntax Error Diagnostics
46
-
- Show SQL comments on hover
47
-
- Auto-Completion
48
-
- Code Actions, such as `Execute the statement under the cursor`, or `Execute the current file`
49
-
- ... anything you can think of really
50
-
5._Integrate all the existing open source tooling_
51
-
- Show migration file lint errors from [squawk](https://github.com/sbdchd/squawk)
52
-
- Show plpsql lint errors from [plpgsql_check](https://github.com/okbob/plpgsql_check)
53
-
6._Build missing pieces_
54
-
- An optionated code formatter (think prettier for PostgreSQL)
55
-
7._(Maybe) Support advanced features with declarative schema management_
56
-
- Jump to definition
57
-
- ... anything you can think of really
58
-
59
35
## Installation
60
36
61
37
> [!WARNING]
62
38
> This is not ready for production use. Only install this if you want to help with development.
63
39
40
+
> [!NOTE]
41
+
> Interested in setting up a release process and client extensions for Neovim and VS Code? Please check out https://github.com/supabase-community/postgres_lsp/issues/136!
42
+
64
43
### Neovim
65
44
66
45
Add the postgres_lsp executable to your path, and add the following to your config to use it.
-[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.
124
-
-[squawk](https://github.com/sbdchd/squawk) and [pganalyze](https://pganalyze.com) for inspiring the use of libpg_query.
0 commit comments