-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from marko-js/async-script-tag
- Loading branch information
Showing
8 changed files
with
229 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@marko/language-server": patch | ||
"@marko/language-tools": patch | ||
"@marko/type-check": patch | ||
"marko-vscode": patch | ||
--- | ||
|
||
Allow await inside script tags. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 39 additions & 28 deletions
67
...ver/src/__tests__/fixtures/script/script/__snapshots__/script.expected/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,57 @@ | ||
## Hovers | ||
### Ln 9, Col 17 | ||
### Ln 10, Col 17 | ||
```marko | ||
7 | <const/y="hi"/> | ||
8 | <script> | ||
> 9 | console.log(x); | ||
8 | <const/promise=Promise.resolve("world")/> | ||
9 | <script> | ||
> 10 | console.log(x); | ||
| ^ const x: number | ||
10 | // ^? | ||
11 | console.log(y); | ||
12 | // ^? | ||
11 | // ^? | ||
12 | console.log(y); | ||
13 | // ^? | ||
``` | ||
|
||
### Ln 11, Col 17 | ||
### Ln 12, Col 17 | ||
```marko | ||
9 | console.log(x); | ||
10 | // ^? | ||
> 11 | console.log(y); | ||
10 | console.log(x); | ||
11 | // ^? | ||
> 12 | console.log(y); | ||
| ^ const y: string | ||
12 | // ^? | ||
13 | console.log(input.name); | ||
14 | // ^? | ||
13 | // ^? | ||
14 | console.log(input.name); | ||
15 | // ^? | ||
``` | ||
|
||
### Ln 13, Col 23 | ||
### Ln 14, Col 23 | ||
```marko | ||
11 | console.log(y); | ||
12 | // ^? | ||
> 13 | console.log(input.name); | ||
12 | console.log(y); | ||
13 | // ^? | ||
> 14 | console.log(input.name); | ||
| ^ (property) Input<T>.name: T extends string | ||
14 | // ^? | ||
15 | x = 2; | ||
16 | y = "bye"; | ||
15 | // ^? | ||
16 | | ||
17 | const resolved = await promise; | ||
``` | ||
|
||
### Ln 18, Col 17 | ||
```marko | ||
16 | | ||
17 | const resolved = await promise; | ||
> 18 | console.log(resolved); | ||
| ^ const resolved: string | ||
19 | // ^? | ||
20 | x = 2; | ||
21 | y = "bye"; | ||
``` | ||
|
||
## Diagnostics | ||
### Ln 16, Col 5 | ||
### Ln 21, Col 5 | ||
```marko | ||
14 | // ^? | ||
15 | x = 2; | ||
> 16 | y = "bye"; | ||
19 | // ^? | ||
20 | x = 2; | ||
> 21 | y = "bye"; | ||
| ^ Cannot assign to 'y' because it is a read-only property. | ||
17 | </script> | ||
18 | </div> | ||
19 | | ||
22 | </script> | ||
23 | </div> | ||
24 | | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters