Commit Graph

10 Commits

Author SHA1 Message Date
Michael Spencer
b2640e15e4 [test] Rename all module.map files to module.modulemap
`module.map` as a module map name has been discouraged since 2014, and
Clang will soon warn on its usage. This patch renames all instances of
`module.map` in the Swift tests to `module.modulemap` in preparation
for this change to Clang.

rdar://106123303
2023-08-21 15:58:59 -07:00
Nuri Amari
86c5698780 Implement importing of forward declared objc protocols and interfaces
This modifies the ClangImporter to introduce an opaque placeholder
representation for forward declared Objective-C interfaces and
protocols when imported into Swift.

In the compiler, the new functionality is hidden behind a frontend
flag -enable-import-objc-forward-declarations, and is on by default
for language mode >6.

The feature is disabled entirely in LLDB expression evaluation / Swift
REPL, regardless of language version.
2023-03-07 16:00:16 -08:00
Alex Hoppen
44f8e195ef [SourceKit] Recover if compiler arguments have errors
If the compiler arguments have errors in them (e.g. because a file with the same name is used twice), we can often still fulfill SourceKit requests because the compiler argument errors are only relevant for later stages of the compilation process.

Instead of bailing out early, do a best effor retrieving the compiler arguments that are valid and ignoring the errors.

Fixes rdar://77618144
2021-05-19 22:31:15 +02:00
Alex Hoppen
5d3fb8f26d [SymbolGraph] Fix crasher when retrieving cursor info of method defined in ObjC
In a mixed Objective-C / Swift module, we have a Clang module overlay that’s a Source file, not a serialized AST as is currently assumed. That assumption caused a crash when retrieving the symbol graph as part of a cursor info request to SourceKit, which was invoked on a method defined in the Objective-C part of the module.

To fix the crash, recursively use the same logic that already exists to serialize a module to also serialize the clang overlay module since that function alreayd correctly handles the distinction between source files and serialized ASTs.

Resolves rdar://76951147
2021-04-29 17:54:18 +02:00
Nathan Hawes
6150fbea67 [sourcekitd][test] Test CursorInfo works correctly with modules loaded via a parseable interface 2019-03-22 11:02:17 -07:00
Xi Ge
b4c224966b Re-apply "sourcekitd/test: add an interface grouping test for user module." 2019-02-15 11:20:01 -08:00
Ben Langmuir
f1803c87a9 Revert "sourcekitd/test: add an interface grouping test for user module." 2019-02-15 08:26:41 -08:00
Xi Ge
38691236aa sourcekitd/test: add test for cursor-info returning group name for user modules 2019-02-14 14:03:57 -08:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Ben Langmuir
503887c5f2 [SourceKit] Split SourceDocInfo tests into CursorInfo and RelatedIdents subdirectories
Unless you're familiar with the way the swift source code is organized,
it's not clear what "SourceDocInfo" means, or how it is different from
DocSupport, etc.  Move the tests into directories that are named based
on their request (note: we already had one test under CursorInfo, which
just made things even more confusing).
2016-03-17 16:31:46 -07:00