Skip to content

Commit

Permalink
Retire unused "comments" description field
Browse files Browse the repository at this point in the history
Summary:
This was replaced by pretty_comments some time ago, which has the same behavior and permits a pre-rendered comment string in markdown.
Remove the field to save a few bytes in each symbol's description.

For compatibility

- `comments` == `location . pretty_comments`

Reviewed By: simonmar

Differential Revision: D59741472

fbshipit-source-id: 88fea0cda50024ff406ec189804fc02d9a67cb10
  • Loading branch information
donsbot authored and facebook-github-bot committed Jul 18, 2024
1 parent ba67e39 commit ba496e1
Show file tree
Hide file tree
Showing 206 changed files with 5 additions and 2,166 deletions.
3 changes: 0 additions & 3 deletions glean/glass/Glean/Glass/Describe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ describeEntity scmRevs ent SymbolResult{..} = do
let symbolDescription_name = symbolResult_qname
symbolDescription_annotations <- eThrow =<< getAnnotationsForEntity repo ent
symbolDescription_pretty_comments <- eThrow =<< getCommentsForEntity repo ent
-- backwards compat until deprecated, we just make a copy
let symbolDescription_comments = map symbolComment_location
symbolDescription_pretty_comments
(symbolDescription_visibility, symbolDescription_modifiers)
<- eThrow =<< getInfoForEntity ent
(symbolDescription_signature, symbolDescription_type_xrefs)
Expand Down
3 changes: 0 additions & 3 deletions glean/glass/Glean/Glass/Handler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ combineDescriptions
combineDescriptions y x =
x { symbolDescription_annotations = symbolDescription_annotations x <>
symbolDescription_annotations y -- <> Maybe [a]
, symbolDescription_comments = uniq $
symbolDescription_comments x <>
symbolDescription_comments y
, symbolDescription_pretty_comments = uniq $
symbolDescription_pretty_comments x <>
symbolDescription_pretty_comments y
Expand Down
1 change: 0 additions & 1 deletion glean/glass/if/glass.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ struct SymbolDescription {
3: QualifiedName name;
4: optional SymbolKind kind;
5: optional list<Annotation> annotations;
6: list<LocationRange> comments; // deprecated, use pretty_comments
7: optional Visibility visibility;
8: Revision repo_hash;
9: Language language;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ testDescribeSymbolComments sym@(SymbolId name) (line, col) get =
assertEqual "describeSymbol Comment start matches"
[(fromIntegral line, fromIntegral col)] $
zip
(range_lineBegin . locationRange_range
<$> symbolDescription_comments)
(range_columnBegin . locationRange_range
<$> symbolDescription_comments)
(range_lineBegin . locationRange_range . symbolComment_location
<$> symbolDescription_pretty_comments)
(range_columnBegin . locationRange_range . symbolComment_location
<$> symbolDescription_pretty_comments)

-- | Test that describeSymbol has specific annotations
testDescribeSymbolHasAnnotations
Expand Down
1 change: 0 additions & 1 deletion glean/glass/test/regression/tests/buck/describeSymbol.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
51 changes: 0 additions & 51 deletions glean/glass/test/regression/tests/cpp/callees_h.out
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"symbolDetails": {
"test/cpp//foo/bar/g/.f//.decl": {
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -151,18 +150,6 @@
},
"test/cpp//foo/f/.f//.decl": {
"annotations": [],
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 18,
"lineEnd": 20
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -223,7 +210,6 @@
"type_xrefs": []
},
"test/cpp//foo/foo/.f/": {
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -275,7 +261,6 @@
},
"test/cpp//foo/foo/.f//.decl": {
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -326,18 +311,6 @@
"type_xrefs": []
},
"test/cpp//h": {
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 56,
"lineEnd": 58
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -401,18 +374,6 @@
"type_xrefs": []
},
"test/cpp//h/.f/int": {
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 56,
"lineEnd": 58
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -477,18 +438,6 @@
},
"test/cpp//h/.f/int/.decl": {
"annotations": [],
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 51,
"lineEnd": 53
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
24 changes: 0 additions & 24 deletions glean/glass/test/regression/tests/cpp/callers_h.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@
],
"symbolDetails": {
"test/cpp//h": {
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 56,
"lineEnd": 58
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down Expand Up @@ -85,18 +73,6 @@
},
"test/cpp//h/.f/int/.decl": {
"annotations": [],
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 56,
"lineEnd": 58
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
1 change: 0 additions & 1 deletion glean/glass/test/regression/tests/cpp/describeSymbol_S.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
1 change: 0 additions & 1 deletion glean/glass/test/regression/tests/cpp/describeSymbol_T.out
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
12 changes: 0 additions & 12 deletions glean/glass/test/regression/tests/cpp/describeSymbol_defn_h.out
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
[
"@generated",
{
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 56,
"lineEnd": 58
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
12 changes: 0 additions & 12 deletions glean/glass/test/regression/tests/cpp/describeSymbol_f.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 1,
"columnEnd": 4,
"lineBegin": 18,
"lineEnd": 20
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [
{
"filepath": "test.cpp",
"range": {
"columnBegin": 5,
"columnEnd": 8,
"lineBegin": 117,
"lineEnd": 119
},
"repository": "test"
}
],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"@generated",
{
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"@generated",
{
"annotations": [],
"comments": [],
"contains_relation": {
"firstChild": "nondeterministic",
"firstParent": "nondeterministic",
Expand Down
Loading

0 comments on commit ba496e1

Please sign in to comment.