Skip to content

Feature request: A way for languages or language servers to bypass the canFormat check #424

Closed

Description

@FalsePattern

In AbstractLSPFormattingService, canFormat checks for the presence of a LanguageFormatting implementation for a language, and if present, doesn't invoke the LSP formatter.

In the case of ZigBrains, I used both the LSP formatter for manual formatting via ZLS when invoking the formatting action, as well as the intellij autoformatter for correct auto-indentation when creating new lines or code blocks. If the zigbrains lang.formatter is removed, auto-indentation breaks, but the ZLS formatter functions.

Activity

  1. added
    enhancement
    on Jul 17, 2024
  2. angelozerr commented on Jul 17, 2024

    @angelozerr
    Contributor

    Same issue than #388

  3. FalsePattern commented on Jul 17, 2024

    @FalsePattern
    ContributorAuthor

    As a temporary workaround until this is solved, I have added a proxy service that bypasses the AbstractLSPFormattingService.canFormat checks for Zig: https://github.com/FalsePattern/ZigBrains/blob/master/modules/zig/src/main/java/com/falsepattern/zigbrains/zig/formatter/ZigAbstractLSPFormattingServiceProxy.java, this seems to fix the issue for ZB.

  4. added this to the 0.7.0 milestone on Oct 2, 2024
  5. self-assigned this
    on Oct 2, 2024
  6. added
    duplicate
    on Oct 2, 2024
  7. angelozerr commented on Oct 2, 2024

    @angelozerr
    Contributor

    Duplicate of #388 and covered with the current PR #543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api-customizationduplicateenhancementformatting

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions