Skip to content

"Add Missing Protocol Requirements" ignores indentation settings #565

@lupuchard

Description

@lupuchard

Describe the bug
When using "Add Missing Protocol Requirements" the added functions are always indented with spaces, even if the file is set to indent with tabs.

To Reproduce
Steps to reproduce the behavior:

  1. Ctrl-Shift-P -> "Indent Using Tabs"
  2. Add a protocol to a struct or class
  3. Click the red-underlined struct/class name
  4. Click the light bulb -> "Add Missing Protocol Requirements"
    The generated function(s) will be indented with spaces

Expected behavior
The functions generated are indented according to your indentation setting

Environment

  • OS: Linux Mint 21.1 Vera
  • Swift version: 5.8.1
  • Visual Studio Code version: 1.79.2
  • vscode-swift version: 1.3.0

Activity

adam-fowler

adam-fowler commented on Jul 4, 2023

@adam-fowler
Contributor

This is an issue with SourceKit-LSP not providing formatted output.

I run one of the swift formatting extensions and have them format on save to get around this.

But ideally we would get properly formatted output from Soureckit-LSP. Here is the related issue swiftlang/sourcekit-lsp#496

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsourcekit-lspSourceKit-LSP issue

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lupuchard@adam-fowler

        Issue actions

          "Add Missing Protocol Requirements" ignores indentation settings · Issue #565 · swiftlang/vscode-swift