monaco-yql-languages 1.12.0 → 1.12.1

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.
@@ -36,6 +36,7 @@ export function provideCompletionItems(getCompletionList, preserveOrder, getFilt
36
36
  //languages.CompletionItemKind.Text
37
37
  let kind = 18;
38
38
  let label;
39
+ let beforeCursorPart;
39
40
  let serverFilterText = '';
40
41
  let serverDocumentation;
41
42
  let serverDetail;
@@ -45,10 +46,12 @@ export function provideCompletionItems(getCompletionList, preserveOrder, getFilt
45
46
  serverFilterText = filterText;
46
47
  }
47
48
  label = text;
49
+ beforeCursorPart = text;
48
50
  kind = (_a = YqlCompletionTypeToMonacoKind[type]) !== null && _a !== void 0 ? _a : 18;
49
51
  if (shift) {
50
52
  const pos = text.length - shift;
51
53
  labelAsSnippet = text.slice(0, pos) + '$0' + text.slice(pos);
54
+ beforeCursorPart = text.slice(0, pos);
52
55
  }
53
56
  if (documentation) {
54
57
  serverDocumentation = { value: documentation };
@@ -57,6 +60,7 @@ export function provideCompletionItems(getCompletionList, preserveOrder, getFilt
57
60
  }
58
61
  else {
59
62
  label = item;
63
+ beforeCursorPart = item;
60
64
  }
61
65
  const suggest = label.length > 1
62
66
  ? label.slice(0, -1).replace(/[/[]/g, '\\\\$&') + label.slice(-1)
@@ -83,7 +87,9 @@ export function provideCompletionItems(getCompletionList, preserveOrder, getFilt
83
87
  insertText: labelAsSnippet || suggest,
84
88
  //4 - languages.CompletionItemInsertTextRule.InsertAsSnippet
85
89
  insertTextRules: labelAsSnippet ? 4 : undefined,
86
- command: label.endsWith('/') || label.endsWith('.`') || label.endsWith('::')
90
+ command: beforeCursorPart.endsWith('/') ||
91
+ beforeCursorPart.endsWith('.`') ||
92
+ beforeCursorPart.endsWith('::')
87
93
  ? { id: 'editor.action.triggerSuggest', title: '' }
88
94
  : undefined,
89
95
  //@ts-ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monaco-yql-languages",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "YQL languages for the Monaco Editor, based on monaco-languages.",
5
5
  "author": "YDB",
6
6
  "license": "MIT",