Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

didChange event handling fails with out of range error after which every format request fails #277

Open
ramya-rao-a opened this issue May 11, 2018 · 3 comments

Comments

@ramya-rao-a
Copy link
Contributor

The below was observed when using the language server via the Go extension to VS Code.

Below is a simple program of 12 lines. All I did was add tabs before the print statement followed by file save a couple of times. Soon there is an error when handling the textDocument/didChange event. After this every file save that triggers formatting ends up generating the below formatting error.

screen shot 2018-05-10 at 9 05 10 pm

Weirdly, it says it found } in line 12, but } is in line 11

@ramya-rao-a
Copy link
Contributor Author

ramya-rao-a commented May 11, 2018

@keegancsmith @slimsag This looks similar to the errors in #83 (comment)

Can we add the formatting feature behind a flag?

@keegancsmith
Copy link
Member

yeah I think there are some issues around how we interpret ranges in go-langserver. I'll take a look soon.

By put it behind a feature flag, do you mean advertising full sync vs incremental sync?

@ramya-rao-a
Copy link
Contributor Author

Never mind the feature flag, I figured out a way to intercept the calls going to the language server from the Go extension. So what I have done is disabled the formatting feature from the language server. User can opt-in to use the formatting feature from the language server explicitly in VS Code now.

Well, by "now" I mean the next update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants