atom / atom-languageclient

Language Server Protocol support for Atom (the basis of Atom-IDE)
https://ide.atom.io/
MIT License
389 stars 78 forks source link

Client throws error after receiving a diagnostic message #267

Closed eferos93 closed 5 years ago

eferos93 commented 5 years ago

The client throws the following error after sending a textDocument/publishDiagnostics:

Notification handler 'textDocument/publishDiagnostics' failed with message: params.diagnostics.map is not a function

This is the message sent.

Content-Length: 383

{"method":"textDocument\/publishDiagnostics","jsonrpc":"2.0","params":[{"diagnostics":
{"severity":1,"range":{"start":{"character":0,"line":3},"end":
{"character":0,"line":3}},"source":"jolie","message":"File not found: prova.iol. Found 
token type STRING, token content 
prova.iol"},"uri":"file:\/\/\/home\/eferos93\/.atom\/packages\/Jolie-ide-atom\/server_temp.ol"}]}

I do not understand what is that params.diagnostics.map the error refers to. The message above should respect the LSP specification.

Aerijo commented 5 years ago

The server must return an array of diagnostics

https://microsoft.github.io/language-server-protocol/specification#textDocument_publishDiagnostics