@glint/ember-tsc 1.1.2-unstable.0b9b1e9 → 1.2.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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/package.json +11 -12
  4. package/src/config/loader.ts +23 -3
  5. package/src/transform/template/template-to-typescript.ts +11 -1
  6. package/src/volar/language-server.ts +34 -80
  7. package/lib/cli/run-volar-tsc.d.ts +0 -2
  8. package/lib/cli/run-volar-tsc.d.ts.map +0 -1
  9. package/lib/cli/run-volar-tsc.js +0 -32
  10. package/lib/cli/run-volar-tsc.js.map +0 -1
  11. package/lib/config/config.d.ts +0 -15
  12. package/lib/config/config.d.ts.map +0 -1
  13. package/lib/config/config.js +0 -21
  14. package/lib/config/config.js.map +0 -1
  15. package/lib/config/environment.d.ts +0 -26
  16. package/lib/config/environment.d.ts.map +0 -1
  17. package/lib/config/environment.js +0 -96
  18. package/lib/config/environment.js.map +0 -1
  19. package/lib/config/index.d.ts +0 -17
  20. package/lib/config/index.d.ts.map +0 -1
  21. package/lib/config/index.js +0 -26
  22. package/lib/config/index.js.map +0 -1
  23. package/lib/config/loader.d.ts +0 -25
  24. package/lib/config/loader.d.ts.map +0 -1
  25. package/lib/config/loader.js +0 -110
  26. package/lib/config/loader.js.map +0 -1
  27. package/lib/config/types.cjs +0 -3
  28. package/lib/config/types.cjs.map +0 -1
  29. package/lib/config/types.d.cts +0 -60
  30. package/lib/config/types.d.cts.map +0 -1
  31. package/lib/environment-ember-template-imports/-private/environment/common.d.ts +0 -13
  32. package/lib/environment-ember-template-imports/-private/environment/common.d.ts.map +0 -1
  33. package/lib/environment-ember-template-imports/-private/environment/common.js +0 -2
  34. package/lib/environment-ember-template-imports/-private/environment/common.js.map +0 -1
  35. package/lib/environment-ember-template-imports/-private/environment/index.d.ts +0 -3
  36. package/lib/environment-ember-template-imports/-private/environment/index.d.ts.map +0 -1
  37. package/lib/environment-ember-template-imports/-private/environment/index.js +0 -76
  38. package/lib/environment-ember-template-imports/-private/environment/index.js.map +0 -1
  39. package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts +0 -4
  40. package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts.map +0 -1
  41. package/lib/environment-ember-template-imports/-private/environment/preprocess.js +0 -73
  42. package/lib/environment-ember-template-imports/-private/environment/preprocess.js.map +0 -1
  43. package/lib/environment-ember-template-imports/-private/environment/transform.d.ts +0 -4
  44. package/lib/environment-ember-template-imports/-private/environment/transform.d.ts.map +0 -1
  45. package/lib/environment-ember-template-imports/-private/environment/transform.js +0 -134
  46. package/lib/environment-ember-template-imports/-private/environment/transform.js.map +0 -1
  47. package/lib/index.d.ts +0 -7
  48. package/lib/index.d.ts.map +0 -1
  49. package/lib/index.js +0 -6
  50. package/lib/index.js.map +0 -1
  51. package/lib/plugins/g-compiler-errors.d.ts +0 -12
  52. package/lib/plugins/g-compiler-errors.d.ts.map +0 -1
  53. package/lib/plugins/g-compiler-errors.js +0 -58
  54. package/lib/plugins/g-compiler-errors.js.map +0 -1
  55. package/lib/plugins/g-template-tag-symbols.d.ts +0 -11
  56. package/lib/plugins/g-template-tag-symbols.d.ts.map +0 -1
  57. package/lib/plugins/g-template-tag-symbols.js +0 -48
  58. package/lib/plugins/g-template-tag-symbols.js.map +0 -1
  59. package/lib/plugins/utils.d.ts +0 -25
  60. package/lib/plugins/utils.d.ts.map +0 -1
  61. package/lib/plugins/utils.js +0 -63
  62. package/lib/plugins/utils.js.map +0 -1
  63. package/lib/transform/diagnostics/augmentation.d.ts +0 -4
  64. package/lib/transform/diagnostics/augmentation.d.ts.map +0 -1
  65. package/lib/transform/diagnostics/augmentation.js +0 -223
  66. package/lib/transform/diagnostics/augmentation.js.map +0 -1
  67. package/lib/transform/diagnostics/index.d.ts +0 -5
  68. package/lib/transform/diagnostics/index.d.ts.map +0 -1
  69. package/lib/transform/diagnostics/index.js +0 -2
  70. package/lib/transform/diagnostics/index.js.map +0 -1
  71. package/lib/transform/index.d.ts +0 -4
  72. package/lib/transform/index.d.ts.map +0 -1
  73. package/lib/transform/index.js +0 -2
  74. package/lib/transform/index.js.map +0 -1
  75. package/lib/transform/template/code-features.d.ts +0 -30
  76. package/lib/transform/template/code-features.d.ts.map +0 -1
  77. package/lib/transform/template/code-features.js +0 -26
  78. package/lib/transform/template/code-features.js.map +0 -1
  79. package/lib/transform/template/glimmer-ast-mapping-tree.d.ts +0 -80
  80. package/lib/transform/template/glimmer-ast-mapping-tree.d.ts.map +0 -1
  81. package/lib/transform/template/glimmer-ast-mapping-tree.js +0 -132
  82. package/lib/transform/template/glimmer-ast-mapping-tree.js.map +0 -1
  83. package/lib/transform/template/inlining/index.d.ts +0 -16
  84. package/lib/transform/template/inlining/index.d.ts.map +0 -1
  85. package/lib/transform/template/inlining/index.js +0 -21
  86. package/lib/transform/template/inlining/index.js.map +0 -1
  87. package/lib/transform/template/inlining/tagged-strings.d.ts +0 -8
  88. package/lib/transform/template/inlining/tagged-strings.d.ts.map +0 -1
  89. package/lib/transform/template/inlining/tagged-strings.js +0 -140
  90. package/lib/transform/template/inlining/tagged-strings.js.map +0 -1
  91. package/lib/transform/template/map-template-contents.d.ts +0 -121
  92. package/lib/transform/template/map-template-contents.d.ts.map +0 -1
  93. package/lib/transform/template/map-template-contents.js +0 -287
  94. package/lib/transform/template/map-template-contents.js.map +0 -1
  95. package/lib/transform/template/rewrite-module.d.ts +0 -22
  96. package/lib/transform/template/rewrite-module.d.ts.map +0 -1
  97. package/lib/transform/template/rewrite-module.js +0 -265
  98. package/lib/transform/template/rewrite-module.js.map +0 -1
  99. package/lib/transform/template/scope-stack.d.ts +0 -13
  100. package/lib/transform/template/scope-stack.d.ts.map +0 -1
  101. package/lib/transform/template/scope-stack.js +0 -28
  102. package/lib/transform/template/scope-stack.js.map +0 -1
  103. package/lib/transform/template/template-to-typescript.d.ts +0 -19
  104. package/lib/transform/template/template-to-typescript.d.ts.map +0 -1
  105. package/lib/transform/template/template-to-typescript.js +0 -1095
  106. package/lib/transform/template/template-to-typescript.js.map +0 -1
  107. package/lib/transform/template/transformed-module.d.ts +0 -111
  108. package/lib/transform/template/transformed-module.d.ts.map +0 -1
  109. package/lib/transform/template/transformed-module.js +0 -287
  110. package/lib/transform/template/transformed-module.js.map +0 -1
  111. package/lib/transform/util.d.ts +0 -7
  112. package/lib/transform/util.d.ts.map +0 -1
  113. package/lib/transform/util.js +0 -15
  114. package/lib/transform/util.js.map +0 -1
  115. package/lib/volar/ember-language-plugin.d.ts +0 -14
  116. package/lib/volar/ember-language-plugin.d.ts.map +0 -1
  117. package/lib/volar/ember-language-plugin.js +0 -91
  118. package/lib/volar/ember-language-plugin.js.map +0 -1
  119. package/lib/volar/gts-virtual-code.d.ts +0 -83
  120. package/lib/volar/gts-virtual-code.d.ts.map +0 -1
  121. package/lib/volar/gts-virtual-code.js +0 -210
  122. package/lib/volar/gts-virtual-code.js.map +0 -1
  123. package/lib/volar/language-server.d.ts +0 -2
  124. package/lib/volar/language-server.d.ts.map +0 -1
  125. package/lib/volar/language-server.js +0 -214
  126. package/lib/volar/language-server.js.map +0 -1
  127. package/lib/volar/script-snapshot.d.ts +0 -17
  128. package/lib/volar/script-snapshot.d.ts.map +0 -1
  129. package/lib/volar/script-snapshot.js +0 -24
  130. package/lib/volar/script-snapshot.js.map +0 -1
