-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: recursively parse import files and goto definition of well know…
…n types (#56) When a file is opened, all imports are parsed recursively up to a depth of 8. When a file is being edited it and its imports are parsed with a depth of 2.
- Loading branch information
Showing
18 changed files
with
150 additions
and
61 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syntax = "proto3"; | ||
|
||
package com.super.secret; | ||
|
||
// SomeSecret is a real secret with hidden string | ||
message SomeSecret { | ||
string secret = 1; | ||
} |
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,12 @@ | ||
syntax = "proto3"; | ||
|
||
package com.inner; | ||
|
||
import "inner/secret/y.proto"; | ||
|
||
// Why is a reason with secret | ||
message Why { | ||
string reason = 1; | ||
com.super.secret.SomeSecret secret = 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
4 changes: 2 additions & 2 deletions
4
src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-7.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
source: src/workspace/hover.rs | ||
expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::ImportPath(\"c.proto\".to_string()))" | ||
expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::Identifier(\"com.inner.Why\".to_string()))" | ||
snapshot_kind: text | ||
--- | ||
kind: markdown | ||
value: "Import: `c.proto` protobuf file,\n---\nIncluded from src/workspace/input/c.proto" | ||
value: "`Why` message or enum type, package: `com.inner`\n---\nWhy is a reason with secret" |
7 changes: 7 additions & 0 deletions
7
src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-8.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,7 @@ | ||
--- | ||
source: src/workspace/hover.rs | ||
expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::Identifier(\"com.super.secret.SomeSecret\".to_string()))" | ||
snapshot_kind: text | ||
--- | ||
kind: markdown | ||
value: "`SomeSecret` message or enum type, package: `com.super.secret`\n---\nSomeSecret is a real secret with hidden string" |
7 changes: 7 additions & 0 deletions
7
src/workspace/snapshots/protols__workspace__hover__test__workspace_test_hover-9.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,7 @@ | ||
--- | ||
source: src/workspace/hover.rs | ||
expression: "state.hover(&ipath, \"com.workspace\",\nHoverables::Identifier(\"com.super.secret.SomeSecret\".to_string()))" | ||
snapshot_kind: text | ||
--- | ||
kind: markdown | ||
value: "`SomeSecret` message or enum type, package: `com.super.secret`\n---\nSomeSecret is a real secret with hidden string" |
5 changes: 3 additions & 2 deletions
5
src/workspace/snapshots/protols__workspace__rename__test__reference-2.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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
--- | ||
source: src/workspace/rename.rs | ||
expression: "state.reference_fields(\"com.workspace\", \"Author.Address\")" | ||
snapshot_kind: text | ||
--- | ||
- uri: "file://input/a.proto" | ||
range: | ||
start: | ||
line: 9 | ||
line: 10 | ||
character: 3 | ||
end: | ||
line: 9 | ||
line: 10 | ||
character: 17 |
5 changes: 3 additions & 2 deletions
5
src/workspace/snapshots/protols__workspace__rename__test__reference-3.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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
--- | ||
source: src/workspace/rename.rs | ||
expression: "state.reference_fields(\"com.utility\", \"Foobar.Baz\")" | ||
snapshot_kind: text | ||
--- | ||
- uri: "file://input/a.proto" | ||
range: | ||
start: | ||
line: 10 | ||
line: 11 | ||
character: 3 | ||
end: | ||
line: 10 | ||
line: 11 | ||
character: 25 |
5 changes: 3 additions & 2 deletions
5
src/workspace/snapshots/protols__workspace__rename__test__reference.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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
--- | ||
source: src/workspace/rename.rs | ||
expression: "state.reference_fields(\"com.workspace\", \"Author\")" | ||
snapshot_kind: text | ||
--- | ||
- uri: "file://input/a.proto" | ||
range: | ||
start: | ||
line: 8 | ||
line: 9 | ||
character: 3 | ||
end: | ||
line: 8 | ||
line: 9 | ||
character: 9 |
5 changes: 3 additions & 2 deletions
5
src/workspace/snapshots/protols__workspace__rename__test__rename-2.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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
--- | ||
source: src/workspace/rename.rs | ||
expression: "state.rename_fields(\"com.workspace\", \"Author.Address\", \"Author.Location\")" | ||
snapshot_kind: text | ||
--- | ||
"file://input/a.proto": | ||
- range: | ||
start: | ||
line: 9 | ||
line: 10 | ||
character: 3 | ||
end: | ||
line: 9 | ||
line: 10 | ||
character: 17 | ||
newText: Author.Location |
Oops, something went wrong.