codemirror-languageserver 1.22.1 → 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/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 ('range' in e) {
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({ effects: setHighlightsEffect.of(Decoration.none) });
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({ effects: setHighlightsEffect.of(Decoration.none) });
1118
+ view.dispatch({
1119
+ effects: setHighlightsEffect.of(Decoration.none),
1120
+ });
1118
1121
  return;
1119
1122
  }
1120
1123
  const decorations = result