Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
According to the LSP spec, the line and character must both be unsigned integers. The spec also specifically calls out that `-1` is not supported: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position With some code structures, it is possible to produce an error such as the following from `golangci-lint run --out-format=json`: ```json { "FromLinter": "typecheck", "Text": ": # github.com/my/package [github.com/my/package.test]\n./main.go:31:2: undefined: asdf", "Severity": "", "SourceLines": [ "package main" ], "Replacement": null, "Pos": { "Filename": "main.go", "Offset": 0, "Line": 1, "Column": 0 }, "ExpectNoLint": false, "ExpectedNoLintLinter": "" } ``` This ultimately does result in some issues with tooling compatibility, for example: folke/trouble.nvim#224 (comment) By preventing the number from dropping below zero, this class of error should no longer be present.
- Loading branch information