@intersystems-community/ascot 0.1.2 → 0.3.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.
@@ -1,4 +1,8 @@
1
1
  /** @module Interface iris:ascot/common **/
2
+ export interface RoutineSource {
3
+ text: string,
4
+ uri?: string,
5
+ }
2
6
  export interface Position {
3
7
  line: number,
4
8
  character: number,
@@ -25,6 +29,22 @@ export interface PropertyInfo {
25
29
  collection?: CollectionKind,
26
30
  multidimensional: boolean,
27
31
  }
32
+ /**
33
+ * # Variants
34
+ *
35
+ * ## `"one"`
36
+ *
37
+ * ## `"many"`
38
+ *
39
+ * ## `"parent"`
40
+ *
41
+ * ## `"children"`
42
+ */
43
+ export type Cardinality = 'one' | 'many' | 'parent' | 'children';
44
+ export interface RelationshipInfo {
45
+ t?: string,
46
+ cardinality?: Cardinality,
47
+ }
28
48
  /**
29
49
  * # Variants
30
50
  *
@@ -70,7 +90,7 @@ export interface MemberKindProperty {
70
90
  }
71
91
  export interface MemberKindRelationship {
72
92
  tag: 'relationship',
73
- val: string | undefined,
93
+ val: RelationshipInfo,
74
94
  }
75
95
  export interface MemberKindForeignKey {
76
96
  tag: 'foreign-key',
@@ -127,10 +147,6 @@ export interface ClassInfo {
127
147
  isDatatype?: boolean,
128
148
  uri?: string,
129
149
  }
130
- export interface RoutineSource {
131
- text: string,
132
- uri?: string,
133
- }
134
150
  export interface Location {
135
151
  uri: string,
136
152
  range: Range,
@@ -156,6 +172,8 @@ export interface Diagnostic {
156
172
  range: Range,
157
173
  relatedInformation: Array<DiagnosticRelatedInformation>,
158
174
  severity: DiagnosticSeverity,
175
+ code: string,
176
+ codeDescription: string,
159
177
  }
160
178
  export interface InlayHint {
161
179
  position: Position,
@@ -208,3 +226,222 @@ export interface WorkspaceSymbol {
208
226
  deprecated: boolean,
209
227
  location: Location,
210
228
  }
229
+ /**
230
+ * # Variants
231
+ *
232
+ * ## `"long"`
233
+ *
234
+ * ## `"short"`
235
+ */
236
+ export type KeywordForm = 'long' | 'short';
237
+ /**
238
+ * # Variants
239
+ *
240
+ * ## `"lower"`
241
+ *
242
+ * ## `"upper"`
243
+ *
244
+ * ## `"pascal"`
245
+ */
246
+ export type KeywordCase = 'lower' | 'upper' | 'pascal';
247
+ export interface KeywordStyle {
248
+ form?: KeywordForm,
249
+ 'case'?: KeywordCase,
250
+ }
251
+ export interface Style {
252
+ command?: KeywordStyle,
253
+ commandDo?: KeywordStyle,
254
+ commandIf?: KeywordStyle,
255
+ commandElseif?: KeywordStyle,
256
+ commandElse?: KeywordStyle,
257
+ commandWhile?: KeywordStyle,
258
+ commandFor?: KeywordStyle,
259
+ commandGoto?: KeywordStyle,
260
+ commandBreak?: KeywordStyle,
261
+ commandQuit?: KeywordStyle,
262
+ commandZquit?: KeywordStyle,
263
+ commandReturn?: KeywordStyle,
264
+ commandContinue?: KeywordStyle,
265
+ commandSet?: KeywordStyle,
266
+ commandKill?: KeywordStyle,
267
+ commandNew?: KeywordStyle,
268
+ commandMerge?: KeywordStyle,
269
+ commandTry?: KeywordStyle,
270
+ commandCatch?: KeywordStyle,
271
+ commandThrow?: KeywordStyle,
272
+ commandZtrap?: KeywordStyle,
273
+ commandZzdump?: KeywordStyle,
274
+ commandWrite?: KeywordStyle,
275
+ commandRead?: KeywordStyle,
276
+ commandOpen?: KeywordStyle,
277
+ commandClose?: KeywordStyle,
278
+ commandUse?: KeywordStyle,
279
+ commandLock?: KeywordStyle,
280
+ commandHalt?: KeywordStyle,
281
+ commandHang?: KeywordStyle,
282
+ commandJob?: KeywordStyle,
283
+ commandTstart?: KeywordStyle,
284
+ commandTcommit?: KeywordStyle,
285
+ commandTrollback?: KeywordStyle,
286
+ commandZwrite?: KeywordStyle,
287
+ commandZkill?: KeywordStyle,
288
+ commandZnspace?: KeywordStyle,
289
+ commandXecute?: KeywordStyle,
290
+ commandView?: KeywordStyle,
291
+ commandZprint?: KeywordStyle,
292
+ commandPrint?: KeywordStyle,
293
+ commandZbreak?: KeywordStyle,
294
+ commandMvprint?: KeywordStyle,
295
+ commandMvcrt?: KeywordStyle,
296
+ 'function'?: KeywordStyle,
297
+ functionAscii?: KeywordStyle,
298
+ functionBit?: KeywordStyle,
299
+ functionBitcount?: KeywordStyle,
300
+ functionBitfind?: KeywordStyle,
301
+ functionBitlogic?: KeywordStyle,
302
+ functionCase?: KeywordStyle,
303
+ functionChange?: KeywordStyle,
304
+ functionChar?: KeywordStyle,
305
+ functionClassmethod?: KeywordStyle,
306
+ functionClassname?: KeywordStyle,
307
+ functionCompile?: KeywordStyle,
308
+ functionData?: KeywordStyle,
309
+ functionDecimal?: KeywordStyle,
310
+ functionDouble?: KeywordStyle,
311
+ functionExtract?: KeywordStyle,
312
+ functionFactor?: KeywordStyle,
313
+ functionFind?: KeywordStyle,
314
+ functionFnumber?: KeywordStyle,
315
+ functionGet?: KeywordStyle,
316
+ functionIncrement?: KeywordStyle,
317
+ functionInumber?: KeywordStyle,
318
+ functionIsobject?: KeywordStyle,
319
+ functionIsvaliddouble?: KeywordStyle,
320
+ functionIsvalidnum?: KeywordStyle,
321
+ functionIsvector?: KeywordStyle,
322
+ functionJustify?: KeywordStyle,
323
+ functionLength?: KeywordStyle,
324
+ functionList?: KeywordStyle,
325
+ functionListbuild?: KeywordStyle,
326
+ functionListdata?: KeywordStyle,
327
+ functionListfind?: KeywordStyle,
328
+ functionListfromstring?: KeywordStyle,
329
+ functionListget?: KeywordStyle,
330
+ functionListlength?: KeywordStyle,
331
+ functionListnext?: KeywordStyle,
332
+ functionListsame?: KeywordStyle,
333
+ functionListtostring?: KeywordStyle,
334
+ functionListupdate?: KeywordStyle,
335
+ functionListvalid?: KeywordStyle,
336
+ functionLocate?: KeywordStyle,
337
+ functionLock?: KeywordStyle,
338
+ functionMatch?: KeywordStyle,
339
+ functionMethod?: KeywordStyle,
340
+ functionMv?: KeywordStyle,
341
+ functionMvv?: KeywordStyle,
342
+ functionName?: KeywordStyle,
343
+ functionNconvert?: KeywordStyle,
344
+ functionNext?: KeywordStyle,
345
+ functionNormalize?: KeywordStyle,
346
+ functionNow?: KeywordStyle,
347
+ functionNumber?: KeywordStyle,
348
+ functionOrder?: KeywordStyle,
349
+ functionParameter?: KeywordStyle,
350
+ functionPiece?: KeywordStyle,
351
+ functionPrefetchoff?: KeywordStyle,
352
+ functionPrefetchon?: KeywordStyle,
353
+ functionProperty?: KeywordStyle,
354
+ functionQlength?: KeywordStyle,
355
+ functionQsubscript?: KeywordStyle,
356
+ functionQuery?: KeywordStyle,
357
+ functionRandom?: KeywordStyle,
358
+ functionReplace?: KeywordStyle,
359
+ functionReverse?: KeywordStyle,
360
+ functionSconvert?: KeywordStyle,
361
+ functionSelect?: KeywordStyle,
362
+ functionSequence?: KeywordStyle,
363
+ functionSortbegin?: KeywordStyle,
364
+ functionSortend?: KeywordStyle,
365
+ functionStack?: KeywordStyle,
366
+ functionText?: KeywordStyle,
367
+ functionTranslate?: KeywordStyle,
368
+ functionVector?: KeywordStyle,
369
+ functionVectordefined?: KeywordStyle,
370
+ functionVectorop?: KeywordStyle,
371
+ functionView?: KeywordStyle,
372
+ functionWascii?: KeywordStyle,
373
+ functionWchar?: KeywordStyle,
374
+ functionWextract?: KeywordStyle,
375
+ functionWfind?: KeywordStyle,
376
+ functionWiswide?: KeywordStyle,
377
+ functionWlength?: KeywordStyle,
378
+ functionWreverse?: KeywordStyle,
379
+ functionXecute?: KeywordStyle,
380
+ functionZabs?: KeywordStyle,
381
+ functionZarccos?: KeywordStyle,
382
+ functionZarcsin?: KeywordStyle,
383
+ functionZarctan?: KeywordStyle,
384
+ functionZbitand?: KeywordStyle,
385
+ functionZbitcount?: KeywordStyle,
386
+ functionZbitfind?: KeywordStyle,
387
+ functionZbitget?: KeywordStyle,
388
+ functionZbitlen?: KeywordStyle,
389
+ functionZbitnot?: KeywordStyle,
390
+ functionZbitor?: KeywordStyle,
391
+ functionZbitset?: KeywordStyle,
392
+ functionZbitstr?: KeywordStyle,
393
+ functionZbitxor?: KeywordStyle,
394
+ functionZboolean?: KeywordStyle,
395
+ functionZconvert?: KeywordStyle,
396
+ functionZcos?: KeywordStyle,
397
+ functionZcot?: KeywordStyle,
398
+ functionZcrc?: KeywordStyle,
399
+ functionZcsc?: KeywordStyle,
400
+ functionZcyc?: KeywordStyle,
401
+ functionZdascii?: KeywordStyle,
402
+ functionZdate?: KeywordStyle,
403
+ functionZdateh?: KeywordStyle,
404
+ functionZdatetime?: KeywordStyle,
405
+ functionZdatetimeh?: KeywordStyle,
406
+ functionZdchar?: KeywordStyle,
407
+ functionZexp?: KeywordStyle,
408
+ functionZf?: KeywordStyle,
409
+ functionZhex?: KeywordStyle,
410
+ functionZincrement?: KeywordStyle,
411
+ functionZiswide?: KeywordStyle,
412
+ functionZlascii?: KeywordStyle,
413
+ functionZlchar?: KeywordStyle,
414
+ functionZln?: KeywordStyle,
415
+ functionZlog?: KeywordStyle,
416
+ functionZname?: KeywordStyle,
417
+ functionZobjclass?: KeywordStyle,
418
+ functionZobjclassmethod?: KeywordStyle,
419
+ functionZobjmethod?: KeywordStyle,
420
+ functionZobjproperty?: KeywordStyle,
421
+ functionZobjref?: KeywordStyle,
422
+ functionZorder?: KeywordStyle,
423
+ functionZposition?: KeywordStyle,
424
+ functionZpower?: KeywordStyle,
425
+ functionZprevious?: KeywordStyle,
426
+ functionZqascii?: KeywordStyle,
427
+ functionZqchar?: KeywordStyle,
428
+ functionZsearch?: KeywordStyle,
429
+ functionZsec?: KeywordStyle,
430
+ functionZseek?: KeywordStyle,
431
+ functionZsin?: KeywordStyle,
432
+ functionZsqr?: KeywordStyle,
433
+ functionZstrip?: KeywordStyle,
434
+ functionZtan?: KeywordStyle,
435
+ functionZtime?: KeywordStyle,
436
+ functionZtimeh?: KeywordStyle,
437
+ functionZutil?: KeywordStyle,
438
+ functionZversion?: KeywordStyle,
439
+ functionZwascii?: KeywordStyle,
440
+ functionZwbpack?: KeywordStyle,
441
+ functionZwbunpack?: KeywordStyle,
442
+ functionZwchar?: KeywordStyle,
443
+ functionZwidth?: KeywordStyle,
444
+ functionZwpack?: KeywordStyle,
445
+ functionZwunpack?: KeywordStyle,
446
+ functionZzenkaku?: KeywordStyle,
447
+ }
@@ -8,10 +8,11 @@ export type Range = import('./iris-ascot-common.js').Range;
8
8
  export type Location = import('./iris-ascot-common.js').Location;
9
9
  export type DocumentSymbol = import('./iris-ascot-common.js').DocumentSymbol;
10
10
  export type WorkspaceSymbol = import('./iris-ascot-common.js').WorkspaceSymbol;
11
+ export type Style = import('./iris-ascot-common.js').Style;
11
12
  export type IrisConnection = import('./iris-ascot-imported.js').IrisConnection;
12
13
 
13
14
  export class Workspace {
14
- constructor(env: IrisConnection | undefined)
15
+ constructor(env: IrisConnection | undefined, style: Style | undefined)
15
16
  open(uri: string, text: string): Array<string>;
16
17
  close(uri: string): Array<string>;
17
18
  diagnostics(uri: string): Promise<Array<Diagnostic>>;
@@ -1,6 +1,7 @@
1
1
  /** @module Interface iris:ascot/imported **/
2
- export type ClassInfo = import('./iris-ascot-common.js').ClassInfo;
3
2
  export type RoutineSource = import('./iris-ascot-common.js').RoutineSource;
3
+ export type ClassInfo = import('./iris-ascot-common.js').ClassInfo;
4
+ export type Option<T> = { tag: 'none' } | { tag: 'some', val: T };
4
5
 
5
6
  export class IrisConnection {
6
7
  /**
@@ -9,5 +10,5 @@ export class IrisConnection {
9
10
  private constructor();
10
11
  getCls(cls: string): Promise<ClassInfo | undefined>;
11
12
  getInc(name: string): Promise<RoutineSource | undefined>;
12
- getIntOrMac(name: string): Promise<RoutineSource | undefined>;
13
+ getIntOrMac(name: string): Promise<Option<RoutineSource | undefined>>;
13
14
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intersystems-community/ascot",
3
- "version": "0.1.2",
3
+ "version": "0.3.0",
4
4
  "description": "ascot, a type checker and code intelligence engine for InterSystems ObjectScript, for Node and other JS consumers.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "keywords": [
@@ -28,11 +28,14 @@
28
28
  "node": ">=24"
29
29
  },
30
30
  "scripts": {
31
- "build": "bash scripts/build.sh"
31
+ "build": "bash scripts/build.sh",
32
+ "format": "prettier --write .",
33
+ "format:check": "prettier --check ."
32
34
  },
33
35
  "devDependencies": {
34
36
  "@bytecodealliance/jco": "^1.37.0",
35
37
  "@types/node": "^26.6.5",
38
+ "prettier": "3.9.10",
36
39
  "typescript": "^7.0.2"
37
40
  }
38
41
  }