Skip to content

Implement JSON-RPC protocol #730

Closed

Description

@vjeux

Prettier when invoked from the command line takes few hundreds ms to format a file and it is making running prettier from within an editor feel a bit sluggish. What we've seen is that most of that time is loading all the JavaScript. Once it has loaded, it only takes a few dozens of milliseconds to do its work.

The idea is to implement the JSON-RPC protocol via stdin/stdout. There's already a battle tested js library that does it: https://www.npmjs.com/package/vscode-jsonrpc

The flow would look like this:

spawn('node prettier.js')
send('format', 'var a=10')
// 'var a = 10;'

Activity

  1. added
    locked-due-to-inactivity
    on Jul 8, 2018
  2. locked as resolved and limited conversation to collaborators on Jul 8, 2018
  3. added theissue type on Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked-due-to-inactivity

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions