Skip to content

Powershell formatting is not supported #1212

Closed
@r-darwish

Description

@r-darwish

Describe the bug
lsp-format-buffer does not work in Powershell even though the server supports formatting

To Reproduce
Run lsp-format-buffer in a Powershell buffer

Expected behavior
Formatting should work like in Visual Studio Code

Which Language Server did you use
Powershell

OS
macOS

Error callstack

Debugger entered--Lisp error: (lsp-capability-not-supported "documentFormattingProvider")
  signal(lsp-capability-not-supported ("documentFormattingProvider"))
  (cond ((or (lsp--capability "documentFormattingProvider") (lsp--registered-capability "textDocument/formatting")) (let ((edits (lsp-request "textDocument/formatting" (lsp--make-document-formatting-params)))) (lsp--apply-formatting edits))) ((or (lsp--capability "documentRangeFormattingProvider") (lsp--registered-capability "textDocument/rangeFormatting")) (save-restriction (widen) (lsp-format-region (point-min) (point-max)))) (t (signal (quote lsp-capability-not-supported) (list "documentFormattingProvider"))))
  lsp-format-buffer()
  funcall-interactively(lsp-format-buffer)
  call-interactively(lsp-format-buffer record nil)
  command-execute(lsp-format-buffer record)
  execute-extended-command(nil "lsp-format-buffer" "lsp-format-bu")
  funcall-interactively(execute-extended-command nil "lsp-format-buffer" "lsp-format-bu")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

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