-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a 'symbolLocation' thrift method
Summary: The most common reason people are using Glass in ad hoc ways is to find symbol locations (i.e. a mixture of search or our symbol id builders + describe(). describe() is still more than we need for this, and I keep forgetting we have 'resolveSymbolRange()'. So make it clearer by calling it `symbolLocaton` and then I'll go through and fix a ton of the clients to use this much cheaper method. Then expose it to the main clients properly and refactor clients of describe() Reviewed By: simonmar Differential Revision: D59952037 fbshipit-source-id: ef7b4678995056a37d2bebda666418075c2d6381
- Loading branch information
1 parent
3b32a29
commit 3770aaa
Showing
48 changed files
with
76 additions
and
76 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 |
---|---|---|
|
@@ -22,14 +22,16 @@ module Glean.Glass.Handler | |
, findReferenceRanges | ||
|
||
-- * working with symbol ids | ||
, resolveSymbolRange | ||
, symbolLocation | ||
, describeSymbol | ||
|
||
-- * searching by string | ||
, searchSymbol | ||
|
||
-- ** by relationship | ||
, searchRelated | ||
|
||
-- ** a large report of all information we know about a symbol | ||
, searchRelatedNeighborhood | ||
|
||
) where | ||
|
@@ -214,13 +216,13 @@ findReferenceRanges [email protected]{..} sym opts@RequestOptions{..} = | |
|
||
|
||
-- | Resolve a symbol identifier to its range-based location in the latest db | ||
resolveSymbolRange | ||
symbolLocation | ||
:: Glass.Env | ||
-> SymbolId | ||
-> RequestOptions | ||
-> IO LocationRange | ||
resolveSymbolRange env@Glass.Env{..} sym opts = do | ||
withSymbol "resolveSymbolRange" env opts sym | ||
symbolLocation env@Glass.Env{..} sym opts = do | ||
withSymbol "symbolLocation" env opts sym | ||
$ \gleanDBs _dbInfo (repo, lang, toks) -> | ||
findSymbolLocationRange env GleanBackend{..} repo lang toks | ||
|
||
|
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
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/buck/resolveSymbolRange_target.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/buck/t/buck_project/PATH/./foo" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/buck/d/buck_project/my_defs.bzl/some_library" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/buck/resolveSymbol_file.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/buck/f/buck_project/toto.c" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/buck/resolveSymbol_target.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/buck/t/buck_project/PATH/./foo" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//h" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//h" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/Nothing" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing_ctor.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/Nothing/.c/maybe::Nothing::_secret" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing_ctor_decl.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/Nothing/.ctor//.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing_nothing_decl.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/nothing/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing_secret.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/Nothing/_secret" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_Nothing_secret_decl.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//maybe/Nothing/_secret/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_S.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/S/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_T.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/bar/T/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_bar.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/bar/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_f.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/f/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_foo_foo.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/foo" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_local_i.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//h/i/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbolRange_local_ns.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/fooFn/fooI/.decl" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/S/.decl" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/bar/T/.decl" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/bar/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_enum_class_global.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//GlobalClass" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_enum_global.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//Global" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/f/.decl" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/.decl" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_foo_foo.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//foo/foo" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_namespace_baz.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//baz" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_namespace_struct.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//baz/U" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_namespace_struct_enum.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//baz/U/InU" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_namespace_struct_enum_field.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//baz/U/InU/UA" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/cpp/resolveSymbol_namespace_struct_enumclass_field.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/cpp//baz/U/InUClass/UCA" |
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 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/js/imports/C" | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/flow/resolveSymbolRange.query
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 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/js/imports/C" | ||
|
||
|
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/php/Position" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/hack/resolveSymbolRange.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/php/Position" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/java-lsif/resolveSymbolRange.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/java/lsif/com/glean/app/App%23getMessage%28%29" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/py/all.py/all" |
2 changes: 1 addition & 1 deletion
2
glean/glass/test/regression/tests/python/resolveSymbolRange.query
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/py/all.py/all" |
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,2 +1,2 @@ | ||
action: resolveSymbolRange | ||
action: symbolLocation | ||
args: "test/thrift/lib.thrift/Attribute/aBool" |
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