Skip to content

Getting code actions super slow #25

Closed
@mpayette-3rdeyecam

Description

@mpayette-3rdeyecam

Bug report

Describe the bug

Using the tool for real-time formatting, I'm getting incredibly slow results in VSCode. Many times I will save changes, and the IDE will load and show the bottom right popup saying it's getting "code actions" from postgrestools. The waiting can be anywhere from like half a second to even 10 seconds roughly in the worst instances. My PC specs are very good and I'm not running heavy stuff while testing that.

I'm using this postgrestools.jsonc:

{
  "$schema": "https://pgtools.dev/schemas/0.0.0/schema.json",
  "vcs": {
    "enabled": false,
    "clientKind": "git",
    "useIgnoreFile": false
  },
  "files": {
    "ignore": []
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}

and this workspace setup:

{
  "folders": [
    {
      "path": ".",
    },
  ],
  "settings": {
    "editor.defaultFormatter": "dbaeumer.vscode-eslint",
    "editor.formatOnSave": true,
    ...
    "typescript.tsserver.experimental.enableProjectDiagnostics": true,
    "editor.codeActionsOnSave": {
      "source.fixAll": "always",
      "source.fixAll.eslint": "always",
      "source.organizeImports": "always",
      "source.sortMembers": "always",
    },
    "files.associations": {
      "*.code-workspace": "json",
      "*.mjs": "javascript",
      "*.jsonc": "json",
    },
    ...
    "[jsonc]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode",
    },
    "[sql]": {
      "editor.defaultFormatter": "Supabase.postgrestools",
    },
    ...
  },
}

To Reproduce

Hard to consistently repro, but I'm getting this latency on almost every save action.

Expected behavior

At most a second of delay between me saving an sql file and the tool doing its job.

Screenshots

Image

System information

  • OS: Windows 11
  • Version of Node.js: 22.12.0

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions