@kusto/monaco-kusto 4.0.3 → 4.1.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.
@@ -119,6 +119,33 @@ declare module monaco.languages.kusto {
119
119
  doCurrentCommandFormat(uri: string, caretPosition: ls.Position): Promise<ls.TextEdit[]>;
120
120
  doValidation(uri: string, intervals: { start: number; end: number }[]): Promise<ls.Diagnostic[]>;
121
121
  setParameters(parameters: ScalarParameter[]): void;
122
+ /**
123
+ * Get all the database references from the current command.
124
+ * If database's schema is already cached it will not be returned.
125
+ * 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.
126
+ * @example
127
+ * If the current command includes: cluster('help').database('Samples')
128
+ * it returns [{ clusterName: 'help', databaseName 'Samples' }]
129
+ */
130
+ getDatabaseReferences(uri: string, cursorOffset: number): Promise<DatabaseReference[]>;
131
+ /**
132
+ * Get all the cluster references from the current command.
133
+ * If cluster's schema is already cached it will not be returned.
134
+ * This method should be used to get all the cross-clusters in a command, then schema for the cluster should be fetched and added with addClusterToSchema.
135
+ * @example
136
+ * If the current command includes: cluster('help')
137
+ * it returns [{ clusterName: 'help' }]
138
+ */
139
+ getClusterReferences(uri: string, cursorOffset: number): Promise<ClusterReference[]>;
140
+ /**
141
+ * Adds a database's scheme. Useful with getDatabaseReferences to load schema for cross-cluster commands.
142
+ */
143
+ addDatabaseToSchema(uri: string, clusterName: string, databaseSchema: Database): Promise<void>;
144
+ /**
145
+ * Adds a cluster's scheme (database names only). Useful with getClusterReferences to load schema for cross-cluster commands.
146
+ * To load a full database schema call addDatabaseToSchema.
147
+ */
148
+ addClusterToSchema(uri: string, clusterName: string, databasesNames: string[]): Promise<void>;
122
149
  }
123
150
 
124
151
  /**
@@ -234,6 +261,15 @@ declare module monaco.languages.kusto {
234
261
  location: { startOffset: number; endOffset: number };
235
262
  }
236
263
 
264
+ export interface DatabaseReference {
265
+ databaseName: string;
266
+ clusterName: string;
267
+ };
268
+
269
+ export interface ClusterReference {
270
+ clusterName: string;
271
+ }
272
+
237
273
  export type RenderOptionKeys = keyof RenderOptions;
238
274
 
239
275
  export type OnDidProvideCompletionItems = (list: ls.CompletionList) => Promise<ls.CompletionList>;