Commit Graph

12 Commits

Author SHA1 Message Date
Ahmed Elrefaey
1bc96857a8 Merge pull request #82464 from a7medev/feat/full-documentation-in-code-completion
[IDE] Add full documentation to code completion result
2025-09-04 10:06:21 +01:00
Tony Allevato
67d9eecd50 [AST] Make IsNonUserModuleRequest consider SourceFile inputs as well.
We're using a small custom frontend tool to generate indexstore data for `.swiftinterface` files in the SDKs. We do this by treating the `.swiftinterface` file as the input of an interface compilation, but this exits early because it treats it as a `SourceFile` instead of an external `LoadedFile`. This happens even if we call `setIsSystemModule(true)` unless we skip setting the SDK path, but that causes other problems. It seems harmless to check for `SourceFile`s as well, so that a tool processing an SDK interface as a direct input still gets the right state.
2024-09-17 09:44:42 -04: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
18dc9c1c27 [CodeCompletion] Remove CodeComletionString::getName()
`CodeCompletioString::getName()` was used only as the sorting keys in
`CodeCompletionContext::sortCompletionResults()` which is effectively
deprecated. There's no reason to check them in `swift-ide-test`. Instead,
check `printCodeCompletionResultFilterName()` that is actually used for
filtering.
2021-07-16 13:24:19 -07:00
Nathan Hawes
ef6c374516 [Sema/Index] Resolve #keyPath components so they can be indexed
Unlike \keypath expressions, only the property components of #keypath
expressions were being resolved, so index wouldn't pick up references for their
qualifying types.

Also fixes a code completion bug where it was reporting members from the Swift
rather than ObjC side of bridged types.

Resolves rdar://problem/61573935
2020-08-05 15:27:52 -07:00
Rintaro Ishizaki
00e4a76ef0 Revert "[Sema/Index] Resolve #keyPath components so they get handled by indexing, semantic highlighting, etc." 2020-08-04 12:51:52 -07:00
Nathan Hawes
1d78fe1211 [Sema/Index] Resolve #keyPath components so they can be indexed
Unlike \keypath expressions, only the property components of #keypath
expressions were being resolved, so index wouldn't pick up references for their
qualifying types.

Also fixes a code completion bug where it was reporting members from the Swift
rather than ObjC side of bridged types.

Resolves rdar://problem/61573935
2020-07-31 17:11:23 -07:00
Rintaro Ishizaki
e2a4621b14 [CodeCompletion] Suggest #selector and #keyPath after # only if applicable
Also, add type annotation, and make it `TypeRelation[Identical]`.
'ExprSpecific' is too strong.
2019-05-21 17:25:53 -07:00
Doug Gregor
6a8d3211aa [Type checker] Move ad-hoc isObjC/isDynamic checking to finalization.
Whenever we visit a declaration via the DeclChecker, add it to the
list of declarations to finalize. This makes sure that we can centralize
the notion of “finalize for SILGen” and that it will be called for
everything in the source file being processed.
2018-07-25 20:55:13 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Ben Langmuir
56158fca08 [CodeCompletion] Don't mark #keyPath as "expression specific" without #
We suggest #keyPath in every String context, so having it be
expression-specific is artificially increasing its priority.

rdar://problem/26544672
2016-05-31 11:42:01 -07:00
Doug Gregor
814a08a5da [IDE] Code completion for Objective-C #keyPath expressions.
Implement code completion support for Objective-C #keyPath
expressions, using semantic analysis of the partially-typed keypath
argument to provide an appropriate set of results (i.e., just
properties and types).

This implements all of the necessary parts of SE-0062 / SR-1237 /
rdar://problem/25710611, although at some point I'd like to follow it
up with some warnings to help migrate existing string literals to
2016-05-21 22:28:51 -07:00