Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge code for readable printing of symbols in tests and in client
Summary: We print them in hh_single_type_check and clientGetDefinition in different ways for no particular reason. Making: - ClientGetDefinition.print_readable the canonical method to print SymbolOccurence - FileOutline.print_def a canonical method to print SymbolDefinition - FileOutline.print a canonical method to print a collection of SymbolDefinitions The tests are updated, and the things printed by the client are not intended to be machine readable (as opposed to the --json version), so the change should be safe. Differential Revision: D4408138 fbshipit-source-id: e11089624559fb141199467430d5fea9a93a0f8b
- Loading branch information
Showing
55 changed files
with
523 additions
and
373 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
\C::FOO | ||
ClassConst | ||
line 4, characters 25-27 | ||
defined: line 4, characters 25-27 | ||
definition span: line 4, character 25 - line 4, character 27 | ||
name: \C::FOO, kind: class_const, span: line 4, characters 25-27, definition: | ||
FOO | ||
kind: const | ||
id: class_const::C::FOO | ||
position: line 4, characters 25-27 | ||
span: line 4, character 25 - line 4, character 27 | ||
modifiers: abstract | ||
|
||
|
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,5 +1,9 @@ | ||
\Foo | ||
Class | ||
line 8, characters 12-14 | ||
defined: line 3, characters 7-9 | ||
definition span: line 3, character 1 - line 3, character 30 | ||
name: \Foo, kind: class, span: line 8, characters 12-14, definition: | ||
Foo | ||
kind: class | ||
id: type_id::Foo | ||
position: line 3, characters 7-9 | ||
span: line 3, character 1 - line 3, character 30 | ||
modifiers: | ||
|
||
|
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,5 +1,9 @@ | ||
\Foo | ||
Class | ||
line 5, characters 15-17 | ||
defined: line 3, characters 7-9 | ||
definition span: line 3, character 1 - line 3, character 12 | ||
name: \Foo, kind: class, span: line 5, characters 15-17, definition: | ||
Foo | ||
kind: class | ||
id: type_id::Foo | ||
position: line 3, characters 7-9 | ||
span: line 3, character 1 - line 3, character 12 | ||
modifiers: | ||
|
||
|
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,5 +1,9 @@ | ||
\C::FOO | ||
ClassConst | ||
line 8, characters 6-8 | ||
defined: line 4, characters 9-11 | ||
definition span: line 4, character 9 - line 4, character 19 | ||
name: \C::FOO, kind: class_const, span: line 8, characters 6-8, definition: | ||
FOO | ||
kind: const | ||
id: class_const::C::FOO | ||
position: line 4, characters 9-11 | ||
span: line 4, character 9 - line 4, character 19 | ||
modifiers: | ||
|
||
|
29 changes: 19 additions & 10 deletions
29
hphp/hack/test/identify_symbol/constructor_inheritance.php.exp
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,10 +1,19 @@ | ||
\Foo | ||
Class | ||
line 10, characters 7-9 | ||
defined: line 7, characters 7-9 | ||
definition span: line 7, character 1 - line 7, character 22 | ||
\Foo::__construct | ||
Method | ||
line 10, characters 3-11 | ||
defined: line 4, characters 19-29 | ||
definition span: line 4, character 3 - line 4, character 34 | ||
name: \Foo, kind: class, span: line 10, characters 7-9, definition: | ||
Foo | ||
kind: class | ||
id: type_id::Foo | ||
position: line 7, characters 7-9 | ||
span: line 7, character 1 - line 7, character 22 | ||
modifiers: | ||
|
||
|
||
name: \Foo::__construct, kind: method, span: line 10, characters 3-11, definition: | ||
__construct | ||
kind: method | ||
id: method::C::__construct | ||
position: line 4, characters 19-29 | ||
span: line 4, character 3 - line 4, character 34 | ||
modifiers: public | ||
params: | ||
|
||
|
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,5 +1,9 @@ | ||
\C::FOO | ||
ClassConst | ||
line 4, characters 9-11 | ||
defined: line 4, characters 9-11 | ||
definition span: line 4, character 9 - line 4, character 19 | ||
name: \C::FOO, kind: class_const, span: line 4, characters 9-11, definition: | ||
FOO | ||
kind: const | ||
id: class_const::C::FOO | ||
position: line 4, characters 9-11 | ||
span: line 4, character 9 - line 4, character 19 | ||
modifiers: | ||
|
||
|
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,5 +1,10 @@ | ||
\C::foo | ||
Method | ||
line 4, characters 19-21 | ||
defined: line 4, characters 19-21 | ||
definition span: line 4, character 3 - line 4, character 26 | ||
name: \C::foo, kind: method, span: line 4, characters 19-21, definition: | ||
foo | ||
kind: method | ||
id: method::C::foo | ||
position: line 4, characters 19-21 | ||
span: line 4, character 3 - line 4, character 26 | ||
modifiers: public | ||
params: | ||
|
||
|
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,5 +1,9 @@ | ||
\C::foo | ||
Property | ||
line 4, characters 15-18 | ||
defined: line 4, characters 15-18 | ||
definition span: line 4, character 15 - line 4, character 18 | ||
name: \C::foo, kind: property, span: line 4, characters 15-18, definition: | ||
foo | ||
kind: property | ||
id: property::C::foo | ||
position: line 4, characters 15-18 | ||
span: line 4, character 15 - line 4, character 18 | ||
modifiers: public | ||
|
||
|
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,5 +1,9 @@ | ||
\C::FOO | ||
Typeconst | ||
line 4, characters 14-16 | ||
defined: line 4, characters 14-16 | ||
definition span: line 4, character 3 - line 4, character 25 | ||
name: \C::FOO, kind: typeconst, span: line 4, characters 14-16, definition: | ||
FOO | ||
kind: typeconst | ||
id: class_const::C::FOO | ||
position: line 4, characters 14-16 | ||
span: line 4, character 3 - line 4, character 25 | ||
modifiers: | ||
|
||
|
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,5 +1,9 @@ | ||
\E::FOO | ||
ClassConst | ||
line 8, characters 6-8 | ||
defined: line 4, characters 3-5 | ||
definition span: line 4, character 3 - line 4, character 9 | ||
name: \E::FOO, kind: class_const, span: line 8, characters 6-8, definition: | ||
FOO | ||
kind: const | ||
id: class_const::E::FOO | ||
position: line 4, characters 3-5 | ||
span: line 4, character 3 - line 4, character 9 | ||
modifiers: | ||
|
||
|
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,5 +1,10 @@ | ||
\foo | ||
Function | ||
line 6, characters 3-5 | ||
defined: line 3, characters 10-12 | ||
definition span: line 3, character 1 - line 3, character 17 | ||
name: \foo, kind: function, span: line 6, characters 3-5, definition: | ||
foo | ||
kind: function | ||
id: function::foo | ||
position: line 3, characters 10-12 | ||
span: line 3, character 1 - line 3, character 17 | ||
modifiers: | ||
params: | ||
|
||
|
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,5 +1,8 @@ | ||
$string | ||
LocalVar | ||
line 9, characters 9-15 | ||
defined: line 8, characters 3-9 | ||
definition span: line 8, character 3 - line 8, character 9 | ||
name: $string, kind: local, span: line 9, characters 9-15, definition: | ||
$string | ||
kind: local | ||
position: line 8, characters 3-9 | ||
span: line 8, character 3 - line 8, character 9 | ||
modifiers: | ||
|
||
|
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,5 +1,9 @@ | ||
\FOO | ||
GlobalConst | ||
line 6, characters 3-5 | ||
defined: line 3, characters 7-9 | ||
definition span: line 3, character 7 - line 3, character 20 | ||
name: \FOO, kind: global_const, span: line 6, characters 3-5, definition: | ||
FOO | ||
kind: const | ||
id: class_const::FOO | ||
position: line 3, characters 7-9 | ||
span: line 3, character 7 - line 3, character 20 | ||
modifiers: | ||
|
||
|
Oops, something went wrong.