Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting fails when position end is out of range of the document #183

Closed
angelozerr opened this issue Mar 26, 2024 · 0 comments · Fixed by #186
Closed

Formatting fails when position end is out of range of the document #183

angelozerr opened this issue Mar 26, 2024 · 0 comments · Fixed by #186
Labels
bug Something isn't working formatting
Milestone

Comments

@angelozerr
Copy link
Contributor

I have noticed this problem with Clojure LSP. When you try to format something:

(let      
                        [binding ""])

The format can be occured and there is this error:

image

Here the formatting response:

[Trace - 10:10:12] Received response 'textDocument/formatting - (27)' in 4ms.
Result: [
  {
    "range": {
      "start": {
        "line": 0,
        "character": 0
      },
      "end": {
        "line": 999999,
        "character": 999999
      }
    },
    "newText": "(let\r\n [binding \"\"])"
  }
]

The end line and character is equals to 999999 which is outside the document length.

I have found this comment https://github.com/microsoft/vscode-languageserver-node/blob/ed3cd0f78c1495913bda7318ace2be7f968008af/textDocument/src/main.ts#L26 but LSP specification doesn't speak about that but we need to implement this strategy.

@angelozerr angelozerr added bug Something isn't working formatting labels Mar 26, 2024
@angelozerr angelozerr added this to the 0.0.1 milestone Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
angelozerr added a commit to angelozerr/lsp4ij that referenced this issue Mar 26, 2024
@angelozerr angelozerr moved this to 👀 In review in IDE Cloudaptors Mar 26, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatting
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant