Skip to content

refactor: new workspace crate #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Dec 11, 2024
Merged

refactor: new workspace crate #147

merged 43 commits into from
Dec 11, 2024

Conversation

psteinroe
Copy link
Collaborator

@psteinroe psteinroe commented Oct 28, 2024

current status / next todo:

  • understand and decide on settings / configuration / workspace setup
  • make lsp and cli with server work: load config, open and close files
  • migrate change from base_db to workspace_new
  • make change file work e2e
  • make db connection and schema cache work.

copying (with acknowledgements) from biome to get things going

  • pg_markup
  • pg_console
  • pg_text_edit
  • pg_diagnostics_macros
  • pg_diagnostics_categories
  • pg_diagnostics
  • pg_configuration

will serve as a base to work on

  • pg_workspace_new (to be renamed to pg_workspace later)
  • pg_cli

goal of this pr is to be able to start and stop the daemon process and accept file changes, connect to the database and populate the schema cache. we can then start moving features over in follow-up prs.

we will use the same client-server architecture as biome, but with a few adaptions to make it work for postgres. the list is not complete, just thoughts gathered while working on this:

  • biome spawns a single daemon per machine / workspace. each project registers itself. this works great for them because all configuration and all analysis results only depends on the file system. for us its a bit different, because a type checker will report different result for the same file if its pointed at different databases. hence, we will spawn one daemon per target database, and there is no project registry - just a single one. this will also work well when being integrated in platforms such as supabase: there could be a single lsp server running for each project.
  • I will use the toml format for the config file. it will contain only the db connection string for now, but the foundation for all sorts of configurations is laid out already.

@psteinroe psteinroe changed the title refactor: move PgLspPath into pg_fs crate refactor: new workspace crate Oct 28, 2024
@psteinroe psteinroe marked this pull request as ready for review December 10, 2024 17:24
@psteinroe psteinroe changed the base branch from refactor/pglsp to main December 10, 2024 17:25
@psteinroe psteinroe merged commit c24b2fa into main Dec 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant