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
Compare Revisions
38469bb77d54d2271c315673fe83afe084e0e7dd...ca925919495ed082fe9b9aad59b744ee8057532c
Source
ca925919495ed082fe9b9aad59b744ee8057532c
Select Git revision
...
Target
38469bb77d54d2271c315673fe83afe084e0e7dd
Select Git revision
Compare
Commits (2)
Fix usages of types used in type synonyms
· 5aea4e31
Camil Staps
authored
Dec 16, 2018
5aea4e31
Be a bit less restrictive on small queries (e.g. "len" should still match "length")
· ca925919
Camil Staps
authored
Dec 16, 2018
ca925919
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
Cloogle/DB.dcl
Cloogle/DB.dcl
+0
-1
Cloogle/DB.icl
Cloogle/DB.icl
+1
-4
Cloogle/DB/Factory.icl
Cloogle/DB/Factory.icl
+13
-2
No files found.
Cloogle/DB.dcl
View file @
ca925919
...
...
@@ -237,7 +237,6 @@ isBuiltin :: !Location -> Bool
toTypeDefEntry
::
!
Location
!
TypeDef
!(
Maybe
TypeDoc
)
->
TypeDefEntry
getTypeDef
::
!
TypeDefEntry
->
TypeDef
getTypeDefRhs
::
!
TypeDefEntry
->
TypeDefRhs
getTypeDefDoc
::
!
TypeDefEntry
->
Maybe
TypeDoc
mergeTypeDefEntries
::
!
TypeDefEntry
!
TypeDefEntry
->
TypeDefEntry
...
...
Cloogle/DB.icl
View file @
ca925919
...
...
@@ -196,9 +196,6 @@ toTypeDefEntry loc td doc =
getTypeDef
::
!
TypeDefEntry
->
TypeDef
getTypeDef
{
tde_typedef
}
=
tde_typedef
getTypeDefRhs
::
!
TypeDefEntry
->
TypeDefRhs
getTypeDefRhs
{
tde_typedef
}
=
tde_typedef
.
td_rhs
getTypeDefDoc
::
!
TypeDefEntry
->
Maybe
TypeDoc
getTypeDefDoc
{
tde_doc
}
=
tde_doc
...
...
@@ -415,7 +412,7 @@ where
#!
rn
=
toReal
n
#!
query_ratio
=
rn
/
qsize
#!
result_ratio
=
rn
/
toReal
(
size
name
)
|
result_ratio
<
0.2
&&
(
size
query
<
=
NGRAMS_N
||
query_ratio
<
0.8
)
|
result_ratio
<
0.2
&&
(
size
query
<
NGRAMS_N
||
query_ratio
<
0.6
)
/* Prevent large amount of results for small queries to speed up ranking */
=
(
Nothing
,
db
)
#!
annots
=
...
...
Cloogle/DB/Factory.icl
View file @
ca925919
...
...
@@ -178,7 +178,7 @@ finaliseDB extra tdb =
,
syntax
=
idxarr
\
e
->
e
=:(
SyntaxEntry
_)
,
abc_instrs
=
idxarr
\
e
->
e
=:(
ABCInstructionEntry
_)
,
type_synonyms
=
idxarr
\
e
->
case
e
of
TypeDefEntry
tde
->
('
Cl
oogle
.
DB
'.
getTypeDefRhs
tde
)=:('
Clean
.
Types
'.
TDRSynonym
_)
TypeDefEntry
tde
->
('
Cl
ean
.
Types
'.
td_rhs
('
Cloogle
.
DB
'.
getTypeDef
tde
)
)=:('
Clean
.
Types
'.
TDRSynonym
_)
_
->
False
,
library_map
=
libmap
,
module_map
=
modmap
...
...
@@ -249,7 +249,18 @@ where
o
flatten
type_usages_map
=
make_usage_map
[[(
t
,
idx
)
\\
'
Clean
.
Types
'.
Type
t
_
<-
'
Clean
.
Types
'.
subtypes
t
]
\\
(
idx
,
FunctionEntry
{
fe_type
=
Just
t
})
<-
entridxs
]
[[(
subt
,
idx
)
\\
t
<-
usingTypes
e
,
'
Clean
.
Types
'.
Type
subt
_
<-
'
Clean
.
Types
'.
subtypes
t
]
\\
(
idx
,
e
)
<-
entridxs
]
where
usingTypes
::
!
CloogleEntry
->
['
Clean
.
Types
'.
Type
]
usingTypes
(
FunctionEntry
{
fe_type
=
Just
t
})
=
[
t
]
usingTypes
(
TypeDefEntry
tde
)
=
typesOfRhs
('
Clean
.
Types
'.
td_rhs
('
Cloogle
.
DB
'.
getTypeDef
tde
))
where
typesOfRhs
rhs
=
case
rhs
of
'
Clean
.
Types
'.
TDRSynonym
t
->
[
t
]
'
Clean
.
Types
'.
TDRAbstract
(
Just
rhs
)
->
typesOfRhs
rhs
'
Clean
.
Types
'.
TDRAbstractSynonym
t
->
[
t
]
_
->
[]
// constructors and selectors are taken care of by FunctionEntry
usingTypes
_
=
[]
class_usages_map
=
make_usage_map
[[(
cls
,
idx
)
\\
'
Clean
.
Types
'.
Instance
cls
_
<-
context
e
]
\\
(
idx
,
e
)
<-
entridxs
]
...
...