Commit Graph

6 Commits

Author SHA1 Message Date
Alex Hoppen
7ce41252e7 [SourceKit] Print compilerargs and sourcetext keys last
That way, when the request gets truncated by os_log in sourcekit-lsp, we see most of the request. Most likely the sourcetext and the compiler args wouldn't have made it into the log message completely anyway.

rdar://121322828
2024-02-29 20:45:55 -08:00
Alex Hoppen
5d01a097e1 [CodeCompletion] Don't distinguish convertible and idenical type relation
I think that preferring identical over convertible makes sense in e.g. C++ where we have implicit user-defined type conversions but since we don’t have them in Swift, I think the distinction doesn’t make too much sense, because if we have a `func foo(x: Int?)`, want don’t really want to  prioritize variables of type `Int?` over `Int` Similarly if we have `func foo(x: View)`, we don’t want to prioritize a variable of type `View` over e.g. `Text`.

rdar://91349364
2022-04-13 08:28:17 +02:00
Rintaro Ishizaki
e947512875 [CodeCompletion] Prioritize type matching overload for unresovled member
For exmaple:

    func foo(_: Int, _: IntOption)
    func foo(_: Float, _: FloatOption)

    foo(intVal, .<HERE>)

Previously code completion suggests static member from 'IntOption' and
'FloatOption' without any prioritization. Prioritize members from
'IntOption' because the user probably wants to input them.

In such cases, 'CodeCompletionExpr' at the cursor position is
pre-typechecked to 'IntOption'. So mark results with matching type with
'ExprSpecific'.

rdar://problem/62121221
2020-04-24 18:01:59 -07:00
Rintaro Ishizaki
71aeffdf17 [CodeCompletion] Calculate type relation for EnumElementDecl 2020-02-03 17:20:50 -08:00
Rintaro Ishizaki
1e74c39956 [SourceKit] Expose ExpectedTypeRelation for the completion results
So that clients can sort the results using this.

rdar://problem/59066560
2020-02-03 15:57:43 -08:00
Rintaro Ishizaki
9525f16440 [SourceKit] Add completion kind field to completion response
rdar://problem/52352045
2019-07-01 14:40:03 -07:00