Skip to content

Not able to send a custom "organize imports" command due to missing template variable #2515

@Mister7F

Description

@Mister7F

I would be cool be be able to sort import with a shortcut

    {
        "keys": ["primary+b"],
        "command": "lsp_execute",
        "args": {
          "command_name": "ruff.applyOrganizeImports",
          "command_args": [{ "uri": "file:///plugin/execute_command.py", "version": 123 }],
          "session_name": "LSP-ruff"
        }
    },

It kinda work like that (see discussion on sublime text discord), but it's buggy

It can be something like

  {
    "keys": [
      "primary+b"
    ],
    "command": "lsp_organize_imports",
  },

(or even be chained with lsp_format_document)

That example is for ruff, not sure if it can be generic for all LSP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions