Giter Club home page Giter Club logo

inkuire's Introduction

CI


Inkuire - Hoogle-like searches for Scala 3 and Kotlin


The project was created as the engineering thesis at AGH University of Technology in collaboration with VirtusLab - the creators of dokka and scaladoc.

The goal of the project is to provide way of searching extensive functions and methods by given signature for JVM languages. Currently supported langauges are Kotlin and Scala 3.


Live Demo

Feel free to test Inkuire locally or remotely at:

  • Scaladoc for stdlib with Inkuire support -> here

Scala 3 Video Demo:

Scaladoc:


If you see any bugs, please create an issue on Github

For Kotlin support see kotlin branch.

inkuire's People

Contributors

barkingbad avatar kacperfkorban avatar pikinier20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inkuire's Issues

Different `FunctionN` types

In InkuireDb functions, Function1 types have different DRIs, but there is only one Function1 in ancestryGraph. The same is probably true for any FunctionN type.

pic rel
one type is resolved after parsing from ancestryGraph, the other is straight from functions
Screenshot from 2020-08-27 21-04-38

Extend information offered by /forSignature endpoint about matched signatures

For now /forSignature endpoint in HttpServer sends String as a list of prettified matched signatures. This should be changed to a proper json with fields including e.g. (prettified) signature, function name, package. This external type should be declared in inkuire-common, so that the inkuire-intellij-plugin will be able to use it as well.

Add support for Nothing

Nothing is a special type in Kotlin, which substituted for any type (behaves like if it inherited from every type). Inkuire should support Nothing either by Making it a special type or adding every type as it's ancestor. This design should be consulted with entire Inkuire team.

Better 'equality' between two TypeVariables

Currently when checking if a TypeVariable is a subtype of other TypeVariable the strategy is to check if they have the same constraints. It can probably be done in a more clever way.
Good starting point in code is marked with //TODO #56

Consider disregarding arguments order in FluffMatchService

When matching signatures in FluffMatchService, specifically matching arguments, we're zipping arguments from both signatures together and performing checks on the types. We should consider mixing up the order of arguments.
Good starting place is marked in code with //TODO #54

Mapping java primitives to proper types

It's impossible to use primitives in FluffMatchService now, because DRI is needed to properly identify them.

Full list of signatures and types in them without DRIs:
typeOf: ReflectionFactoryImpl.(KClassifier, List, boolean) -> KType boolean
typeParameter: ReflectionFactoryImpl.(Object, String, KVariance, boolean) -> KTypeParameter Object, boolean
setUpperBounds: ReflectionFactoryImpl.(KTypeParameter, List) -> void void
clearCaches: ReflectionFactoryImpl.() -> void void
getValue: ReflectProperties.Val.(Object, Object) -> T Object, Object
getEnumConstantByName: Util.(Class<Enum>, String) -> Object Object
containsKey: IntTree.(long) -> boolean long, boolean
get: IntTree.(long) -> V long
plus: IntTree.(long, V) -> IntTree long
minus: IntTree.(long) -> IntTree long
changeKeysAbove: IntTree.(long, int) -> IntTree long, int
changeKeysBelow: IntTree.(long, int) -> IntTree long, int
get: IntTreePMap.(int) -> V int
plus: IntTreePMap.(int, V) -> IntTreePMap int
minus: IntTreePMap.(int) -> IntTreePMap int
size: HashPMap.() -> int int
containsKey: HashPMap.(Object) -> boolean Object, boolean
get: HashPMap.(Object) -> V Object
minus: HashPMap.(Object) -> HashPMap<K, V> Object
equals: MapEntry.(Object) -> boolean Object, boolean
hashCode: MapEntry.() -> int int
get: ConsPStack.(int) -> E int
size: ConsPStack.() -> int int
minus: ConsPStack.(int) -> ConsPStack int
forEach: Iterable.(Consumer) -> void void
isInline: FunctionReference.() -> boolean boolean
isExternal: FunctionReference.() -> boolean boolean
isOperator: FunctionReference.() -> boolean boolean
isInfix: FunctionReference.() -> boolean boolean
isSuspend: FunctionReference.() -> boolean boolean
equals: FunctionReference.(Object) -> boolean Object, boolean
hashCode: FunctionReference.() -> int int
getBoundReceiver: CallableReference.() -> Object Object
call: CallableReference.(Array) -> Object Object
callBy: CallableReference.(Map) -> Object Object
isFinal: CallableReference.() -> boolean boolean
isOpen: CallableReference.() -> boolean boolean
isAbstract: CallableReference.() -> boolean boolean
isFinal: KCallable.() -> boolean boolean
isOpen: KCallable.() -> boolean boolean
isAbstract: KCallable.() -> boolean boolean
isSuspend: KCallable.() -> boolean boolean
getArity: FunctionBase.() -> int int
isInline: KFunction.() -> boolean boolean
isExternal: KFunction.() -> boolean boolean
isOperator: KFunction.() -> boolean boolean
isInfix: KFunction.() -> boolean boolean
get: MutablePropertyReference0Impl.() -> Object Object
set: MutablePropertyReference0Impl.(Object) -> void Object, void
invoke: MutablePropertyReference0.() -> Object Object
getDelegate: MutablePropertyReference0.() -> Object Object
isLateinit: PropertyReference.() -> boolean boolean
isConst: PropertyReference.() -> boolean boolean
equals: PropertyReference.(Object) -> boolean Object, boolean
hashCode: PropertyReference.() -> int int
isSuspend: CallableReference.() -> boolean boolean
isLateinit: KProperty.() -> boolean boolean
isConst: KProperty.() -> boolean boolean
set: KMutableProperty0.(V) -> void void
getDelegate: KProperty0.() -> Object Object
equals: AdaptedFunctionReference.(Object) -> boolean Object, boolean
hashCode: AdaptedFunctionReference.() -> int int
typeParameter: Reflection.(Object, String, KVariance, boolean) -> KTypeParameter Object, boolean
setUpperBounds: Reflection.(KTypeParameter, KType) -> void void
setUpperBounds: Reflection.(KTypeParameter, Array) -> void void
invoke: PropertyReference1.(Object) -> Object Object, Object
getDelegate: PropertyReference1.(Object) -> Object Object, Object
getDelegate: KProperty1.(T) -> Object Object
typeOf: ReflectionFactory.(KClassifier, List, boolean) -> KType boolean
typeParameter: ReflectionFactory.(Object, String, KVariance, boolean) -> KTypeParameter Object, boolean
setUpperBounds: ReflectionFactory.(KTypeParameter, List) -> void void
getArity: FunctionImpl.() -> int int
invokeVararg: FunctionImpl.(Array) -> Object Object
invoke: FunctionImpl.() -> Object Object
invoke: FunctionImpl.(Object) -> Object Object, Object
invoke: FunctionImpl.(Object, Object) -> Object Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object) -> Object Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
invoke: FunctionImpl.(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object) -> Object Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object
getArity: FunctionReference.() -> int int
invoke: MutablePropertyReference1.(Object) -> Object Object, Object
getDelegate: MutablePropertyReference1.(Object) -> Object Object, Object
set: KMutableProperty1.(T, V) -> void void
invoke: PropertyReference0.() -> Object Object
getDelegate: PropertyReference0.() -> Object Object
get: MutablePropertyReference1Impl.(Object) -> Object Object, Object
set: MutablePropertyReference1Impl.(Object, Object) -> void Object, Object, void
get: MutablePropertyReference2Impl.(Object, Object) -> Object Object, Object, Object
set: MutablePropertyReference2Impl.(Object, Object, Object) -> void Object, Object, Object, void
invoke: MutablePropertyReference2.(Object, Object) -> Object Object, Object, Object
getDelegate: MutablePropertyReference2.(Object, Object) -> Object Object, Object, Object
set: KMutableProperty2.(D, E, V) -> void void
getDelegate: KProperty2.(D, E) -> Object Object
addSpread: SpreadBuilder.(Object) -> void Object, void
size: SpreadBuilder.() -> int int
add: SpreadBuilder.(Object) -> void Object, void
throwCce: TypeIntrinsics.(Object, String) -> void Object, void
throwCce: TypeIntrinsics.(String) -> void void
isMutableIterator: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableIterator: TypeIntrinsics.(Object) -> Iterator Object
asMutableIterator: TypeIntrinsics.(Object, String) -> Iterator Object
castToIterator: TypeIntrinsics.(Object) -> Iterator Object
isMutableListIterator: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableListIterator: TypeIntrinsics.(Object) -> ListIterator Object
asMutableListIterator: TypeIntrinsics.(Object, String) -> ListIterator Object
castToListIterator: TypeIntrinsics.(Object) -> ListIterator Object
isMutableIterable: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableIterable: TypeIntrinsics.(Object) -> Iterable Object
asMutableIterable: TypeIntrinsics.(Object, String) -> Iterable Object
castToIterable: TypeIntrinsics.(Object) -> Iterable Object
isMutableCollection: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableCollection: TypeIntrinsics.(Object) -> Collection Object
asMutableCollection: TypeIntrinsics.(Object, String) -> Collection Object
castToCollection: TypeIntrinsics.(Object) -> Collection Object
isMutableList: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableList: TypeIntrinsics.(Object) -> List Object
asMutableList: TypeIntrinsics.(Object, String) -> List Object
castToList: TypeIntrinsics.(Object) -> List Object
isMutableSet: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableSet: TypeIntrinsics.(Object) -> Set Object
asMutableSet: TypeIntrinsics.(Object, String) -> Set Object
castToSet: TypeIntrinsics.(Object) -> Set Object
isMutableMap: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableMap: TypeIntrinsics.(Object) -> Map Object
asMutableMap: TypeIntrinsics.(Object, String) -> Map Object
castToMap: TypeIntrinsics.(Object) -> Map Object
isMutableMapEntry: TypeIntrinsics.(Object) -> boolean Object, boolean
asMutableMapEntry: TypeIntrinsics.(Object) -> Map.Entry Object
asMutableMapEntry: TypeIntrinsics.(Object, String) -> Map.Entry Object
castToMapEntry: TypeIntrinsics.(Object) -> Map.Entry Object
getFunctionArity: TypeIntrinsics.(Object) -> int Object, int
isFunctionOfArity: TypeIntrinsics.(Object, int) -> boolean Object, int, boolean
beforeCheckcastToFunctionOfArity: TypeIntrinsics.(Object, int) -> Object Object, int, Object
beforeCheckcastToFunctionOfArity: TypeIntrinsics.(Object, int, String) -> Object Object, int, Object
get: PropertyReference2Impl.(Object, Object) -> Object Object, Object, Object
invoke: PropertyReference2.(Object, Object) -> Object Object, Object, Object
getDelegate: PropertyReference2.(Object, Object) -> Object Object, Object, Object
get: PropertyReference1Impl.(Object) -> Object Object, Object
get: PropertyReference0Impl.() -> Object Object
stringPlus: Intrinsics.(String, Object) -> String Object
checkNotNull: Intrinsics.(Object) -> void Object, void
checkNotNull: Intrinsics.(Object, String) -> void Object, void
throwNpe: Intrinsics.() -> void void
throwNpe: Intrinsics.(String) -> void void
throwJavaNpe: Intrinsics.() -> void void
throwJavaNpe: Intrinsics.(String) -> void void
throwUninitializedProperty: Intrinsics.(String) -> void void
throwUninitializedPropertyAccessException: Intrinsics.(String) -> void void
throwAssert: Intrinsics.() -> void void
throwAssert: Intrinsics.(String) -> void void
throwIllegalArgument: Intrinsics.() -> void void
throwIllegalArgument: Intrinsics.(String) -> void void
throwIllegalState: Intrinsics.() -> void void
throwIllegalState: Intrinsics.(String) -> void void
checkExpressionValueIsNotNull: Intrinsics.(Object, String) -> void Object, void
checkNotNullExpressionValue: Intrinsics.(Object, String) -> void Object, void
checkReturnedValueIsNotNull: Intrinsics.(Object, String, String) -> void Object, void
checkReturnedValueIsNotNull: Intrinsics.(Object, String) -> void Object, void
checkFieldIsNotNull: Intrinsics.(Object, String, String) -> void Object, void
checkFieldIsNotNull: Intrinsics.(Object, String) -> void Object, void
checkParameterIsNotNull: Intrinsics.(Object, String) -> void Object, void
checkNotNullParameter: Intrinsics.(Object, String) -> void Object, void
compare: Intrinsics.(long, long) -> int long, long, int
compare: Intrinsics.(int, int) -> int int, int, int
areEqual: Intrinsics.(Object, Object) -> boolean Object, Object, boolean
areEqual: Intrinsics.(Double, Double) -> boolean boolean
areEqual: Intrinsics.(Double, double) -> boolean double, boolean
areEqual: Intrinsics.(double, Double) -> boolean double, boolean
areEqual: Intrinsics.(Float, Float) -> boolean boolean
areEqual: Intrinsics.(Float, float) -> boolean float, boolean
areEqual: Intrinsics.(float, Float) -> boolean float, boolean
throwUndefinedForReified: Intrinsics.() -> void void
throwUndefinedForReified: Intrinsics.(String) -> void void
reifiedOperationMarker: Intrinsics.(int, String) -> void int, void
reifiedOperationMarker: Intrinsics.(int, String, String) -> void int, void
needClassReification: Intrinsics.() -> void void
needClassReification: Intrinsics.(String) -> void void
checkHasClass: Intrinsics.(String) -> void void
checkHasClass: Intrinsics.(String, String) -> void void
anyMagicApiCall: MagicApiIntrinsics.(int) -> T where int
voidMagicApiCall: MagicApiIntrinsics.(int) -> void int, void
intMagicApiCall: MagicApiIntrinsics.(int) -> int int, int
anyMagicApiCall: MagicApiIntrinsics.(Object) -> T where Object
voidMagicApiCall: MagicApiIntrinsics.(Object) -> void Object, void
intMagicApiCall: MagicApiIntrinsics.(Object) -> int Object, int
intMagicApiCall: MagicApiIntrinsics.(int, long, Object) -> int int, long, Object, int
intMagicApiCall: MagicApiIntrinsics.(int, long, long, Object) -> int int, long, long, Object, int
intMagicApiCall: MagicApiIntrinsics.(int, Object, Object) -> int int, Object, Object, int
intMagicApiCall: MagicApiIntrinsics.(int, Object, Object, Object, Object) -> int int, Object, Object, Object, Object, int
anyMagicApiCall: MagicApiIntrinsics.(int, long, Object) -> T where int, long, Object
anyMagicApiCall: MagicApiIntrinsics.(int, long, long, Object) -> T where int, long, long, Object
anyMagicApiCall: MagicApiIntrinsics.(int, Object, Object) -> T where int, Object, Object
anyMagicApiCall: MagicApiIntrinsics.(int, Object, Object, Object, Object) -> T where int, Object, Object, Object, Object
mark: InlineMarker.(int) -> void int, void
mark: InlineMarker.(String) -> void void
beforeInlineCall: InlineMarker.() -> void void
afterInlineCall: InlineMarker.() -> void void
finallyStart: InlineMarker.(int) -> void int, void
finallyEnd: InlineMarker.(int) -> void int, void

But why

    interface A<out T> {
        fun sdax(): T = TODO()
    }

    class B<T> : A<T> {
        fun x(t: T): Int = TODO()
        fun y(): T = TODO()
    }

    fun <T : Any, XD : B<in T>> x(xd: XD): T {
        return xd.sdax() as T
    } 

is completely fine for compiler

Validate where clause in provided signature

Extensions functions syntax type is forbidden as a Type constraint in where clause in generic functions. So for following examples:

where T : (A, B) -> C // should accept
where T : Function2<A, B, C> // should accept
where T : A.(B) -> C // should FAIL

Comparing constraints of type variables

There's a non-trivial problem when function has multiple type variables with some constraints and you need to compare it with other function. You want to make it order insensitive and have mechanism that can be extended to non-exact matches.

E.g
<A: Int, B: String> A.(B) -> A?
equals
<A: String, B: Int> B.(A) -> B?

Update readme

Our readme is not up to date, especially usage sector. I think we should also document API endpoints

Support for TypeVariables as GenericTypes

Kotlin doesn't allow declating functions with signatures like this <F> Int.(Int) -> F<Int>. But maybe inkuire-engine should? It would be quite nice to be able to use TypeVariables with given Kinds.

Move adding implicit inheritance ancestors to inkuire-dokka-plugin

ATM for any type that isn't Any and has no ancestors, Any is added as a parent in InkuireDb. This should be moved to inkuire-dokka-plugin. This should be extensively tested afterwards, because it has the potential of creating cycles in our ancestry DAG.
The mapping is marked in code with //TODO #53

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.