Skip to content

DidChange not working as expected #85

Closed
@hendrikmennen

Description

@hendrikmennen

I am trying to implement this LS into my own IDE.
While clangd itself works flawlessly, this LS does not.

In this example I just create new lines in an empty file:

Creating a newline in 1:0 works.
Creating a newline in the new 2:0 does not, and gives me a invalid change range.

Here is the full log for the simple scenario.

[01:66:19] Arduino LS: 2021/10/15 12:54:50 IDE --> textDocument/didChange notif8 ←[93m locked←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 --> didChange(file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/ArduinoTest/ArduinoTest.ino@123)
[01:66:19] Arduino LS: 2021/10/15 12:54:50      > 1:0-1:0 -> "\r\n"
[01:66:19] Arduino LS: 2021/10/15 12:54:50     --> didChange(file:///C:/Users/HendrikMennen/AppData/Local/Temp/arduino-language-server3008026257/sketch/ArduinoTest.ino.cpp@6)
[01:66:19] Arduino LS: 2021/10/15 12:54:50          > 3:0-3:0 -> "\r\n"
[01:66:19] Arduino LS: 2021/10/15 12:54:50 ←[91mIDE     LS --> CL: NOTIFICATION textDocument/didChange: ←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 IDE --> textDocument/didChange notif8 ←[93m unlocked←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 ←[92mIDE     LS <-- CL: NOTIFICATION textDocument/publishDiagnostics: ←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 (queued)
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 ←[93m read-locked←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 (running)
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 publishDiagnostics(file:///C:/Users/HendrikMennen/AppData/Local/Temp/arduino-language-server3008026257/sketch/ArduinoTest.ino.cpp):
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:0 - 1: drv_unknown_argument_with_suggestion
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:0 - 1: drv_unknown_argument
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:0 - 1: drv_unknown_argument_with_suggestion
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:0 - 1: drv_unknown_argument
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:9 - 1: expected_fn_body
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 2:0 - 1: unknown_typename
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 5:0 - 1: expected_unqualified_id
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 0:0-0:0 to /not-ino:0:0-0:0
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 0:0-0:0 to /not-ino:0:0-0:0
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 0:0-0:0 to /not-ino:0:0-0:0
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 0:0-0:0 to /not-ino:0:0-0:0
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 0:9-0:10 to /not-ino:0:9-0:10
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: converted 2:0-2:2 to C:\Users\HendrikMennen\Documents\VHDPlus\Projects\ArduinoTest\ArduinoTest.ino:0:0-0:2
[01:66:19] Arduino LS: 2021/10/15 12:54:50     URI: is in preprocessed section
[01:66:19] Arduino LS: 2021/10/15 12:54:50          converted 5:0-5:0 to /not-ino:0:0-0:0
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 to IDE: publishDiagnostics(file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/ArduinoTest/ArduinoTest.ino):
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 > 0:0 - 1: unknown_typename
[01:66:19] Arduino LS: 2021/10/15 12:54:50 ←[91mIDE <-- LS     CL: NOTIFICATION textDocument/publishDiagnostics: ←[0m
[01:66:19] Arduino LS: 2021/10/15 12:54:50 CLG <-- textDocument/publishDiagnostics notif179 ←[93m read-unlocked←[0m
[01:66:20] Arduino LS: 2021/10/15 12:54:51 ←[92mIDE --> LS     CL: NOTIFICATION textDocument/didChange: ←[0m
[01:66:20] Arduino LS: 2021/10/15 12:54:51 IDE --> textDocument/didChange notif9 ←[93m locked←[0m
[01:66:20] Arduino LS: 2021/10/15 12:54:51 --> didChange(file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/ArduinoTest/ArduinoTest.ino@124)
[01:66:20] Arduino LS: 2021/10/15 12:54:51      > 2:0-2:0 -> "\r\n"
[01:66:20] Arduino LS: 2021/10/15 12:54:51     --E error: invalid change range file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/ArduinoTest/ArduinoTest.ino:2:0-2:0
[01:66:20] Arduino LS: 2021/10/15 12:54:51 IDE --> textDocument/didChange notif9 ←[93m unlocked←[0m
[01:66:20] Arduino LS: 2021/10/15 12:54:51 jsonrpc2 handler: notification "textDocument/didChange" handling error: invalid change range file:///c:/Users/HendrikMennen/Documents/VHDPlus/Projects/ArduinoTest/ArduinoTest.ino:2:0-2:0

If anyone knows why this is happening, please tell me :)

As I said, my way of handling didChange does work with plain clangd and other language servers aswell so I don't see the reason why this could fail.

Metadata

Metadata

Assignees

Labels

topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions