Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: supabase-community/postgres-language-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: refs/heads/fix/logs
Choose a base ref
...
head repository: supabase-community/postgres-language-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 4,159 additions and 1,071 deletions.
  1. +0 −1 .github/workflows/publish.reusable.yml
  2. +47 −21 .github/workflows/pull_request.yml
  3. +14 −10 .github/workflows/release.yml
  4. +167 −3 Cargo.lock
  5. +1 −8 Cargo.toml
  6. +1 −0 README.md
  7. +3 −3 cliff.toml
  8. +0 −4 crates/pgt_cli/src/cli_options.rs
  9. +0 −1 crates/pgt_cli/src/commands/mod.rs
  10. +4 −5 crates/pgt_cli/src/execute/mod.rs
  11. +6 −0 crates/pgt_completions/Cargo.toml
  12. +249 −0 crates/pgt_completions/benches/sanitization.rs
  13. +72 −27 crates/pgt_completions/src/builder.rs
  14. +12 −4 crates/pgt_completions/src/complete.rs
  15. +139 −65 crates/pgt_completions/src/context.rs
  16. +36 −1 crates/pgt_completions/src/item.rs
  17. +2 −0 crates/pgt_completions/src/lib.rs
  18. +185 −11 crates/pgt_completions/src/providers/columns.rs
  19. +13 −6 crates/pgt_completions/src/providers/functions.rs
  20. +25 −0 crates/pgt_completions/src/providers/helper.rs
  21. +3 −0 crates/pgt_completions/src/providers/mod.rs
  22. +104 −0 crates/pgt_completions/src/providers/schemas.rs
  23. +111 −11 crates/pgt_completions/src/providers/tables.rs
  24. +4 −180 crates/pgt_completions/src/relevance.rs
  25. +115 −0 crates/pgt_completions/src/relevance/filtering.rs
  26. +211 −0 crates/pgt_completions/src/relevance/scoring.rs
  27. +320 −0 crates/pgt_completions/src/sanitization.rs
  28. +119 −7 crates/pgt_completions/src/test_helper.rs
  29. +8 −0 crates/pgt_configuration/src/database.rs
  30. +2 −1 crates/pgt_configuration/src/lib.rs
  31. +3 −2 crates/pgt_lexer/src/lib.rs
  32. +1 −1 crates/pgt_lsp/src/capabilities.rs
  33. +7 −6 crates/pgt_lsp/src/handlers/code_actions.rs
  34. +20 −9 crates/pgt_lsp/src/handlers/completions.rs
  35. +3 −12 crates/pgt_lsp/src/handlers/text_document.rs
  36. +0 −1 crates/pgt_lsp/src/session.rs
  37. +134 −2 crates/pgt_lsp/tests/server.rs
  38. +1 −0 crates/pgt_schema_cache/src/lib.rs
  39. +3 −3 crates/pgt_schema_cache/src/schemas.rs
  40. +65 −3 crates/pgt_statement_splitter/src/lib.rs
  41. +131 −113 crates/pgt_statement_splitter/src/parser.rs
  42. +84 −7 crates/pgt_statement_splitter/src/parser/common.rs
  43. +3 −1 crates/pgt_statement_splitter/src/parser/dml.rs
  44. +7 −0 crates/pgt_statement_splitter/tests/data/simple_union__4.sql
  45. +18 −0 crates/pgt_text_size/src/range.rs
  46. +9 −11 crates/pgt_typecheck/src/diagnostics.rs
  47. +10 −12 crates/pgt_typecheck/src/lib.rs
  48. +3 −3 crates/pgt_typecheck/tests/diagnostics.rs
  49. +1 −0 crates/pgt_workspace/Cargo.toml
  50. +7 −6 crates/pgt_workspace/src/configuration.rs
  51. +0 −1 crates/pgt_workspace/src/features/code_actions.rs
  52. +157 −1 crates/pgt_workspace/src/features/completions.rs
  53. +19 −8 crates/pgt_workspace/src/settings.rs
  54. +2 −2 crates/pgt_workspace/src/workspace.rs
  55. +158 −224 crates/pgt_workspace/src/workspace/server.rs
  56. +87 −0 crates/pgt_workspace/src/workspace/server/annotation.rs
  57. +456 −116 crates/pgt_workspace/src/workspace/server/change.rs
  58. +5 −0 crates/pgt_workspace/src/workspace/server/db_connection.rs
  59. +33 −89 crates/pgt_workspace/src/workspace/server/document.rs
  60. +431 −0 crates/pgt_workspace/src/workspace/server/parsed_document.rs
  61. +18 −32 crates/pgt_workspace/src/workspace/server/pg_query.rs
  62. +122 −0 crates/pgt_workspace/src/workspace/server/sql_function.rs
  63. +99 −0 crates/pgt_workspace/src/workspace/server/statement_identifier.rs
  64. +31 −19 crates/pgt_workspace/src/workspace/server/tree_sitter.rs
  65. +5 −1 docs/index.md
  66. +1 −1 docs/schemas/0.0.0/schema.json
  67. +1 −1 docs/schemas/latest/schema.json
  68. +29 −4 justfile
  69. +21 −6 packages/@postgrestools/backend-jsonrpc/src/workspace.ts
  70. +1 −5 rust-toolchain.toml
1 change: 0 additions & 1 deletion .github/workflows/publish.reusable.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
# ? what's this?! required for executing the node script?
id-token: write
steps:
- uses: actions/checkout@v4
68 changes: 47 additions & 21 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -33,8 +33,10 @@ jobs:
steps:
- name: Checkout PR branch
uses: actions/checkout@v4

- name: Free Disk Space
uses: ./.github/actions/free-disk-space

- name: Install toolchain
uses: moonrepo/setup-rust@v1
with:
@@ -43,15 +45,23 @@ jobs:
cache-base: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install JS dependencies
run: bun install

- name: Setup Just
uses: extractions/setup-just@v3

- name: Echo Tool Versions
run: |
just format-ci-versions
- name: Run format
run: |
cargo fmt --all --check
taplo format --check
biome format
just format-ci
actionlint:
name: Lint GitHub Actions
@@ -96,26 +106,40 @@ jobs:
- name: Setup sqlx-cli
run: cargo install sqlx-cli

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install JS dependencies
run: bun install

- name: Setup Just
uses: extractions/setup-just@v3

- name: Echo Tool Versions
run: |
just lint-ci-versions
- name: Run Lints
run: |
cargo clippy
cargo run -p rules_check
biome lint
cargo sqlx prepare --check --workspace
just lint-ci
- name: Check for changes
run: |
if [[ $(git status --porcelain) ]]; then
git status
git diff
exit 1
fi
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# reactive once we upgrade to the latest version of pg_query that is windows-compatible
- os: windows-latest
- os: ubuntu-latest
# use the same images we use for compiling
- os: windows-2022
- os: ubuntu-22.04
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
@@ -138,8 +162,10 @@ jobs:
run: cargo test --workspace

test-js-bindings:
name: Test JS Bindings
runs-on: ubuntu-latest
name:
Test JS Bindings
# use the same image we use for compiling
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:latest
@@ -173,7 +199,7 @@ jobs:

codegen:
name: Check Codegen
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:latest
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -37,12 +37,12 @@ jobs:
strategy:
matrix:
config:
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu }
- { os: macos-latest, target: x86_64-apple-darwin }
- { os: macos-latest, target: aarch64-apple-darwin }
- { os: windows-latest, target: x86_64-pc-windows-msvc }
- { os: windows-latest, target: aarch64-pc-windows-msvc }
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu }
- { os: macos-14, target: x86_64-apple-darwin }
- { os: macos-14, target: aarch64-apple-darwin }
- { os: windows-2022, target: x86_64-pc-windows-msvc }
- { os: windows-2022, target: aarch64-pc-windows-msvc }

runs-on: ${{ matrix.config.os }}

@@ -87,12 +87,12 @@ jobs:

# windows is a special snowflake too, it saves binaries as .exe
- name: 👦 Name the Binary
if: matrix.config.os == 'windows-latest'
if: matrix.config.os == 'windows-2022'
run: |
mkdir dist
cp target/${{ matrix.config.target }}/release/postgrestools.exe ./dist/postgrestools_${{ matrix.config.target }}
- name: 👦 Name the Binary
if: matrix.config.os != 'windows-latest'
if: matrix.config.os != 'windows-2022'
run: |
mkdir dist
cp target/${{ matrix.config.target }}/release/postgrestools ./dist/postgrestools_${{ matrix.config.target }}
@@ -113,7 +113,7 @@ jobs:

create_changelog_and_release:
runs-on: ubuntu-latest
needs: build_and_test # make sure that tests & build work correctly
needs: [extract_version, build_and_test] # make sure that tests & build work correctly
steps:
- name: Checkout Repo
uses: actions/checkout@v4
@@ -126,10 +126,14 @@ jobs:
id: create_changelog
with:
config: cliff.toml
args: --bump
args: --bump --unreleased
env:
GITHUB_REPO: ${{ github.repository }}

- name: Ensure tag matches
if: steps.create_changelog.outputs.version != needs.extract_version.outputs.version
run: exit 1

- name: 👇 Download Artifacts
uses: actions/download-artifact@v4
id: download
Loading