Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

codemirror-languageserver

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codemirror-languageserver - npm Package Compare versions

Comparing version
1.16.0
to
1.17.0
+28
-15
dist/index.js

@@ -90,2 +90,5 @@ import { insertCompletionText, autocompletion as autocompletion$1 } from '@codemirror/autocomplete';

preselectSupport: false,
resolveSupport: {
properties: ['detail', 'documentation'],
},
},

@@ -159,2 +162,5 @@ contextSupport: true,

}
async completionItemResolve(params) {
return await this.request('completionItem/resolve', params, timeout);
}
attachPlugin(plugin) {

@@ -333,3 +339,4 @@ this.plugins.push(plugin);

}
const options = items.map(({ detail, label, kind, textEdit, documentation, additionalTextEdits, }) => {
const options = items.map((item) => {
const { detail, label, kind, textEdit, documentation, additionalTextEdits, } = item;
const completion = {

@@ -372,16 +379,22 @@ label,

};
if (documentation) {
completion.info = async () => {
const dom = document.createElement('div');
dom.classList.add('documentation');
if (this.allowHTMLContent) {
dom.innerHTML = await formatContents(documentation);
}
else {
dom.textContent =
await formatContents(documentation);
}
return dom;
};
}
completion.info = async () => {
var _a;
let { documentation } = item;
if (!documentation &&
((_a = this.client.capabilities.completionProvider) === null || _a === void 0 ? void 0 : _a.resolveProvider)) {
const resolvedItem = await this.client.completionItemResolve(item);
documentation = resolvedItem.documentation;
}
if (!documentation)
return null;
const dom = document.createElement('div');
dom.classList.add('documentation');
if (this.allowHTMLContent) {
dom.innerHTML = await formatContents(documentation);
}
else {
dom.textContent = await formatContents(documentation);
}
return dom;
};
return completion;

@@ -388,0 +401,0 @@ });

@@ -27,2 +27,3 @@ import { EditorView, Tooltip, ViewPlugin } from '@codemirror/view';

];
'completionItem/resolve': [LSP.CompletionItem, LSP.CompletionItem];
}

@@ -73,2 +74,3 @@ interface LSPNotifyMap {

textDocumentTypeDefinition(params: LSP.TypeDefinitionParams): Promise<LSP.Location | LSP.Location[] | LSP.LocationLink[]>;
completionItemResolve(params: LSP.CompletionItem): Promise<LSP.CompletionItem>;
attachPlugin(plugin: LanguageServerPlugin): void;

@@ -75,0 +77,0 @@ detachPlugin(plugin: LanguageServerPlugin): void;

{
"name": "codemirror-languageserver",
"version": "1.16.0",
"version": "1.17.0",
"description": "Language Server Plugin for CodeMirror 6",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -13,3 +13,3 @@ # Language Server Plugin for CodeMirror 6

- ⌨️ Code Completion
- ⌨️ Code Completion (w/ Resolve Support)
- 📚 Hover Documentation

@@ -16,0 +16,0 @@ - 🩺 Diagnostics

Sorry, the diff of this file is too big to display