Coder Social home page Coder Social logo

Comments (8)

 avatar commented on June 27, 2024

Here are the JSON objects that are exchanged between atom-languageclient and my server:

>> {'params': {'capabilities': {}, 'processId': 1168727, 'rootPath': '/home/jonas/Develop/tethercode-language-server'}, 'method': 'initialize', 'jsonrpc': '2.0', 'id': 0}

<< {"result":{"capabilities":{"documentSymbolProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":["."]},"definitionProvider":true,"documentFormattingProvider":false,"signatureHelpProvider":{"triggerCharacters":["("]},"textDocumentSync":2,"referencesProvider":true,"documentRangeFormattingProvider":false}},"jsonrpc":"2.0","id":0}

If I'm typing, there are also auto completion requests sent by atom-languageclient - so the connection is definitely still active. However, if I simply don't touch anything, nothing ever happens further and at no point, I'm actually getting any didOpen notifications.

from atom-languageclient.

damieng avatar damieng commented on June 27, 2024

The onDidOpen is sent in the sync provider - I'm not sure why it's firing for you.

If you're developing a language server from scratch you might be better off starting with a known-good implementation of the client such as VSCode until the atom-languageclient is out of the experimental phase.

from atom-languageclient.

 avatar commented on June 27, 2024

I absolutely don't mind if you don't investigate this for now. I guess I'm piling tickets a bit early into this project - if you want I can also stop filing tickets at this stage and file them later when this project is more in a testing and less in a groundwork development phase. (However, I can also keep filing various issues as I stumble across them if you want, whatever you prefer)

I would guess that in this case it's again related to my language server starting up so slowly. I'm happy to use VS Code for now for further tests, I am simply a huge fan of Atom 😄

from atom-languageclient.

damieng avatar damieng commented on June 27, 2024

There was a sequence error where onDidOpen would not be sent for files already open - that has now been fixed. Let me know if you see any more issues with the latest code.

from atom-languageclient.

 avatar commented on June 27, 2024

I just updated to the latest version of atom-languageclient to test this (by removing the node_packages folder inside the .atom/packages/language-tethercode plugin directory and then running apm install again in that directory).

Sadly, now I am getting the "Uncaught SyntaxError: Unexpected end of JSON input" error again, despite using TCP sockets which worked fine with git master ~9 days ago. The plugin is unchanged, and the language server works perfectly fine with Visual Studio Code.

Full stack trace:

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at StreamMessageReader.onData (/home/jonas/.atom/packages/language-tethercode/node_modules/vscode-jsonrpc/lib/messageReader.js:198:29)
    at Socket.<anonymous> (/home/jonas/.atom/packages/language-tethercode/node_modules/vscode-jsonrpc/lib/messageReader.js:166:19)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20)

This is the plugin: https://gitlab.com/tethercode/atom-language-plugin

The TCP connection is successfully opened (I can see this in the language server log) but nothing is ever sent, as if atom-languageclient now reverted to stdin/stdout anyway. (which always used to give me that "Uncaught SyntaxError: Unexpected end of JSON input" error before I changed the plugin code to use TCP sockets)

This is the VS Code plugin: https://gitlab.com/tethercode/vscode-plugin

The language server itself is a bit complicated to install at this point.. since I can't compile to binaries yet. (compiler is unfinished)

Edit: for what it's worth, I just tried the latest version of my language server on the other machine where I still have atom-languageclient installed in the old version and there it works fine without that strange error and the language server receives the protocol initialization just fine (but I'm not getting textdocument/didOpen events since that atom-languageclient version is a few commits behind this fix)

from atom-languageclient.

damieng avatar damieng commented on June 27, 2024

Sorry about that - did a big cleanup of some of the code paths and broke sockets. If you pull again it should now be working.

Instead of deleting node_packages folder you can actually git clone this repo and then npm link . inside it - that will cause the packages to use your local check-out. Then you can update it as you want by just git pull in your copy of the repo.

from atom-languageclient.

 avatar commented on June 27, 2024

The latest version indeed seems to work fine now, including file synchronization! ❤️ Thanks!

from atom-languageclient.

damieng avatar damieng commented on June 27, 2024

Great! :)

from atom-languageclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.