@kusto/monaco-kusto 5.3.10 → 5.3.12

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.
@@ -25,7 +25,7 @@ declare module monaco.languages.kusto {
25
25
  formatter?: FormatterOptions;
26
26
  enableQueryWarnings?: boolean;
27
27
  enableQuerySuggestions?: boolean;
28
- disabledDiagnoticCodes?: string[];
28
+ disabledDiagnosticCodes?: string[];
29
29
  }
30
30
 
31
31
  export interface SyntaxErrorAsMarkDownOptions {
@@ -38,7 +38,7 @@ declare module monaco.languages.kusto {
38
38
  indentationSize?: number;
39
39
  pipeOperatorStyle?: FormatterPlacementStyle;
40
40
  }
41
-
41
+
42
42
  export type FormatterPlacementStyle = 'None' | 'NewLine' | 'Smart';
43
43
 
44
44
  export interface LanguageServiceDefaults {
@@ -99,7 +99,7 @@ declare module monaco.languages.kusto {
99
99
 
100
100
  /**
101
101
  * Get all the ambient parameters defined in global scope.
102
- * Ambient parameters are parameters that are not defined in the syntax such as in a query paramter declaration.
102
+ * Ambient parameters are parameters that are not defined in the syntax such as in a query parameter declaration.
103
103
  * These are parameters that are injected from outside, usually by a UX application that would like to offer
104
104
  * the user intellisense for a symbol, without forcing them to write a query declaration statement.
105
105
  * Usually the same application injects the query declaration statement and the parameter values when
@@ -121,14 +121,22 @@ declare module monaco.languages.kusto {
121
121
  doDocumentFormat(uri: string): Promise<ls.TextEdit[]>;
122
122
  doRangeFormat(uri: string, range: ls.Range): Promise<ls.TextEdit[]>;
123
123
  doCurrentCommandFormat(uri: string, caretPosition: ls.Position): Promise<ls.TextEdit[]>;
124
- doValidation(uri: string, intervals: { start: number; end: number }[], includeWarnings?: boolean, includeSuggestions?: boolean): Promise<ls.Diagnostic[]>;
125
- setParameters(scalarParameters: ScalarParameter[], tabularParameters: TabularParameter): void;
124
+ doValidation(
125
+ uri: string,
126
+ intervals: { start: number; end: number }[],
127
+ includeWarnings?: boolean,
128
+ includeSuggestions?: boolean
129
+ ): Promise<ls.Diagnostic[]>;
130
+ setParameters(
131
+ scalarParameters: readonly ScalarParameter[],
132
+ tabularParameters: readonly TabularParameter[]
133
+ ): void;
126
134
  /**
127
- * Get all the database references from the current command.
135
+ * Get all the database references from the current command.
128
136
  * If database's schema is already cached in previous calls to setSchema or addDatabaseToSchema it will not be returned.
129
137
  * This method should be used to get all the cross-databases in a command, then schema for the database should be fetched and added with addDatabaseToSchema.
130
138
  * @example
131
- * If the current command includes: cluster('help').database('Samples')
139
+ * If the current command includes: cluster('help').database('Samples')
132
140
  * getDatabaseReferences will return [{ clusterName: 'help', databaseName 'Samples' }]
133
141
  */
134
142
  getDatabaseReferences(uri: string, cursorOffset: number): Promise<DatabaseReference[]>;
@@ -150,7 +158,7 @@ declare module monaco.languages.kusto {
150
158
  * @param clusterName the name of the cluster as returned from getDatabaseReferences/getClusterReferences.
151
159
  * @example
152
160
  * - User enters cluster('help').database('Samples')
153
- * - hosting app calls getDatabaseReferences which returns [{ clusterName: 'help', databaseName: 'Samples' }].
161
+ * - hosting app calls getDatabaseReferences which returns [{ clusterName: 'help', databaseName: 'Samples' }].
154
162
  * - hosting app fetches the database Schema from https://help.kusto.windows.net
155
163
  * - hosting app calls 'addDatabaseToSchema' with the database's schema.
156
164
  * - now, when user types cluster('help').database('Samples') then the auto complete list will show all the tables.
@@ -161,12 +169,12 @@ declare module monaco.languages.kusto {
161
169
  * @param clusterName the name of the cluster as returned in getClusterReferences.
162
170
  * @example
163
171
  * - User enters cluster('help')
164
- * - hosting app calls getClusterReferences which returns [{ clusterName: 'help' }].
172
+ * - hosting app calls getClusterReferences which returns [{ clusterName: 'help' }].
165
173
  * - hosting app fetches the list of databases from https://help.kusto.windows.net
166
174
  * - hosting app calls addClusterToSchema with the list of databases.
167
175
  * - now, when user type `cluster('help').database(` then the auto complete list will show all the databases.
168
176
  */
169
- addClusterToSchema(uri: string, clusterName: string, databasesNames: string[]): Promise<void>;
177
+ addClusterToSchema(uri: string, clusterName: string, databasesNames: readonly string[]): Promise<void>;
170
178
  }
171
179
 
172
180
  /**
@@ -194,8 +202,10 @@ declare module monaco.languages.kusto {
194
202
  cslDefaultValue?: string;
195
203
  }
196
204
 
197
- export interface TabularParameter extends ScalarParameter {
198
- columns: Column[]
205
+ export interface TabularParameter {
206
+ name: string;
207
+ columns: Column[];
208
+ docstring?: string;
199
209
  }
200
210
 
201
211
  // an input parameter either be a scalar in which case it has a name, type and cslType, or it can be columnar, in which case
@@ -288,11 +298,11 @@ declare module monaco.languages.kusto {
288
298
 
289
299
  export interface DatabaseReference {
290
300
  databaseName: string;
291
- clusterName: string;
292
- };
301
+ clusterName: string;
302
+ }
293
303
 
294
304
  export interface ClusterReference {
295
- clusterName: string;
305
+ clusterName: string;
296
306
  }
297
307
 
298
308
  export type RenderOptionKeys = keyof RenderOptions;
package/scripts/bundle.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const requirejs = require('requirejs');
2
2
  const path = require('path');
3
3
  const fs = require('fs');
4
- const Terser = require("terser");
4
+ const Terser = require('terser');
5
5
  const helpers = require('monaco-plugin-helpers');
6
6
 
7
7
  const REPO_ROOT = path.resolve(__dirname, '..');
@@ -11,55 +11,62 @@ const semver = require('../package.json').version;
11
11
  const headerVersion = semver + '(' + sha1 + ')';
12
12
 
13
13
  const BUNDLED_FILE_HEADER = [
14
- '/*!-----------------------------------------------------------------------------',
15
- ' * Copyright (c) Microsoft Corporation. All rights reserved.',
16
- ' * monaco-kusto version: ' + headerVersion,
17
- ' * Released under the MIT license',
18
- ' * https://https://github.com/Azure/monaco-kusto/blob/master/README.md',
19
- ' *-----------------------------------------------------------------------------*/',
20
- ''
14
+ '/*!-----------------------------------------------------------------------------',
15
+ ' * Copyright (c) Microsoft Corporation. All rights reserved.',
16
+ ' * monaco-kusto version: ' + headerVersion,
17
+ ' * Released under the MIT license',
18
+ ' * https://https://github.com/Azure/monaco-kusto/blob/master/README.md',
19
+ ' *-----------------------------------------------------------------------------*/',
20
+ '',
21
21
  ].join('\n');
22
22
 
23
- bundleOne('monaco.contribution', ['vs/language/kusto/kustoMode']),
24
- bundleOne('kustoMode'),
25
- bundleOne('kustoWorker')
23
+ bundleOne('monaco.contribution', ['vs/language/kusto/kustoMode']), bundleOne('kustoMode'), bundleOne('kustoWorker');
26
24
 
27
25
  function bundleOne(moduleId, exclude) {
28
- requirejs.optimize({
29
- baseUrl: './',
30
- name: 'vs/language/kusto/' + moduleId,
31
- out: 'release/dev/' + moduleId + '.js',
32
- exclude: exclude,
33
- paths: {
34
- 'vs/language/kusto': REPO_ROOT + '/out/amd'
35
- },
36
- optimize: 'none',
37
- packages: [{
38
- name: 'vscode-languageserver-types',
39
- location: path.join(REPO_ROOT, '/node_modules/vscode-languageserver-types/lib/umd'),
40
- main: 'main'
41
- }, {
42
- name: 'xregexp',
43
- location: path.join(REPO_ROOT, '/node_modules/xregexp'),
44
- main: 'xregexp-all.js'
45
- }, {
46
- name: 'lodash',
47
- location: path.join(REPO_ROOT, '/node_modules/lodash'),
48
- main: 'lodash.min.js'
49
- }],
50
- }, function (buildResponse) {
51
- const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js');
52
- const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js');
53
- const fileContents = fs.readFileSync(devFilePath).toString();
54
- console.log();
55
- console.log(`Minifying ${devFilePath}...`);
56
- const result = Terser.minify(fileContents, {
57
- output: {
58
- comments: 'some'
59
- }
60
- });
61
- console.log(`Done.`);
62
- try { fs.mkdirSync(path.join(REPO_ROOT, 'release/min')) } catch (err) { }
63
- fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code);
64
- })
26
+ requirejs.optimize(
27
+ {
28
+ baseUrl: './',
29
+ name: 'vs/language/kusto/' + moduleId,
30
+ out: 'release/dev/' + moduleId + '.js',
31
+ exclude: exclude,
32
+ paths: {
33
+ 'vs/language/kusto': REPO_ROOT + '/out/amd',
34
+ },
35
+ optimize: 'none',
36
+ packages: [
37
+ {
38
+ name: 'vscode-languageserver-types',
39
+ location: path.join(REPO_ROOT, '/node_modules/vscode-languageserver-types/lib/umd'),
40
+ main: 'main',
41
+ },
42
+ {
43
+ name: 'xregexp',
44
+ location: path.join(REPO_ROOT, '/node_modules/xregexp'),
45
+ main: 'xregexp-all.js',
46
+ },
47
+ {
48
+ name: 'lodash',
49
+ location: path.join(REPO_ROOT, '/node_modules/lodash'),
50
+ main: 'lodash.min.js',
51
+ },
52
+ ],
53
+ },
54
+ function (buildResponse) {
55
+ const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js');
56
+ const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js');
57
+ const fileContents = fs.readFileSync(devFilePath).toString();
58
+ console.log();
59
+ console.log(`Minifying ${devFilePath}...`);
60
+ const result = Terser.minify(fileContents, {
61
+ output: {
62
+ comments: 'some',
63
+ },
64
+ });
65
+ console.log(`Done.`);
66
+ try {
67
+ fs.mkdirSync(path.join(REPO_ROOT, 'release/min'));
68
+ } catch (err) {}
69
+ fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code);
70
+ }
71
+ );
65
72
  }
@@ -4,23 +4,16 @@ const helpers = require('monaco-plugin-helpers');
4
4
  const REPO_ROOT = path.join(__dirname, '../');
5
5
 
6
6
  helpers.packageESM({
7
- repoRoot: REPO_ROOT,
8
- esmSource: 'out/esm',
9
- esmDestination: 'release/esm',
10
- entryPoints: [
11
- 'monaco.contribution.js',
12
- 'kustoMode.js',
13
- 'kusto.worker.js',
14
- ],
15
- resolveAlias: {
16
- },
17
- resolveSkip: [
18
- 'monaco-editor-core'
19
- ],
20
- destinationFolderSimplification: {
21
- 'node_modules': '_deps',
22
- 'vscode-languageserver-types/lib/esm': 'vscode-languageserver-types',
23
- '/node_modules/xregexp': 'xregexp',
24
- '/node_modules/lodash': 'lodash'
25
- }
26
- });
7
+ repoRoot: REPO_ROOT,
8
+ esmSource: 'out/esm',
9
+ esmDestination: 'release/esm',
10
+ entryPoints: ['monaco.contribution.js', 'kustoMode.js', 'kusto.worker.js'],
11
+ resolveAlias: {},
12
+ resolveSkip: ['monaco-editor-core'],
13
+ destinationFolderSimplification: {
14
+ node_modules: '_deps',
15
+ 'vscode-languageserver-types/lib/esm': 'vscode-languageserver-types',
16
+ '/node_modules/xregexp': 'xregexp',
17
+ '/node_modules/lodash': 'lodash',
18
+ },
19
+ });
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "outDir": "./out/esm",
7
+ "target": "es5",
8
+ "lib": ["es2020", "dom", "WebWorker.ImportScripts"],
9
+ "alwaysStrict": true,
10
+ "declaration": true,
11
+ "skipLibCheck": true,
12
+ "types": [
13
+ "monaco-editor-core/monaco",
14
+ "@kusto/language-service/Kusto.JavaScript.Client",
15
+ "@kusto/language-service-next/Kusto.Language.Bridge"
16
+ ]
17
+ }
18
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "include": ["./src/**/*"],
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "module": "amd",
7
+ "moduleResolution": "node",
8
+ "outDir": "./out/amd",
9
+ "target": "es5",
10
+ "lib": ["es2020", "dom", "WebWorker.ImportScripts"],
11
+ "alwaysStrict": true,
12
+ "declaration": true,
13
+ "skipLibCheck": true,
14
+ "types": [
15
+ "monaco-editor-core/monaco",
16
+ "@kusto/language-service/Kusto.JavaScript.Client",
17
+ "@kusto/language-service-next/Kusto.Language.Bridge"
18
+ ]
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "./tsconfig.json",
4
+ "compilerOptions": {
5
+ "sourceMap": true,
6
+ "sourceRoot": "./src"
7
+ }
8
+ }