Sha256: 0d379f74c123a3808cb15003397fcfdb2af3af63448464cf20ca079bb18ea5cb

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

const { AutoLanguageClient } = require('atom-languageclient')
const { spawn } = require('child_process')
const { resolve } = require('path')

class YodaClient extends AutoLanguageClient {
  constructor() {
    super()
    atom.config.set('core.debugLSP', true) // Debug the hell out of this
  }
  getGrammarScopes () { return ['source.ruby', 'source.rb', 'source.ruby.rails'] }
  getLanguageName () { return 'Ruby' }
  getServerName () { return 'Yoda' }
  getConnectionType() { return 'stdio' }

  startServerProcess () {
    const yoda = atom.inDevMode() ? spawn(resolve(__dirname, '../../exe/yoda'), ['server']) : spawn('yoda', ['server']);
    yoda.stderr.on('data', (data) => {
      this.logger.warn(`${data}`);
    });
    yoda.on('close', (code) => {
      this.logger.debug(`child process exited with code ${code}`);
    });
    return yoda;
  }
}

module.exports = new YodaClient()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yoda-language-server-0.4.0 client/atom/main.js