Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
vscode-languageclient
Advanced tools
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.
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);
});
});
The vscode-languageserver package provides tools to implement a language server. It is often used in conjunction with vscode-languageclient to create a full language server-client setup. While vscode-languageclient is focused on the client-side, vscode-languageserver provides the server-side implementation.
The monaco-languageclient package is similar to vscode-languageclient but is designed for use with the Monaco Editor, which is the editor that powers VS Code. It allows for language server communication in web-based editors, providing similar functionalities to vscode-languageclient but in a different environment.
The lsp-client package is a lightweight alternative to vscode-languageclient. It provides basic functionalities to communicate with language servers using the Language Server Protocol (LSP). It is less feature-rich but can be a good choice for simpler use cases.
This npm module allows VSCode extensions to easily integrate language servers adhering to the language server protocol
See here for a detailed documentation on how to implement language servers for VSCode.
For the history please see the main repository
FAQs
VSCode Language client implementation
We found that vscode-languageclient demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.