Skip to content

Commit d4e971e

Browse files
authoredAug 6, 2023
Merge pull request #16 from supabase/feat/add-init-vscode-extension
feat: initial version of vscode extension
2 parents 3e796ba + 8d02bb4 commit d4e971e

20 files changed

+4555
-5
lines changed
 

‎.cargo/config.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

‎Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[workspace]
22
members = [
33
"crates/*",
4+
"xtask/"
45
]
56

7+
[workspace.package]
8+
rust-version = "1.71"
9+
610
[workspace.dependencies]
711
parser = { path = "./crates/parser", version = "0.0.0" }
812
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
9-
10-

‎README.md

+20-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ This is a proof of concept for building both a concrete syntax tree and an abstr
6161

6262
## Installation
6363

64-
```diff
65-
- This is not ready for production use. Only install this if you want to help with development. -
66-
```
64+
> [!WARNING]
65+
> This is not ready for production use. Only install this if you want to help with development.
6766
6867
### Neovim
6968

@@ -83,6 +82,24 @@ require('lspconfig.configs').postgres_lsp = {
8382
lsp.configure("postgres_lsp", {force_setup = true})
8483
```
8584

85+
### Building from source
86+
87+
You'll need Cargo, Node, and npm installed.
88+
89+
If you are using VS Code, you can install both the server and the client extension by running:
90+
91+
``` sh
92+
cargo xtask install
93+
```
94+
95+
If you're not using VS Code, you can install the server by running:
96+
97+
``` sh
98+
cargo xtask install --server
99+
```
100+
101+
The server binary will be installed in `.cargo/bin`. Make sure that `.cargo/bin` is in `$PATH`.
102+
86103
## Contributors
87104

88105
- [psteinroe](https://github.com/psteinroe) (Maintainer)

‎editors/code/.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.eslintrc.js

‎editors/code/.eslintrc.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = {
2+
env: {
3+
es6: true,
4+
node: true,
5+
},
6+
extends: ["prettier"],
7+
parser: "@typescript-eslint/parser",
8+
parserOptions: {
9+
project: true,
10+
tsconfigRootDir: __dirname,
11+
sourceType: "module",
12+
},
13+
plugins: ["@typescript-eslint"],
14+
rules: {
15+
camelcase: ["error"],
16+
eqeqeq: ["error", "always", { null: "ignore" }],
17+
curly: ["error", "multi-line"],
18+
"no-console": ["error", { allow: ["warn", "error"] }],
19+
"prefer-const": "error",
20+
"@typescript-eslint/member-delimiter-style": [
21+
"error",
22+
{
23+
multiline: {
24+
delimiter: "semi",
25+
requireLast: true,
26+
},
27+
singleline: {
28+
delimiter: "semi",
29+
requireLast: false,
30+
},
31+
},
32+
],
33+
"@typescript-eslint/semi": ["error", "always"],
34+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
35+
"@typescript-eslint/no-floating-promises": "error",
36+
37+
"@typescript-eslint/consistent-type-imports": [
38+
"error",
39+
{
40+
prefer: "type-imports",
41+
fixStyle: "inline-type-imports",
42+
},
43+
],
44+
"@typescript-eslint/no-import-type-side-effects": "error",
45+
},
46+
};

‎editors/code/.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
out
2+
node_modules
3+
server
4+
.vscode-test/
5+
*.vsix
6+
bundle
7+
vscode.proposed.d.ts

‎editors/code/.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vscode-test
3+
out

‎editors/code/.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
// use 100 because it's Rustfmt's default
3+
// https://rust-lang.github.io/rustfmt/?version=v1.4.38&search=#max_width
4+
printWidth: 100,
5+
};

‎editors/code/.vscodeignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
**
2+
!icon.png
3+
!language-configuration.json
4+
!LICENSE
5+
!node_modules/@hpcc-js/wasm/dist/graphvizlib.wasm
6+
!node_modules/@hpcc-js/wasm/dist/index.min.js
7+
!node_modules/d3-graphviz/build/d3-graphviz.min.js
8+
!node_modules/d3/dist/d3.min.js
9+
!out/main.js
10+
!package-lock.json
11+
!package.json
12+
!ra_syntax_tree.tmGrammar.json
13+
!server
14+
!README.md

‎editors/code/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Philipp Steinrötter
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎editors/code/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# postgres_lsp for VSCode
2+
3+
This extension provides VSCode support for `postgres_lsp`.

0 commit comments

Comments
 (0)
Please sign in to comment.