-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nest schema expr type check (#1475)
* fix: fix nest schema expr type check Signed-off-by: he1pa <[email protected]> * fix: fix schema index signature check and schema symbol init in advanced_resolver Signed-off-by: he1pa <[email protected]> --------- Signed-off-by: he1pa <[email protected]>
- Loading branch information
Showing
12 changed files
with
165 additions
and
12 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
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
5 changes: 5 additions & 0 deletions
5
...LSP/src/snapshots/kcl_language_server__goto_def__tests__goto_base_schema_attr_1_test.snap
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,5 @@ | ||
--- | ||
source: tools/src/LSP/src/goto_def.rs | ||
expression: "format!(\"{:?}\", { fmt_resp(& res) })" | ||
--- | ||
"path: \"src/test_data/goto_def_test/goto_base_schema_attr_1_test/types/host.k\", range: Range { start: Position { line: 1, character: 4 }, end: Position { line: 1, character: 8 } }" |
5 changes: 5 additions & 0 deletions
5
...c/LSP/src/snapshots/kcl_language_server__goto_def__tests__goto_base_schema_attr_test.snap
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,5 @@ | ||
--- | ||
source: tools/src/LSP/src/goto_def.rs | ||
expression: "format!(\"{:?}\", { fmt_resp(& res) })" | ||
--- | ||
"path: \"src/test_data/goto_def_test/goto_base_schema_attr_test/goto_base_schema_attr_test.k\", range: Range { start: Position { line: 1, character: 4 }, end: Position { line: 1, character: 8 } }" |
5 changes: 5 additions & 0 deletions
5
...LSP/src/snapshots/kcl_language_server__goto_def__tests__goto_nested_schema_attr_test.snap
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,5 @@ | ||
--- | ||
source: tools/src/LSP/src/goto_def.rs | ||
expression: "format!(\"{:?}\", { fmt_resp(& res) })" | ||
--- | ||
"path: \"src/test_data/goto_def_test/goto_nested_schema_attr_test/goto_nested_schema_attr_test.k\", range: Range { start: Position { line: 14, character: 4 }, end: Position { line: 14, character: 8 } }" |
6 changes: 6 additions & 0 deletions
6
...P/src/test_data/goto_def_test/goto_base_schema_attr_1_test/goto_base_schema_attr_1_test.k
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,6 @@ | ||
import types | ||
|
||
hosts: {str: types.HostPort} = { | ||
foo: { host: "foo.example.net", port: 80} | ||
} | ||
|
Empty file.
5 changes: 5 additions & 0 deletions
5
kclvm/tools/src/LSP/src/test_data/goto_def_test/goto_base_schema_attr_1_test/types/host.k
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,5 @@ | ||
schema Host: | ||
host: str | ||
|
||
schema HostPort(Host): | ||
port: int |
9 changes: 9 additions & 0 deletions
9
...c/LSP/src/test_data/goto_def_test/goto_base_schema_attr_test/goto_base_schema_attr_test.k
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,9 @@ | ||
schema Host: | ||
host: str | ||
|
||
schema HostPort(Host): | ||
port: int | ||
|
||
hosts: {str:HostPort} = { | ||
foo: {host: "foo.example.net", port: 80} | ||
} |
27 changes: 27 additions & 0 deletions
27
...P/src/test_data/goto_def_test/goto_nested_schema_attr_test/goto_nested_schema_attr_test.k
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,27 @@ | ||
schema Foo: | ||
data: Data | ||
|
||
|
||
schema Data: | ||
spec: Spec | ||
|
||
schema Spec: | ||
config: Config | ||
|
||
schema Config: | ||
template: Template | ||
|
||
schema Template: | ||
name: str | ||
|
||
foo = Foo { | ||
data: { | ||
spec: { | ||
config: { | ||
template: { | ||
name: "template" | ||
} | ||
} | ||
} | ||
} | ||
} |