Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vscode-languageclient

Package Overview
Dependencies
Maintainers
11
Versions
302
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-languageclient

VSCode Language client implementation

  • 5.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-0.97%
Maintainers
11
Weekly downloads
 
Created

What is vscode-languageclient?

The vscode-languageclient npm package is a library that helps in creating language clients for Visual Studio Code extensions. It facilitates communication between the client (VS Code) and the language server, enabling features like auto-completion, go-to-definition, and diagnostics.

What are vscode-languageclient's main functionalities?

Initialize Language Client

This code initializes a language client that communicates with a language server. The client is configured to listen to plaintext files and synchronize file events.

const { LanguageClient, TransportKind } = require('vscode-languageclient/node');
const client = new LanguageClient(
  'languageServerExample',
  'Language Server Example',
  {
    command: 'path/to/language-server',
    args: [],
    transport: TransportKind.stdio
  },
  {
    documentSelector: [{ scheme: 'file', language: 'plaintext' }],
    synchronize: {
      fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
    }
  }
);
client.start();

Handle Server Notifications

This code sets up a handler for custom notifications sent from the language server to the client. It logs the received notification parameters to the console.

client.onReady().then(() => {
  client.onNotification('custom/notification', (params) => {
    console.log('Received custom notification:', params);
  });
});

Send Custom Requests

This code sends a custom request from the client to the language server and logs the server's response.

client.onReady().then(() => {
  client.sendRequest('custom/request', { text: 'Hello, server!' }).then((response) => {
    console.log('Received response:', response);
  });
});

Other packages similar to vscode-languageclient

FAQs

Package last updated on 13 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc