Open markdumay opened 3 years ago
Branch issue-28-Support_InsertReplaceEdit_in_CompletionItem created!
@markdumay Thanks for the post issue.
Firstly, the gojay
binding is faster than stdlib enconding/json
, because I think you already know, uses a JIT stream parser.
But unfortunately, "JIT" parser is not a good fit for the interface
type (not means interface{}
field type).
Which requires to define belows new type, and support it to gojay JIT methods:
type textEditInterface interface {
isTextEdit()
}
type TextEdit struct {
someFields...
}
func (TextEdit) isTextEdit() {}
type InsertReplaceEdit {
someFields...
}
func (InsertReplaceEdit) isTextEdit() {}
I knew your said problem that's protocol
package doesn't fully support LSP specifications. But I faced the above problem , and didn't focused fixing it when that time. In that time, I'd focused to write all type of lsp 3.16 spec.
I'll dig again gojay internal. Could you wait a moment?
Since LSP 3.16.0, CompletionItem supports either
*TextEdit
or*InsertReplaceEdit
for the fieldTextEdit
. The current implementation in Go supports*TextEdit
only.After a quick review, the following changes seem to be needed to cater for this additional type. Most likely
language_gojay_test.go
andlanguage_test.go
need to be modified too, but the needed code changes are less obvious to me. I'm more than happy to submit an initial PR too, let me know what you prefer.language.go
language_gojay.go