-
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.
- Loading branch information
1 parent
39ef7d1
commit abbb30a
Showing
10 changed files
with
63 additions
and
67 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 | ||
--- | ||
|
||
Align tag arguments type generation with Marko 6. |
19 changes: 14 additions & 5 deletions
19
...fixtures/script/custom-tag-args/__snapshots__/custom-tag-args.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,11 +1,20 @@ | ||
## Diagnostics | ||
### Ln 3, Col 10 | ||
### Ln 2, Col 11 | ||
```marko | ||
1 | <test-tag("hello!")/> | ||
2 | <test-tag("hello!", 1)/> | ||
1 | <test-tag({ value: "hello!" })/> | ||
> 2 | <test-tag("hello!")/> | ||
| ^^^^^^^^ Argument of type 'string' is not assignable to parameter of type 'Directives & Input'. | ||
Type 'string' is not assignable to type 'Input'. | ||
3 | <test-tag("hello!", 1, 2)/> | ||
4 | | ||
``` | ||
|
||
### Ln 3, Col 21 | ||
```marko | ||
1 | <test-tag({ value: "hello!" })/> | ||
2 | <test-tag("hello!")/> | ||
> 3 | <test-tag("hello!", 1, 2)/> | ||
| ^^^^^^^^^^^^^^^^ Type of computed property's value is '[string, number, number]', which is not assignable to type '[string, (number | undefined)?]'. | ||
Source has 3 element(s) but target allows only 2. | ||
| ^^^^ Expected 1 arguments, but got 3. | ||
4 | | ||
``` | ||
|
2 changes: 1 addition & 1 deletion
2
...s/language-server/src/__tests__/fixtures/script/custom-tag-args/components/test-tag.marko
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,4 +1,4 @@ | ||
export interface Input { | ||
value: [string, number?] | ||
value: string | ||
} | ||
<div/> |
2 changes: 1 addition & 1 deletion
2
packages/language-server/src/__tests__/fixtures/script/custom-tag-args/index.marko
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,3 +1,3 @@ | ||
<test-tag({ value: "hello!" })/> | ||
<test-tag("hello!")/> | ||
<test-tag("hello!", 1)/> | ||
<test-tag("hello!", 1, 2)/> |
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
19 changes: 9 additions & 10 deletions
19
...tag-params-basic/__snapshots__/tag-params-basic.expected/components/test-tag.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,22 +1,21 @@ | ||
## Diagnostics | ||
### Ln 7, Col 28 | ||
### Ln 7, Col 27 | ||
```marko | ||
5 | <${input.renderBody}=["a", "b"] /> | ||
5 | <${input.renderBody}("a", "b") /> | ||
6 | | ||
> 7 | <${input.renderBody}=["a", "c"] /> | ||
| ^^^ Type '"c"' is not assignable to type '"b"'. | ||
> 7 | <${input.renderBody}("a", "c") /> | ||
| ^^^ Argument of type '"c"' is not assignable to parameter of type '"b"'. | ||
8 | | ||
9 | <${input.renderBody}=["a", "b", "c"] /> | ||
9 | <${input.renderBody}("a", "b", "c") /> | ||
10 | | ||
``` | ||
|
||
### Ln 9, Col 21 | ||
### Ln 9, Col 32 | ||
```marko | ||
7 | <${input.renderBody}=["a", "c"] /> | ||
7 | <${input.renderBody}("a", "c") /> | ||
8 | | ||
> 9 | <${input.renderBody}=["a", "b", "c"] /> | ||
| ^ Type '["a", "b", string]' is not assignable to type '["a", "b"]'. | ||
Source has 3 element(s) but target allows only 2. | ||
> 9 | <${input.renderBody}("a", "b", "c") /> | ||
| ^^^ Expected 2 arguments, but got 3. | ||
10 | | ||
``` | ||
|
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