Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Cloogle
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cloogle
Cloogle
Commits
adf2ad02
Verified
Commit
adf2ad02
authored
Dec 15, 2018
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle exactName queries
parent
956cbd5d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
Cloogle/Search.icl
Cloogle/Search.icl
+10
-7
libcloogle
libcloogle
+1
-1
No files found.
Cloogle/Search.icl
View file @
adf2ad02
...
...
@@ -37,9 +37,10 @@ import Cloogle.Search.Rank
::
SearchStrategy
=
SSIdentity
|
SSName
String
|
SSExactName
String
|
SSTypes
|
SSClasses
|
SSUnify
Type
|
SSTypeName
String
|
SSClassName
String
|
SSUsing
(*
CloogleDB
->
*
CloogleDB
)
[
String
]
|
SSAnd
SearchStrategy
SearchStrategy
...
...
@@ -50,9 +51,10 @@ addStrategy (Just s) strat = SSAnd strat s
searchStrategy
::
!
SearchStrategy
!*
CloogleDB
->
*
CloogleDB
searchStrategy
SSIdentity
db
=
db
searchStrategy
(
SSName
n
)
db
=
filterName
n
db
searchStrategy
(
SSExactName
n
)
db
=
filterExactName
n
db
searchStrategy
SSTypes
db
=
filterDB
(\
ce
->
ce
=:(
TypeDefEntry
_))
db
searchStrategy
SSClasses
db
=
filterDB
(\
ce
->
ce
=:(
ClassEntry
_))
db
searchStrategy
(
SSUnify
t
)
db
=
filterUnifying
t
db
searchStrategy
(
SSTypeName
n
)
db
=
filterDB
(\
ce
->
ce
=:(
TypeDefEntry
_))
$
filterExactName
n
db
searchStrategy
(
SSClassName
n
)
db
=
filterDB
(\
ce
->
ce
=:(
ClassEntry
_))
$
filterExactName
n
db
searchStrategy
(
SSUsing
f
ns
)
db
=
filterUsages
f
ns
db
searchStrategy
(
SSAnd
a
b
)
db
=
searchStrategy
b
$
searchStrategy
a
db
...
...
@@ -69,7 +71,7 @@ search` :: !Request !*CloogleDB ->
,
![!(!
CloogleEntry
,
![
Annotation
])!]
,
!*
CloogleDB
)
search`
{
unify
,
name
,
className
,
typeName
,
using
,
modules
,
libraries
,
page
,
include_builtins
,
include_core
,
include_apps
}
cdb
search`
{
unify
,
name
,
exactName
,
className
,
typeName
,
using
,
modules
,
libraries
,
page
,
include_builtins
,
include_core
,
include_apps
}
cdb
#
include_builtins
=
fromMaybe
DEFAULT_INCLUDE_BUILTINS
include_builtins
#
include_core
=
fromMaybe
DEFAULT_INCLUDE_CORE
include_core
#
include_apps
=
fromMaybe
DEFAULT_INCLUDE_APPS
include_apps
...
...
@@ -85,8 +87,9 @@ search` {unify,name,className,typeName,using,modules,libraries,page,include_buil
#
strat
=
SSIdentity
// Name search
#
strat
=
addStrategy
(
SSName
<$>
name
)
strat
#
strat
=
addStrategy
(
SSTypeName
<$>
typeName
)
strat
#
strat
=
addStrategy
(
SSClassName
<$>
className
)
strat
#
strat
=
addStrategy
(
SSExactName
<$>
exactName
)
strat
#
strat
=
addStrategy
(
flip
SSAnd
SSTypes
<$>
SSExactName
<$>
typeName
)
strat
#
strat
=
addStrategy
(
flip
SSAnd
SSClasses
<$>
SSExactName
<$>
className
)
strat
// Unification search
#
(
allsyns
,
cdb
)
=
allTypeSynonyms
cdb
#
(
alwaysUnique
,
cdb
)
=
alwaysUniquePredicate
cdb
...
...
libcloogle
@
5b9c4f06
Compare
9b3230c2
...
5b9c4f06
Subproject commit
9b3230c26b83eb59d2d6e26930803b5aa198e79b
Subproject commit
5b9c4f06ec9b4d37cf61622b55282bb2b8e81549
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment