Giter Club home page Giter Club logo

Comments (3)

rchl avatar rchl commented on June 25, 2024

We might need to make things less strict because currently LSP only sends the corresponding code action if the server announces support for it in its initialize response.

Since this functionality is not specified anywhere but rather based on VSCode, we should align with it. VSCode seems to send all user-specified editor.codeActionsOnSave to every server but interestingly not all together but in a separate requests. So when using biome in a TS file with editor.codeActionsOnSave set to:

    "editor.codeActionsOnSave": {
        "source.fixAll.eslint": "explicit",
        "source.fixAll.stylelint": "explicit",
        "source.organizeImports.biome": "explicit",
    },

I can see 3 separate textDocument/codeAction request sent to biome:

[Trace - 21:27:10] Sending request 'textDocument/codeAction - (28)'.
Params: {
    "textDocument": {
        "uri": "file:///usr/local/workspace/.../routes.ts"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 283,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [
            {
                "range": {
                    "start": {
                        "line": 17,
                        "character": 26
                    },
                    "end": {
                        "line": 17,
                        "character": 29
                    }
                },
                "message": "'req' is declared but its value is never read.",
                "code": 6133,
                "severity": 4,
                "tags": [
                    1
                ],
                "source": "ts"
            },
            {
                "range": {
                    "start": {
                        "line": 86,
                        "character": 26
                    },
                    "end": {
                        "line": 86,
                        "character": 29
                    }
                },
                "message": "'req' is declared but its value is never read.",
                "code": 6133,
                "severity": 4,
                "tags": [
                    1
                ],
                "source": "ts"
            },
            {
                "range": {
                    "start": {
                        "line": 217,
                        "character": 26
                    },
                    "end": {
                        "line": 217,
                        "character": 29
                    }
                },
                "message": "'req' is declared but its value is never read.",
                "code": 6133,
                "severity": 4,
                "tags": [
                    1
                ],
                "source": "ts"
            }
        ],
        "only": [
            "source.fixAll.eslint"
        ],
        "triggerKind": 2
    }
}

where "only" includes a single, different code action in each.

from lsp.

skytwosea avatar skytwosea commented on June 25, 2024

Similar to @hrasekj : I have my LSP.sublime-settings configured to not fix or organize on save, but fixAll is being applied regardless and I can't figure out how to turn it off. My user settings are being ignored.

{
    // General settings
    "lsp_format_on_save": false,
    "lsp_code_actions_on_save": {
      "source.fixAll": false,
      "source.organizeImports": false,
    },
    "show_inlay_hints": false,
    "semantic_highlighting": true,

    // Language server configurations
    "clients": {
        "zig": {
            // the startup command -- what you would type in a terminal
            "command": ["/home/vesper/.zls/zls"],
            // enable this configuration
            "enabled": true,
            // the selector that selects which type of buffers this language server attaches to
            "selector": "source.zig",
        }
    }
}

from lsp.

rchl avatar rchl commented on June 25, 2024

That's an opposite problem to this one. Feel free to create another issue for it.

from lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.