How to use atom-languageclient - 10 common examples

To help you get started, we’ve selected a few atom-languageclient examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rianneogi / ide-cquery / lib / main.js View on Github external
type: "text",
              class: "cquery--namespace"
            }
          }
          else if(data.symbols[i].kind==SymbolKind.Macro)
          {
            options = {
              type: "text",
              class: "cquery--macro"
            }
          }
          
          for(let j = 0;j
github spring-projects / sts4 / atom-extensions / atom-spring-boot / lib / main.js View on Github external
createHintMarker(editor, range) {
        // Create marker model
        const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range), BOOT_DATA_MARKER_TYPE);

        // Marker around the text in the editor
        editor.decorateMarker(marker, {
            type: 'highlight',
            class: 'boot-hint'
        });

        // Marker in the diagnostic gutter
        let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
        if (!gutter) {
            gutter = editor.addGutter({
                name: BOOT_HINT_GUTTER_NAME,
                visible: false,
            });
        }
        const iconElement = document.createElement('span');
github spring-projects / sts4 / atom-extensions / atom-spring-boot / lib / boot-sts-adapter.ts View on Github external
private createHintMarker(editor: TextEditor, range: Range) {
        // Create marker model
        const marker = editor.markBufferRange(Convert.lsRangeToAtomRange(range));

        // Marker around the text in the editor
        editor.decorateMarker(marker, DECORATION_OPTIONS);

        // Marker in the diagnostic gutter
        // let gutter = editor.gutterWithName(BOOT_HINT_GUTTER_NAME);
        // if (!gutter) {
        //     gutter = editor.addGutter({
        //         name: BOOT_HINT_GUTTER_NAME,
        //         visible: false,
        //     });
        // }
        // const iconElement = document.createElement('span');
        // iconElement.setAttribute('class', 'gutter-boot-hint');
        // gutter.decorateMarker(marker, {item: iconElement});
    }
github Gert-dev / php-ide-serenata / lib / CodeLensManager.js View on Github external
codeLenses.forEach((codeLens) => {
            if (!codeLens.command) {
                // To support this, one would have to send a resolve request and show some sort of placeholder
                // beforehand, as we wouldn't know what title to show yet.
                throw new Error('Code lenses with unresolved commands are currently not supported');
            }

            const range = Convert.lsRangeToAtomRange(codeLens.range);
            const paddingSpacesNeeded = range.start.column - charactersTaken;

            // Having one marker per line  (see above) means that we need to do padding ourselves when multiple code
            // lenses are present. This can happen in cases where multiple properties are on one line, and more than one
            // of them is an override. ot great, but it gets the job done.
            const paddingSpanElement = document.createElement('span');
            paddingSpanElement.innerHTML = ' '.repeat(paddingSpacesNeeded);

            const anchorElement = document.createElement('a');
            anchorElement.innerHTML = codeLens.command.title;
            anchorElement.classList.add('badge');
            anchorElement.classList.add('badge-small');
            anchorElement.href = '#';
            anchorElement.addEventListener('click', () => {
                executeCommandHandler({
                    command: codeLens.command.command,
github rianneogi / ide-cquery / lib / main.js View on Github external
let options = {
          type: "text",
          class: "cquery--disabled"
        }
        
        // Delete all existing markers
        for(let i = 0;i
github rwatts3 / atom-ide-vue / build / main.js View on Github external
"use strict";
const atom_languageclient_1 = require("atom-languageclient");
const cp = require("child_process");
class VueLanguageClient extends atom_languageclient_1.AutoLanguageClient {
    getGrammarScopes() { return ['text.html.vue']; }
    ;
    getLanguageName() { return 'Vue'; }
    ;
    getServerName() { return 'MBRW'; }
    ;
    startServerProcess() {
        return cp.spawn('node', [require.resolve('vue-language-server/dist/vueServerMain')]);
    }
    ;
    preInitialization(connection) {
        connection.onCustom('$/partialResult', () => { }); // Suppress partialResult until the language server honours 'streaming' detection
    }
}
module.exports = new VueLanguageClient();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSw2REFBeUQ7QUFDekQsb0NBQXFDO0FBRXJDLHVCQUF3QixTQUFRLHdDQUFrQjtJQUdqRCxnQkFBZ0IsS0FBTSxNQUFNLENBQUMsQ0FBQyxlQUFlLENBQUMsQ0FBQSxDQUFDLENBQUM7SUFBQSxDQUFDO0lBQ2pELGVBQWUsS0FBTSxNQUFNLENBQUMsS0FBSyxDQUFBLENBQUMsQ0FBQztJQUFBLENBQUM7SUFDcEMsYUFBYSxLQUFNLE1BQU0sQ0FBQyxNQUFNLENBQUEsQ0FBQyxDQUFDO0lBQUEsQ0FBQztJQUVuQyxrQkFBa0I7UUFDakIsTUFBTSxDQUFDLEVBQUUsQ0FBQyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyx3Q0FBd0MsQ0FBQyxDQUFDLENBQUMsQ0FBQztJQUN0RixDQUFDO0lBQUEsQ0FBQztJQUVGLGlCQUFpQixDQUFFLFVBQVU7UUFDNUIsVUFBVSxDQUFDLFFBQVEsQ0FBQyxpQkFBaUIsRUFBRSxRQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsaUZBQWlGO0lBQ3BJLENBQUM7Q0FDRDtBQUVELGlCQUFVLElBQUksaUJBQWlCLEVBQUUsQ0FBQyJ9
github rianneogi / ide-cquery / lib / main.js View on Github external
getInitializeParams (projectPath, process) {
    // Add additional initialization options.
    let params = AutoLanguageClient.prototype.getInitializeParams(projectPath, process);
    params.initializationOptions = this.getInitializationOptions(projectPath);
    return params;
  }
github facebookarchive / ide-flowtype / lib / FlowAutocompleteAdapter.js View on Github external
static completionItemToSuggestion(item, request) {
    const suggestion = FlowAutocompleteAdapter.basicCompletionItemToSuggestion(
      item
    );
    AutocompleteAdapter.applyTextEditToSuggestion(
      item.textEdit,
      request.editor,
      suggestion
    );
    // TODO: Snippets
    return suggestion;
  }
github atom / ide-php / lib / main.js View on Github external
      .then(() => DownloadFile(serverDownloadUrl, localFileName, (bytesDone, percent) => installSignal && installSignal.setTitle(`downloading ${Math.floor(serverDownloadSize / bytesToMegabytes)} MB (${percent}% done)`), serverDownloadSize))
      .then(() => installSignal && installSignal.setTitle('unpacking...'))
github crystal-lang-tools / atom-ide-crystal / src / main.ts View on Github external
this.logger.log(`Downloading ${url} to ${localFileName}`);

    const serverHomeExists = await this.fileExists(serverHome);
    if (!serverHomeExists) {
      new Promise((resolve, reject) => {
        fs.mkdir(serverHome, err => {
          if (err) {
            return reject(err);
          }

          return resolve();
        });
      });
    }

    await DownloadFile(url, localFileName, (bytesDone, percent) =>
      this.updateStatusBar(`downloading ${percent}%`)
    );
    this.updateStatusBar("unpacking");
    await decompress(localFileName, serverHome);

    const serverBinExists = await this.fileExists(
      path.join(serverHome, "bin", process.platform, serverBinary)
    );
    if (!serverBinExists) {
      throw Error(
        `Failed to install the ${this.getServerName()} language server`
      );
    }

    this.updateStatusBar("installed");
    await new Promise((resolve, reject) => {