codemirror-languageserver 1.22.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -6
- package/dist/plugin.d.ts +1 -1
- package/docs/dist/gh-pages.js +29706 -31537
- package/docs/index.html +1 -1
- package/package.json +19 -21
- package/rollup.config.gh-pages.js +0 -4
- package/tsconfig.check.json +10 -0
- package/tsconfig.json +2 -1
- package/.babelrc +0 -5
- package/tslint.json +0 -9
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ import { formatDocument, formatSelection } from 'codemirror-languageserver';
|
|
|
167
167
|
|
|
168
168
|
const formattingKeymap = keymap.of([
|
|
169
169
|
{ key: 'Shift-Alt-f', run: formatDocument },
|
|
170
|
-
{ key: '
|
|
170
|
+
{ key: 'Shift-Alt-g', run: formatSelection },
|
|
171
171
|
]);
|
|
172
172
|
```
|
|
173
173
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { LanguageServerClient, languageServerPlugin, SynchronizationMethod, } from './plugin';
|
|
2
|
-
export { WebSocketTransport } from './jsonrpc';
|
|
3
|
-
export type { Transport } from './jsonrpc';
|
|
4
|
-
export { jumpToDefinition, jumpToDefinitionPos, jumpToDefinitionKeymap, } from './definition';
|
|
5
|
-
export { formatDocument, formatSelection, formattingOptions, } from './formatting';
|
|
6
|
-
export { renameSymbol } from './rename';
|
|
7
|
-
export { PyrightInitializationOptions, RustAnalyzerInitializationOptions, TypeScriptInitializationOptions, ESLintInitializationOptions, ClangdInitializationOptions, GoplsInitializationOptions, } from './initialization';
|
|
8
|
-
import { LanguageServerClient, SynchronizationMethod } from './plugin';
|
|
9
|
-
import type { LanguageServerClientOptions, LanguageServerBaseOptions } from './plugin';
|
|
1
|
+
export { LanguageServerClient, languageServerPlugin, SynchronizationMethod, } from './plugin.js';
|
|
2
|
+
export { WebSocketTransport } from './jsonrpc.js';
|
|
3
|
+
export type { Transport } from './jsonrpc.js';
|
|
4
|
+
export { jumpToDefinition, jumpToDefinitionPos, jumpToDefinitionKeymap, } from './definition.js';
|
|
5
|
+
export { formatDocument, formatSelection, formattingOptions, } from './formatting.js';
|
|
6
|
+
export { renameSymbol } from './rename.js';
|
|
7
|
+
export { PyrightInitializationOptions, RustAnalyzerInitializationOptions, TypeScriptInitializationOptions, ESLintInitializationOptions, ClangdInitializationOptions, GoplsInitializationOptions, } from './initialization.js';
|
|
8
|
+
import { LanguageServerClient, SynchronizationMethod } from './plugin.js';
|
|
9
|
+
import type { LanguageServerClientOptions, LanguageServerBaseOptions } from './plugin.js';
|
|
10
10
|
interface LanguageServerOptions<InitializationOptions = unknown> extends LanguageServerClientOptions<InitializationOptions> {
|
|
11
11
|
client?: LanguageServerClient<InitializationOptions>;
|
|
12
12
|
allowHTMLContent?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -665,7 +665,7 @@ class LanguageServerPlugin {
|
|
|
665
665
|
[DiagnosticSeverity.Information]: 'info',
|
|
666
666
|
[DiagnosticSeverity.Hint]: 'info',
|
|
667
667
|
}[severity],
|
|
668
|
-
message,
|
|
668
|
+
message: typeof message === 'string' ? message : message.value,
|
|
669
669
|
}))
|
|
670
670
|
.filter(({ from, to }) => from !== null &&
|
|
671
671
|
to !== null &&
|
|
@@ -894,7 +894,7 @@ function applyWorkspaceEdit(view, edit) {
|
|
|
894
894
|
if (change.textDocument.uri !== plugin.documentUri)
|
|
895
895
|
continue;
|
|
896
896
|
for (const e of change.edits) {
|
|
897
|
-
if ('
|
|
897
|
+
if ('newText' in e) {
|
|
898
898
|
changes.push({
|
|
899
899
|
from: posToOffset(view.state.doc, e.range.start),
|
|
900
900
|
to: posToOffset(view.state.doc, e.range.end),
|
|
@@ -972,8 +972,7 @@ function renameSymbol(view) {
|
|
|
972
972
|
const plugin = view.plugin(languageServerPlugin);
|
|
973
973
|
if (!plugin)
|
|
974
974
|
return false;
|
|
975
|
-
if (!plugin.client.ready ||
|
|
976
|
-
!((_a = plugin.client.capabilities) === null || _a === void 0 ? void 0 : _a.renameProvider)) {
|
|
975
|
+
if (!plugin.client.ready || !((_a = plugin.client.capabilities) === null || _a === void 0 ? void 0 : _a.renameProvider)) {
|
|
977
976
|
return false;
|
|
978
977
|
}
|
|
979
978
|
const pos = view.state.selection.main.head;
|
|
@@ -1103,7 +1102,9 @@ const highlightPlugin = ViewPlugin.fromClass(class {
|
|
|
1103
1102
|
const pos = state.selection.main.head;
|
|
1104
1103
|
if (!plugin.client.ready ||
|
|
1105
1104
|
!((_a = plugin.client.capabilities) === null || _a === void 0 ? void 0 : _a.documentHighlightProvider)) {
|
|
1106
|
-
view.dispatch({
|
|
1105
|
+
view.dispatch({
|
|
1106
|
+
effects: setHighlightsEffect.of(Decoration.none),
|
|
1107
|
+
});
|
|
1107
1108
|
return;
|
|
1108
1109
|
}
|
|
1109
1110
|
const result = await plugin.client.textDocumentDocumentHighlight({
|
|
@@ -1114,7 +1115,9 @@ const highlightPlugin = ViewPlugin.fromClass(class {
|
|
|
1114
1115
|
return;
|
|
1115
1116
|
}
|
|
1116
1117
|
if (!result || result.length === 0) {
|
|
1117
|
-
view.dispatch({
|
|
1118
|
+
view.dispatch({
|
|
1119
|
+
effects: setHighlightsEffect.of(Decoration.none),
|
|
1120
|
+
});
|
|
1118
1121
|
return;
|
|
1119
1122
|
}
|
|
1120
1123
|
const decorations = result
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorView, Tooltip, ViewPlugin } from '@codemirror/view';
|
|
2
|
-
import type { Transport } from './jsonrpc';
|
|
2
|
+
import type { Transport } from './jsonrpc.js';
|
|
3
3
|
import { CompletionTriggerKind } from 'vscode-languageserver-protocol';
|
|
4
4
|
import type { CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
5
5
|
import type { PluginValue, ViewUpdate } from '@codemirror/view';
|