Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code Completion with Scale

Code Completion with Scale

Avatar for Abhishek Gahlot

Abhishek Gahlot

October 03, 2017

More Decks by Abhishek Gahlot

Other Decks in Technology

Transcript

  1. Why Code Completion? HackerRank uses Web Based Editors Ease of

    use Switching between browser and editor Low latency for completion and docs
  2. Previous Solutions • Eclim - Memory Issue and Overkill •

    Tries - Not Comprehensive • Inbuilt keywords - Doesn’t do much
  3. Code Completion • Parser, Grammar, Abstract Syntax Tree (AST) •

    Can Handle Errors, Partial code • Should be Fast Enough
  4. Parser • Most parsers check inputs strictly and raise errors

    • We need parsers that can tolerate errors and give some AST • Heuristics and general approaches to make it tolerant
  5. Current Solution • Separate Daemon for all Languages • Modular

    with interfaces • Ability to sync data and projects
  6. Python and Python 3 • No good option available. •

    Javaparser ( https://github.com/javaparser/ javaparser) • Make java completion faster than available solution
  7. Java • No good option available. • Javaparser ( https://github.com/javaparser/

    javaparser) • Make java completion faster than available solution
  8. Javascript, Go, and PHP • Javascript is done using Tern

    ( Acorn Parser ) • Go is done using Gocode • PHP uses language server.
  9. Communication over Sockets • All daemons connect to node app

    via Sockets • Backend is connected with web via websockets • File write time
  10. Project Based Completion • Project Type Questions • Ability to

    sync only tokens required to apply server side instead of sending whole files • Differential Synchronization