Skip to content

shfmt doesn't work in VS Code #1174

Closed
Closed
@lishaduck

Description

@lishaduck

Code editor

VS Code

Platform

macOS

Version

v1.41.0

What steps will reproduce the bug?

  1. Open any shell script.
  2. Open command pallet with ⌘+⇧+P
  3. Run "Format document"

How often does it reproduce? Is there a required condition?

100% of the time.

What is the expected behavior?

Bash IDE would register itself as a formatting provider.

What do you see instead?

A message stating that "There is no formatter for 'shellscript' files installed." pops up.

Additional information

[Info  - 12:15:42 PM] 17:15:41.878 INFO BackgroundAnalysis: resolving glob "**/*@(.sh|.inc|.bash|.command)" inside "file:///Users/dukese01/Developer/node-elm-review"...
[Info  - 12:15:43 PM] 17:15:42.339 INFO BackgroundAnalysis: Glob resolved with 5 files after 0.461 seconds
[Info  - 12:15:43 PM] 17:15:42.365 INFO BackgroundAnalysis: Completed after 0.487 seconds.

The code shows that the server supports it, but the client hasn't hooked it up.
I think you need to call registerDocumentFormattingEditProvider() somewhere.

Everything else works, great extension!

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