@@ -1,58 +0,0 @@
1
- import { getEmbeddedInfo } from './utils.js';
2
- /**
3
- * This LanguageServicePlugin surfaces compiler/syntax errors as diagnostics
4
- * within .gts/.gjs files, e.g. if there is an unclosed html tag or `{{` curly brace,
5
- * the entire `<template>` tag region will be highlighted as an error.
6
- *
7
- * @GLINT_FEATURE_DIAGNOSTICS
8
- * @GLINT_FEATURE_DIAGNOSTICS_LANGUAGE_SERVER
9
- * @GLINT_FEATURE_DIAGNOSTICS_LANGUAGE_SERVER_GTS_COMPILER_ERRORS
10
- */
11
- export function create() {
12
- return {
13
- name: 'g-compiler-errors',
14
- capabilities: {
15
- diagnosticProvider: {
16
- interFileDependencies: false,
17
- workspaceDiagnostics: false,
18
- },
19
- },
20
- create(context) {
21
- return {
22
- provideDiagnostics(document) {
23
- // `gts` is the ID of the root virtual code within the virtual/embedded code tree of our GtsVirtualCode.
24
- // It is the untransformed .gts file; we use this file to generate diagnostics for
25
- // `<template>` tag compiler errors because the diagnostic regions within the errors
26
- // we get back from the compiler are already relative to the root/outer .gts file
27
- // rather than relative to start of the template tag.
28
- const info = getEmbeddedInfo(context, document, 'gts');
29
- if (!info) {
30
- return;
31
- }
32
- const virtualCode = info.root;
33
- const transformedModule = virtualCode.transformedModule;
34
- if (!transformedModule) {
35
- return;
36
- }
37
- const parseErrors = [];
38
- for (const error of transformedModule.errors) {
39
- const start = document.positionAt(error.location.start);
40
- const end = document.positionAt(error.location.end);
41
- parseErrors.push({
42
- range: {
43
- start: start,
44
- end: end,
45
- },
46
- severity: 1,
47
- code: 9999,
48
- source: 'glint',
49
- message: error.message,
50
- });
51
- }
52
- return parseErrors;
53
- },
54
- };
55
- },
56
- };
57
- }
58
- //# sourceMappingURL=g-compiler-errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g-compiler-errors.js","sourceRoot":"","sources":["../../src/plugins/g-compiler-errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE;YACZ,kBAAkB,EAAE;gBAClB,qBAAqB,EAAE,KAAK;gBAC5B,oBAAoB,EAAE,KAAK;aAC5B;SACF;QACD,MAAM,CAAC,OAAO;YACZ,OAAO;gBACL,kBAAkB,CAAC,QAAQ;oBACzB,wGAAwG;oBACxG,kFAAkF;oBAClF,oFAAoF;oBACpF,iFAAiF;oBACjF,qDAAqD;oBACrD,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;oBAEvD,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,OAAO;oBACT,CAAC;oBAED,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;oBAE9B,MAAM,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,CAAC;oBACxD,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBACvB,OAAO;oBACT,CAAC;oBAED,MAAM,WAAW,GAAwB,EAAE,CAAC;oBAE5C,KAAK,MAAM,KAAK,IAAI,iBAAiB,CAAC,MAAM,EAAE,CAAC;wBAC7C,MAAM,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;wBACxD,MAAM,GAAG,GAAG,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;wBAEpD,WAAW,CAAC,IAAI,CAAC;4BACf,KAAK,EAAE;gCACL,KAAK,EAAE,KAAK;gCACZ,GAAG,EAAE,GAAG;6BACT;4BACD,QAAQ,EAAE,CAAkD;4BAC5D,IAAI,EAAE,IAAI;4BACV,MAAM,EAAE,OAAO;4BACf,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB,CAAC,CAAC;oBACL,CAAC;oBAED,OAAO,WAAW,CAAC;gBACrB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { LanguageServicePlugin } from '@volar/language-service';
2
- /**
3
- * Provides symbols for `<template>` tags within .gts/.gjs files.
4
- * This among other things faciliates code folding of the `<template>` region.
5
- *
6
- * Note that this ONLY provides symbols for the `<template>` tag and none of the
7
- * contents of the template tag. Symbols inside or outside the template tag are actually
8
- * generated by the syntactic TS LanguageServicePlugin (search `createTypeScriptSyntacticPlugin`).
9
- */
10
- export declare function create(): LanguageServicePlugin;
11
- //# sourceMappingURL=g-template-tag-symbols.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g-template-tag-symbols.d.ts","sourceRoot":"","sources":["../../src/plugins/g-template-tag-symbols.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAIrE;;;;;;;GAOG;AACH,wBAAgB,MAAM,IAAI,qBAAqB,CAyC9C"}
@@ -1,48 +0,0 @@
1
- import { getEmbeddedInfo } from './utils.js';
2
- /**
3
- * Provides symbols for `<template>` tags within .gts/.gjs files.
4
- * This among other things faciliates code folding of the `<template>` region.
5
- *
6
- * Note that this ONLY provides symbols for the `<template>` tag and none of the
7
- * contents of the template tag. Symbols inside or outside the template tag are actually
8
- * generated by the syntactic TS LanguageServicePlugin (search `createTypeScriptSyntacticPlugin`).
9
- */
10
- export function create() {
11
- return {
12
- name: 'g-template-symbols',
13
- capabilities: {
14
- documentSymbolProvider: true,
15
- },
16
- create(context) {
17
- return {
18
- provideDocumentSymbols(document) {
19
- const virtualCode = getEmbeddedInfo(context, document, 'gts')?.root;
20
- if (!virtualCode) {
21
- return;
22
- }
23
- const result = [];
24
- const { transformedModule } = virtualCode;
25
- if (transformedModule) {
26
- const templateSymbols = transformedModule.templateSymbols();
27
- for (const templateSymbol of templateSymbols) {
28
- result.push({
29
- name: 'template',
30
- kind: 2,
31
- range: {
32
- start: document.positionAt(templateSymbol.start),
33
- end: document.positionAt(templateSymbol.end),
34
- },
35
- selectionRange: {
36
- start: document.positionAt(templateSymbol.start),
37
- end: document.positionAt(templateSymbol.startTagEnd),
38
- },
39
- });
40
- }
41
- }
42
- return result;
43
- },
44
- };
45
- },
46
- };
47
- }
48
- //# sourceMappingURL=g-template-tag-symbols.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"g-template-tag-symbols.js","sourceRoot":"","sources":["../../src/plugins/g-template-tag-symbols.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,YAAY,EAAE;YACZ,sBAAsB,EAAE,IAAI;SAC7B;QACD,MAAM,CAAC,OAAO;YACZ,OAAO;gBACL,sBAAsB,CAAC,QAAQ;oBAC7B,MAAM,WAAW,GAAG,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC;oBAEpE,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,OAAO;oBACT,CAAC;oBAED,MAAM,MAAM,GAA4B,EAAE,CAAC;oBAC3C,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAC;oBAE1C,IAAI,iBAAiB,EAAE,CAAC;wBACtB,MAAM,eAAe,GAAG,iBAAiB,CAAC,eAAe,EAAE,CAAC;wBAC5D,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;4BAC7C,MAAM,CAAC,IAAI,CAAC;gCACV,IAAI,EAAE,UAAU;gCAChB,IAAI,EAAE,CAA2C;gCACjD,KAAK,EAAE;oCACL,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC;oCAChD,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC;iCAC7C;gCACD,cAAc,EAAE;oCACd,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC;oCAChD,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC;iCACrD;6BACF,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC;oBAED,OAAO,MAAM,CAAC;gBAChB,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,25 +0,0 @@
1
- import { type LanguageServiceContext, type SourceScript, type TextDocument, type VirtualCode } from '@volar/language-service';
2
- import { URI } from 'vscode-uri';
3
- import { VirtualGtsCode } from '../volar/gts-virtual-code.js';
4
- type EmbeddedInfo = {
5
- sourceScript: Required<SourceScript<URI>>;
6
- virtualCode: VirtualCode;
7
- root: VirtualGtsCode;
8
- };
9
- /**
10
- * Helper function that accepts a document URI and, if it matches the format
11
- * of Volar's special URI format for representing embedded codes within a virtual code,
12
- * will look up and return the embedded code and its root VirtualGtsCode.
13
- *
14
- * A example Volar embedded document URI would be something like:
15
- *
16
- * volar-embedded-content://gts/file%253A%252F%252F%252FUsers%252Fmachty%252Fcode%252Fglint%252Ftest-packages%252Fts-template-imports-app%252Fsrc%252Fempty-fixture.gts
17
- *
18
- * Note that the hostname/authority part of the URI is the embedded code ID, e.g. `gts`. These correspond
19
- * to the IDs we assign to parsed embedded virtual codes contained within the root virtual code,
20
- * e.g. `ts` corresponds to the TypeScript representation of .gts files where all `<template>` tags
21
- * have been converted to type-checkable TS.
22
- */
23
- export declare function getEmbeddedInfo(context: LanguageServiceContext, document: TextDocument, desiredEmbeddedCodeId?: string | ((id: string) => boolean), desiredDocumentLanguageId?: string | ((id: string) => boolean)): EmbeddedInfo | undefined;
24
- export {};
25
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/plugins/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,KAAK,YAAY,GAAG;IAClB,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1C,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,YAAY,EACtB,qBAAqB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,EAC1D,yBAAyB,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,GAC7D,YAAY,GAAG,SAAS,CAiD1B"}
@@ -1,63 +0,0 @@
1
- // based on https://github.com/vuejs/language-tools/blob/master/packages/language-service/lib/utils.ts
2
- import { URI } from 'vscode-uri';
3
- import { VirtualGtsCode } from '../volar/gts-virtual-code.js';
4
- /**
5
- * Helper function that accepts a document URI and, if it matches the format
6
- * of Volar's special URI format for representing embedded codes within a virtual code,
7
- * will look up and return the embedded code and its root VirtualGtsCode.
8
- *
9
- * A example Volar embedded document URI would be something like:
10
- *
11
- * volar-embedded-content://gts/file%253A%252F%252F%252FUsers%252Fmachty%252Fcode%252Fglint%252Ftest-packages%252Fts-template-imports-app%252Fsrc%252Fempty-fixture.gts
12
- *
13
- * Note that the hostname/authority part of the URI is the embedded code ID, e.g. `gts`. These correspond
14
- * to the IDs we assign to parsed embedded virtual codes contained within the root virtual code,
15
- * e.g. `ts` corresponds to the TypeScript representation of .gts files where all `<template>` tags
16
- * have been converted to type-checkable TS.
17
- */
18
- export function getEmbeddedInfo(context, document, desiredEmbeddedCodeId, desiredDocumentLanguageId) {
19
- const uri = URI.parse(document.uri);
20
- const decoded = context.decodeEmbeddedDocumentUri(uri);
21
- if (!decoded) {
22
- return;
23
- }
24
- const [documentUri, embeddedCodeId] = decoded;
25
- if (desiredEmbeddedCodeId) {
26
- if (typeof desiredEmbeddedCodeId === 'string') {
27
- if (embeddedCodeId !== desiredEmbeddedCodeId) {
28
- return;
29
- }
30
- }
31
- else if (!desiredEmbeddedCodeId(embeddedCodeId)) {
32
- return;
33
- }
34
- }
35
- if (desiredDocumentLanguageId) {
36
- if (typeof desiredDocumentLanguageId === 'string') {
37
- if (document.languageId !== desiredDocumentLanguageId) {
38
- return;
39
- }
40
- }
41
- else if (!desiredDocumentLanguageId(document.languageId)) {
42
- return;
43
- }
44
- }
45
- const sourceScript = context.language.scripts.get(documentUri);
46
- if (!sourceScript?.generated) {
47
- return;
48
- }
49
- const virtualCode = sourceScript.generated.embeddedCodes.get(embeddedCodeId);
50
- if (!virtualCode) {
51
- return;
52
- }
53
- const root = sourceScript.generated.root;
54
- if (!(root instanceof VirtualGtsCode)) {
55
- return;
56
- }
57
- return {
58
- sourceScript: sourceScript,
59
- virtualCode,
60
- root,
61
- };
62
- }
63
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/plugins/utils.ts"],"names":[],"mappings":"AAAA,sGAAsG;AAQtG,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQ9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA+B,EAC/B,QAAsB,EACtB,qBAA0D,EAC1D,yBAA8D;IAE9D,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAED,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC;IAE9C,IAAI,qBAAqB,EAAE,CAAC;QAC1B,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE,CAAC;YAC9C,IAAI,cAAc,KAAK,qBAAqB,EAAE,CAAC;gBAC7C,OAAO;YACT,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAE,CAAC;YAClD,OAAO;QACT,CAAC;IACH,CAAC;IAED,IAAI,yBAAyB,EAAE,CAAC;QAC9B,IAAI,OAAO,yBAAyB,KAAK,QAAQ,EAAE,CAAC;YAClD,IAAI,QAAQ,CAAC,UAAU,KAAK,yBAAyB,EAAE,CAAC;gBACtD,OAAO;YACT,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3D,OAAO;QACT,CAAC;IACH,CAAC;IAED,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC/D,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,YAAY,CAAC,SAAS,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC7E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC;IACzC,IAAI,CAAC,CAAC,IAAI,YAAY,cAAc,CAAC,EAAE,CAAC;QACtC,OAAO;IACT,CAAC;IAED,OAAO;QACL,YAAY,EAAE,YAA2C;QACzD,WAAW;QACX,IAAI;KACL,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import TransformedModule from '../template/transformed-module.js';
2
- import { Diagnostic } from './index.js';
3
- export declare function augmentDiagnostics<T extends Diagnostic>(transformedModule: TransformedModule, diagnostics: T[]): T[];
4
- //# sourceMappingURL=augmentation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"augmentation.d.ts","sourceRoot":"","sources":["../../../src/transform/diagnostics/augmentation.ts"],"names":[],"mappings":"AAEA,OAAO,iBAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,UAAU,EACrD,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,CAAC,EAAE,GACf,CAAC,EAAE,CA8BL"}
@@ -1,223 +0,0 @@
1
- export function augmentDiagnostics(transformedModule, diagnostics) {
2
- const mappingForDiagnostic = (diagnostic) => {
3
- if (!transformedModule) {
4
- return [];
5
- }
6
- if (!diagnostic.start || !diagnostic.length) {
7
- return [];
8
- }
9
- const start = diagnostic.start;
10
- const end = start + diagnostic.length;
11
- return transformedModule.getExactTransformedRanges(transformedModule.originalFileName, start, end);
12
- };
13
- const augmentedDiagnostics = [];
14
- for (const diagnostic of diagnostics) {
15
- const augmentedDiagnostic = rewriteMessageText(diagnostic, mappingForDiagnostic);
16
- augmentedDiagnostics.push(augmentedDiagnostic);
17
- }
18
- // @ts-expect-error not sure how to fix
19
- return augmentedDiagnostics;
20
- }
21
- function rewriteMessageText(diagnostic, mappingGetter) {
22
- const handler = diagnosticHandlers[diagnostic.code?.toString() ?? ''];
23
- if (!handler) {
24
- return diagnostic;
25
- }
26
- for (let mapping of mappingGetter(diagnostic)) {
27
- const augmentedDiagnostic = handler(diagnostic, mapping);
28
- if (augmentedDiagnostic) {
29
- return augmentedDiagnostic;
30
- }
31
- }
32
- return diagnostic;
33
- }
34
- const diagnosticHandlers = {
35
- '2307': checkGlintLibImports, // TS2307: An import cannot be found.
36
- '2322': checkAssignabilityError, // TS2322: Type 'X' is not assignable to type 'Y'.
37
- '2345': checkAssignabilityError, // TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'.
38
- '2554': noteNamedArgsAffectArity, // TS2554: Expected N arguments, but got M.
39
- '2555': noteNamedArgsAffectArity, // TS2555: Expected at least N arguments, but got M.
40
- '2769': checkResolveError, // TS2769: No overload matches this call.
41
- '4111': checkIndexAccessError, // TS4111: Property 'x' comes from an index signature, so it must be accessed with ['x'].
42
- '7053': checkImplicitAnyError, // TS7053: Element implicitly has an 'any' type because expression of type '"X"' can't be used to index type 'Y'.
43
- };
44
- const bindHelpers = ['component', 'helper', 'modifier'];
45
- function checkGlintLibImports(diagnostic, _mapping) {
46
- let messageText = typeof diagnostic.messageText === 'string'
47
- ? diagnostic.messageText
48
- : diagnostic.messageText.messageText;
49
- const typesModules = '@glint/ember-tsc/-private/dsl';
50
- if (messageText.includes(typesModules)) {
51
- return addGlintDetails(diagnostic, 'You appear to be using version 2 of the Glint VS Code extension ' +
52
- '(or a v2 Glint plugin for another IDE), but your package.json still ' +
53
- 'references version 1 Glint dependencies (or they are missing). You need to either upgrade your `@glint/core` ' +
54
- 'and `@glint/template` project dependencies, or downgrade your VS Code Glint extension to version 1.x. ' +
55
- 'Please see the Glint v2 release notes and upgrade guide for more information.');
56
- }
57
- else {
58
- return diagnostic;
59
- }
60
- }
61
- function checkAssignabilityError(diagnostic, mapping) {
62
- let node = mapping.sourceNode;
63
- let parentNode = mapping.parent?.sourceNode;
64
- if (!parentNode)
65
- return;
66
- if (parentNode.type === node.type) {
67
- // For Volar, we added a few more artificial nestings / wrappings around Handlebars
68
- // AST nodes to provide more hookpoints for TS diagnostics to correctly source-map
69
- // back to .gts/.hbs source code. The result of this is that sometimes you have
70
- // things like MustacheNodes being "parents" of MustacheNodes, which we try and
71
- // detect here.
72
- //
73
- // This can go away if/when we refactor the `transformModule` code.
74
- parentNode = mapping.parent?.parent?.sourceNode;
75
- if (!parentNode)
76
- return;
77
- }
78
- if (node.type === 'Identifier' &&
79
- parentNode.type === 'AttrNode' &&
80
- !/^(@|\.)/.test(parentNode.name)) {
81
- // If the assignability issue is on an attribute name and it's not an `@arg`
82
- // or `...attributes`, then it's an HTML attribute type issue.
83
- return addGlintDetails(diagnostic, 'Only primitive values (see `AttrValue` in `@glint/template`) are assignable as HTML attributes. ' +
84
- 'If you want to set an event listener, consider using the `{{on}}` modifier instead.');
85
- }
86
- else if (node.type === 'AttrNode' &&
87
- parentNode.type === 'ElementNode' &&
88
- !/^(@|\.)/.test(node.name)) {
89
- // If the assignability issue is on an attribute name and it's not an `@arg`
90
- // or `...attributes`, then it's an HTML attribute type issue.
91
- return addGlintDetails(diagnostic, 'An Element must be specified in the component signature in order to pass in HTML attributes.');
92
- }
93
- else if (node.type === 'MustacheStatement' &&
94
- (parentNode.type === 'Template' ||
95
- parentNode.type === 'BlockStatement' ||
96
- parentNode.type === 'ElementNode') &&
97
- !(node.path.type === 'PathExpression' && node.path.original === 'yield')) {
98
- // If we're looking at a top-level {{mustache}}, we first double check whether
99
- // it's an attempted inline {{component 'foo'}} invocation...
100
- if (node.path.type === 'PathExpression' && node.path.original === 'component') {
101
- return addGlintDetails(diagnostic, `The {{component}} helper can't be used to directly invoke a component under Glint. ` +
102
- `Consider first binding the result to a variable, e.g. ` +
103
- `'{{#let (component 'component-name') as |ComponentName|}}' and then invoking it as ` +
104
- `'<ComponentName @arg={{value}} />'.`);
105
- }
106
- // Otherwise, it's a DOM content type issue.
107
- return addGlintDetails(diagnostic, 'Only primitive values and certain DOM objects (see `ContentValue` in `@glint/template`) are ' +
108
- 'usable as top-level template content.');
109
- }
110
- else if ((mapping?.sourceNode.type === 'SubExpression' ||
111
- mapping?.sourceNode.type === 'MustacheStatement') &&
112
- mapping.sourceNode.path.type === 'PathExpression' &&
113
- bindHelpers.includes(mapping.sourceNode.path.original)) {
114
- // If we're looking at a binding helper subexpression like `(component ...)`, error messages
115
- // may be very straightforward or may be horrendously complex when users start playing games
116
- // with parametrized types, so we add a hint here.
117
- let kind = mapping.sourceNode.path.original;
118
- return {
119
- ...diagnostic,
120
- messageText: `Unable to pre-bind the given args to the given ${kind}. This likely indicates a type mismatch between its signature and the values you're passing.`,
121
- };
122
- }
123
- }
124
- function noteNamedArgsAffectArity(diagnostic, mapping) {
125
- // In normal template entity invocations, named args (if specified) are effectively
126
- // passed as the final positional argument. Because of this, the reported "expected
127
- // N arguments, but got M" message may appear to be off-by-one to the developer.
128
- // Since this treatment of named args as a final "options hash" argument is user
129
- // visible in cases like type errors, we can't just paper over this by subtracting
130
- // 1 from the numbers in the message. Instead, if the invocation has named args, we
131
- // explicitly note that they're effectively the final positional parameter.
132
- let callNode = findAncestor(mapping, 'MustacheStatement', 'SubExpression');
133
- if (callNode?.path.type === 'PathExpression' && callNode.path.original === 'yield') {
134
- // Yield is directly transformed rather than being treated as a normal mustache
135
- return;
136
- }
137
- let hasNamedArgs = !!callNode?.hash.pairs.length;
138
- if (hasNamedArgs) {
139
- let note = 'Note that named args are passed together as a final argument, so they ' +
140
- 'collectively increase the given arg count by 1.';
141
- return {
142
- ...diagnostic,
143
- messageText: `${diagnostic.messageText} ${note}`,
144
- };
145
- }
146
- }
147
- function checkResolveError(diagnostic, mapping) {
148
- // The diagnostic might fall on a lone identifier or a full path; if the former,
149
- // we need to traverse up through the path to find the true parent.
150
- let sourceMapping = mapping.sourceNode.type === 'Identifier' ? mapping.parent : mapping;
151
- let parentNode = sourceMapping?.parent?.sourceNode;
152
- // If this error is on the first param to a {{component}} or other bind invocation, this means
153
- // we either have a non-component value or a string that's missing from the registry.
154
- if ((parentNode?.type === 'SubExpression' || parentNode?.type === 'MustacheStatement') &&
155
- parentNode.path.type === 'PathExpression' &&
156
- bindHelpers.includes(parentNode.path.original) &&
157
- parentNode.params[0] === sourceMapping?.sourceNode) {
158
- let kind = parentNode.path.original;
159
- if (sourceMapping.sourceNode.type === 'StringLiteral') {
160
- return addGlintDetails(diagnostic, `Unknown ${kind} name '${sourceMapping.sourceNode.value}'. If this isn't a typo, you may be ` +
161
- `missing a registry entry for this name; see the Template Registry page in the Glint ` +
162
- `documentation for more details.`);
163
- }
164
- else {
165
- return addGlintDetails(diagnostic, `The type of this expression doesn't appear to be a valid value to pass the {{${kind}}} ` +
166
- `helper. If possible, you may need to give the expression a narrower type, ` +
167
- `for example \`'thing-a' | 'thing-b'\` rather than \`string\`.`);
168
- }
169
- }
170
- // Otherwise if this is on a top level invocation, we're trying to use a template-unaware
171
- // value in a template-specific way.
172
- let nodeType = sourceMapping?.sourceNode.type;
173
- if (nodeType === 'ElementNode' || nodeType === 'PathExpression' || nodeType === 'Identifier') {
174
- return addGlintDetails(diagnostic, 'The given value does not appear to be usable as a component, modifier or helper.');
175
- }
176
- }
177
- function checkImplicitAnyError(diagnostic, mapping) {
178
- let message = diagnostic.messageText;
179
- // We don't want to bake in assumptions about the exact format of TS error messages,
180
- // but we can assume that the name of the type we're indexing (`Globals`) will appear
181
- // in the text in the case we're interested in.
182
- if (typeof message === 'string' && message.includes('Globals')) {
183
- let { sourceNode } = mapping;
184
- // This error may appear either on `<Foo />` or `{{foo}}`/`(foo)`
185
- let globalName = sourceNode.type === 'ElementNode'
186
- ? sourceNode.path.head.original
187
- : sourceNode.type === 'PathExpression' && sourceNode.head.type === 'VarHead'
188
- ? sourceNode.head.name
189
- : null;
190
- if (globalName) {
191
- return addGlintDetails(diagnostic, `Unknown name '${globalName}'. If this isn't a typo, you may be missing a registry entry ` +
192
- `for this value; see the Template Registry page in the Glint documentation for more details.`);
193
- }
194
- }
195
- }
196
- function checkIndexAccessError(diagnostic, mapping) {
197
- if (mapping.sourceNode.type === 'Identifier' && typeof diagnostic.messageText === 'string') {
198
- let message = diagnostic.messageText;
199
- // "accessed with ['x']" => "accessed with {{get ... 'x'}}"
200
- return {
201
- ...diagnostic,
202
- messageText: message.replace(/\[(['"])(.*)\1\]/, `{{get ... $1$2$1}}`),
203
- };
204
- }
205
- }
206
- function addGlintDetails(diagnostic, details) {
207
- return {
208
- ...diagnostic,
209
- messageText: `${details}\n${diagnostic.messageText}`,
210
- };
211
- }
212
- // Find the nearest mapping node at or above the given one whose `source` AST node
213
- // matches one of the given types.
214
- function findAncestor(mapping, ...types) {
215
- let current = mapping;
216
- do {
217
- if (types.includes(current.sourceNode.type)) {
218
- return current.sourceNode;
219
- }
220
- } while ((current = current.parent));
221
- return null;
222
- }
223
- //# sourceMappingURL=augmentation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"augmentation.js","sourceRoot":"","sources":["../../../src/transform/diagnostics/augmentation.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,kBAAkB,CAChC,iBAAoC,EACpC,WAAgB;IAEhB,MAAM,oBAAoB,GAA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W,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,WAAW,EAAE;KACrD,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,kCAAkC;AAClC,SAAS,YAAY,CACnB,OAA8B,EAC9B,GAAG,KAAe;IAElB,IAAI,OAAO,GAAiC,OAAO,CAAC;IACpD,GAAG,CAAC;QACF,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAS,CAAC,EAAE,CAAC;YACjD,OAAO,OAAO,CAAC,UAAiD,CAAC;QACnE,CAAC;IACH,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE;IACrC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,5 +0,0 @@
1
- import type * as ts from 'typescript';
2
- export type Diagnostic = ts.Diagnostic & {
3
- isContentTagError?: boolean;
4
- };
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transform/diagnostics/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,GAAG;IACvC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transform/diagnostics/index.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export type { Directive, default as TransformedModule } from './template/transformed-module.js';
2
- export type { Diagnostic } from './diagnostics/index.js';
3
- export { rewriteModule } from './template/rewrite-module.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAChG,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,2 +0,0 @@
1
- export { rewriteModule } from './template/rewrite-module.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transform/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
@@ -1,30 +0,0 @@
1
- import { CodeInformation } from '@volar/language-server/node.js';
2
- /**
3
- * Based on https://github.com/machty/vue-language-tools/blob/deff856aa8c15f691544e646519215a15aacbef1/packages/language-core/lib/codegen/codeFeatures.ts
4
- *
5
- * This file exports a "code features" object which provides a useful shorthand/shortcut
6
- * for specifying a nubmer of Volar CodeInformation configuration options in the code
7
- * we use for mapping between source code (e.g. .gts files) and transformed (i.e. type-checkable TS) code.
8
- *
9
- * Volar uses the CodeInformation we pass along with each mapping to determine what sort of language
10
- * features should be activated/processed for a given span of code.
11
- */
12
- declare const raw: {
13
- all: {
14
- verification: true;
15
- completion: true;
16
- semantic: true;
17
- navigation: true;
18
- };
19
- withoutHighlight: {
20
- semantic: {
21
- shouldHighlight: () => false;
22
- };
23
- verification: true;
24
- navigation: true;
25
- completion: true;
26
- };
27
- };
28
- export declare const codeFeatures: { [K in keyof typeof raw]: CodeInformation; };
29
- export {};
30
- //# sourceMappingURL=code-features.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-features.d.ts","sourceRoot":"","sources":["../../../src/transform/template/code-features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE;;;;;;;;;GASG;AACH,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;CAakC,CAAC;AAE5C,eAAO,MAAM,YAAY,EAAU,GAChC,CAAC,IAAI,MAAM,OAAO,GAAG,GAAG,eAAe,GACzC,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Based on https://github.com/machty/vue-language-tools/blob/deff856aa8c15f691544e646519215a15aacbef1/packages/language-core/lib/codegen/codeFeatures.ts
3
- *
4
- * This file exports a "code features" object which provides a useful shorthand/shortcut
5
- * for specifying a nubmer of Volar CodeInformation configuration options in the code
6
- * we use for mapping between source code (e.g. .gts files) and transformed (i.e. type-checkable TS) code.
7
- *
8
- * Volar uses the CodeInformation we pass along with each mapping to determine what sort of language
9
- * features should be activated/processed for a given span of code.
10
- */
11
- const raw = {
12
- all: {
13
- verification: true,
14
- completion: true,
15
- semantic: true,
16
- navigation: true,
17
- },
18
- withoutHighlight: {
19
- semantic: { shouldHighlight: () => false },
20
- verification: true,
21
- navigation: true,
22
- completion: true,
23
- },
24
- };
25
- export const codeFeatures = raw;
26
- //# sourceMappingURL=code-features.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-features.js","sourceRoot":"","sources":["../../../src/transform/template/code-features.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,GAAG,GAAG;IACV,GAAG,EAAE;QACH,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;KACjB;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;QAC1C,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,IAAI;KACjB;CACwC,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG,GAE3B,CAAC"}