Skip to content

Commit

Permalink
TS Plugin: basic diagnostics and functionality for .gts files (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
machty authored Jul 16, 2024
1 parent b6f19ff commit 01b8deb
Show file tree
Hide file tree
Showing 26 changed files with 409 additions and 380 deletions.
2 changes: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
"lifeart.vscode-glimmer-syntax",
"--disable-extension",
"unifiedjs.vscode-mdx",
"--disable-extension",
"Vue.volar",
"${workspaceFolder}/test-packages/ts-plugin-test-app"
]
},
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ Glint transforms template code into TypeScript code so that it can be type-check
```ts
static {
({} as typeof import("@glint/environment-ember-loose/-private/dsl")
.templateForBackingValue(this, function(𝚪, χ: typeof import("@glint/environment-ember-loose/-private/dsl")) {
.templateForBackingValue(this, function(__glintRef__, __glintDSL__: typeof import("@glint/environment-ember-loose/-private/dsl")) {
{
const 𝛄 = χ.emitComponent(χ.resolve(χ.Globals["FooComponent"])
({ desc: "notchHeight _ footer", ...χ.NamedArgsMarker }));
𝛄;
const __glintY__ = __glintDSL__.emitComponent(__glintDSL__.resolve(__glintDSL__.Globals["FooComponent"])
({ desc: "notchHeight _ footer", ...__glintDSL__.NamedArgsMarker }));
__glintY__;
{
const [] = 𝛄.blockParams["default"];
const [] = __glintY__.blockParams["default"];
{
// ...
```
Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/transform/offset-mapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe.skip('Transform: Source-to-source offset mapping', () => {
}

function findOccurrence(haystack: string, needle: string, occurrence: number): number {
let offset = haystack.indexOf('function(𝚪');
let offset = haystack.indexOf('function(__glintRef__');
for (let i = 0; i < occurrence + 1; i++) {
offset = haystack.indexOf(needle, offset + 1);

Expand Down
188 changes: 94 additions & 94 deletions packages/core/__tests__/transform/rewrite.test.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 01b8deb

Please sign in to comment.