@harmoniclabs/pebble 0.1.3-dev3 → 0.1.3-dev4

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.
@@ -12,9 +12,27 @@ export declare class TirNamedDeconstructVarDecl implements ITirStmt, ITirVarDecl
12
12
  initExpr: TirExpr | undefined;
13
13
  isConst: boolean;
14
14
  readonly range: SourceRange;
15
+ /** range of just the constructor name identifier (for LSP) */
16
+ readonly constrNameRange?: SourceRange | undefined;
17
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
18
+ readonly fieldLabelRanges?: Map<string, {
19
+ range: SourceRange;
20
+ type: TirType;
21
+ }> | undefined;
22
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
23
+ readonly typeAnnotationRange?: SourceRange | undefined;
15
24
  constructor(
16
25
  /** only original (not aliased) constr name used in destructuring */
17
- constrName: string, fields: Map<string, TirVarDecl>, rest: string | undefined, type: TirType, initExpr: TirExpr | undefined, isConst: boolean, range: SourceRange);
26
+ constrName: string, fields: Map<string, TirVarDecl>, rest: string | undefined, type: TirType, initExpr: TirExpr | undefined, isConst: boolean, range: SourceRange,
27
+ /** range of just the constructor name identifier (for LSP) */
28
+ constrNameRange?: SourceRange | undefined,
29
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
30
+ fieldLabelRanges?: Map<string, {
31
+ range: SourceRange;
32
+ type: TirType;
33
+ }> | undefined,
34
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
35
+ typeAnnotationRange?: SourceRange | undefined);
18
36
  toString(): string;
19
37
  pretty(indent: number): string;
20
38
  deps(): string[];
@@ -7,9 +7,18 @@ export class TirNamedDeconstructVarDecl {
7
7
  initExpr;
8
8
  isConst;
9
9
  range;
10
+ constrNameRange;
11
+ fieldLabelRanges;
12
+ typeAnnotationRange;
10
13
  constructor(
11
14
  /** only original (not aliased) constr name used in destructuring */
12
- constrName, fields, rest, type, initExpr, isConst, range) {
15
+ constrName, fields, rest, type, initExpr, isConst, range,
16
+ /** range of just the constructor name identifier (for LSP) */
17
+ constrNameRange,
18
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
19
+ fieldLabelRanges,
20
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
21
+ typeAnnotationRange) {
13
22
  this.constrName = constrName;
14
23
  this.fields = fields;
15
24
  this.rest = rest;
@@ -17,6 +26,9 @@ export class TirNamedDeconstructVarDecl {
17
26
  this.initExpr = initExpr;
18
27
  this.isConst = isConst;
19
28
  this.range = range;
29
+ this.constrNameRange = constrNameRange;
30
+ this.fieldLabelRanges = fieldLabelRanges;
31
+ this.typeAnnotationRange = typeAnnotationRange;
20
32
  }
21
33
  toString() {
22
34
  return (`${this.isConst ? "const" : "let"} ` +
@@ -9,8 +9,16 @@ export declare class TirSimpleVarDecl implements ITirStmt, ITirVarDecl {
9
9
  initExpr: TirExpr | undefined;
10
10
  isConst: boolean;
11
11
  readonly range: SourceRange;
12
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
13
+ readonly typeAnnotationRange?: SourceRange | undefined;
14
+ /** original source name for internal-renamed params (e.g., `owner` for `§owner_0`) for LSP */
15
+ readonly sourceName?: string | undefined;
12
16
  constructor(name: string, type: TirType, initExpr: TirExpr | undefined, // deconstructed OR function param
13
- isConst: boolean, range: SourceRange);
17
+ isConst: boolean, range: SourceRange,
18
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
19
+ typeAnnotationRange?: SourceRange | undefined,
20
+ /** original source name for internal-renamed params (e.g., `owner` for `§owner_0`) for LSP */
21
+ sourceName?: string | undefined);
14
22
  clone(): TirSimpleVarDecl;
15
23
  toString(): string;
16
24
  pretty(indent: number): string;
@@ -4,13 +4,21 @@ export class TirSimpleVarDecl {
4
4
  initExpr;
5
5
  isConst;
6
6
  range;
7
+ typeAnnotationRange;
8
+ sourceName;
7
9
  constructor(name, type, initExpr, // deconstructed OR function param
8
- isConst, range) {
10
+ isConst, range,
11
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
12
+ typeAnnotationRange,
13
+ /** original source name for internal-renamed params (e.g., `owner` for `§owner_0`) for LSP */
14
+ sourceName) {
9
15
  this.name = name;
10
16
  this.type = type;
11
17
  this.initExpr = initExpr;
12
18
  this.isConst = isConst;
13
19
  this.range = range;
20
+ this.typeAnnotationRange = typeAnnotationRange;
21
+ this.sourceName = sourceName;
14
22
  }
15
23
  clone() {
16
24
  return new TirSimpleVarDecl(this.name, this.type, this.initExpr?.clone(), this.isConst, this.range);
@@ -10,7 +10,21 @@ export declare class TirSingleDeconstructVarDecl implements ITirStmt {
10
10
  initExpr: TirExpr | undefined;
11
11
  isConst: boolean;
12
12
  readonly range: SourceRange;
13
- constructor(fields: Map<string, TirVarDecl>, rest: string | undefined, type: TirType, initExpr: TirExpr | undefined, isConst: boolean, range: SourceRange);
13
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
14
+ readonly fieldLabelRanges?: Map<string, {
15
+ range: SourceRange;
16
+ type: TirType;
17
+ }> | undefined;
18
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
19
+ readonly typeAnnotationRange?: SourceRange | undefined;
20
+ constructor(fields: Map<string, TirVarDecl>, rest: string | undefined, type: TirType, initExpr: TirExpr | undefined, isConst: boolean, range: SourceRange,
21
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
22
+ fieldLabelRanges?: Map<string, {
23
+ range: SourceRange;
24
+ type: TirType;
25
+ }> | undefined,
26
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
27
+ typeAnnotationRange?: SourceRange | undefined);
14
28
  toString(): string;
15
29
  pretty(indent: number): string;
16
30
  deps(): string[];
@@ -6,13 +6,21 @@ export class TirSingleDeconstructVarDecl {
6
6
  initExpr;
7
7
  isConst;
8
8
  range;
9
- constructor(fields, rest, type, initExpr, isConst, range) {
9
+ fieldLabelRanges;
10
+ typeAnnotationRange;
11
+ constructor(fields, rest, type, initExpr, isConst, range,
12
+ /** source ranges and constructor-definition types of field label identifiers (for LSP hover) */
13
+ fieldLabelRanges,
14
+ /** range of explicit type annotation (e.g., `MyDatum` in `as MyDatum`) for LSP */
15
+ typeAnnotationRange) {
10
16
  this.fields = fields;
11
17
  this.rest = rest;
12
18
  this.type = type;
13
19
  this.initExpr = initExpr;
14
20
  this.isConst = isConst;
15
21
  this.range = range;
22
+ this.fieldLabelRanges = fieldLabelRanges;
23
+ this.typeAnnotationRange = typeAnnotationRange;
16
24
  }
17
25
  toString() {
18
26
  return (`${this.isConst ? "const" : "let"} ` +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harmoniclabs/pebble",
3
- "version": "0.1.3-dev3",
3
+ "version": "0.1.3-dev4",
4
4
  "description": "A simple, yet rock solid, functional language with an imperative bias, targeting UPLC",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",