nametake / golangci-lint-langserver

golangci-lint language server
MIT License
229 stars 20 forks source link

No diagnostics being sent from the server #43

Open raiansantos opened 2 months ago

raiansantos commented 2 months ago

There is a validation happening on the filename that is avoiding a very simple setup to work in my vim configuration. Basically the +1 used to index the start of the array at this point is avoiding a further validation to happen and no diagnostic is being sent from the server.

https://github.com/nametake/golangci-lint-langserver/blob/a91997c47c24e20eaecd1f5d5c05c6825464c4a8/handler.go#L63

Validated that removing the +1 my issue is gone. I'm not an expert in LSP definitions, so wondering why that validation is there.

The further validations I mentioned is here https://github.com/nametake/golangci-lint-langserver/blob/a91997c47c24e20eaecd1f5d5c05c6825464c4a8/handler.go#L88 Because it's continuing, and the first character is being removed no messages are sent back.

raiansantos commented 2 months ago

For reference, my vim configuration is

    {
      name: 'golint-ci',
      filetype: ['go'],
      path: 'golangci-lint-langserver',
      args: ['-debug'],
      initializationOptions: {
        "command": ["golangci-lint", "run", "--enable-all", "--disable", "lll", "--out-format", "json", "--issues-exit-code=1"]
      },
      debug: v:true
    },

I'm using https://github.com/yegappan/lsp