Merge exported modules with the same public name in generated interface

If a module has the same `public-module-name` as the module being
generated and its import is exported, merge it into the same generated
interface.

Fix various always-imported modules from being printed while here and
update all the tests that checked for them.

Resolves rdar://137887712.
This commit is contained in:
Ben Barham
2025-04-21 11:24:31 -07:00
parent 6735659d39
commit ddddc667c8
35 changed files with 3500 additions and 3640 deletions

View File

@@ -241,6 +241,12 @@ struct PrintOptions {
/// \see FileUnit::getExportedModuleName
bool UseExportedModuleNames = false;
/// If true, printed module names will use the "public" (for documentation)
/// name, which may be different from the regular name.
///
/// \see FileUnit::getPublicModuleName
bool UsePublicModuleNames = false;
/// Use the original module name to qualify a symbol.
bool UseOriginallyDefinedInModuleNames = false;
@@ -711,6 +717,7 @@ struct PrintOptions {
result.MapCrossImportOverlaysToDeclaringModule = true;
result.PrintCurrentMembersOnly = false;
result.SuppressExpandedMacros = true;
result.UsePublicModuleNames = true;
return result;
}

View File

@@ -38,11 +38,14 @@ namespace ide {
/// Flags used when traversing a module for printing.
enum class ModuleTraversal : unsigned {
/// Visit modules even if their contents wouldn't be visible to name lookup.
VisitHidden = 0x01,
VisitHidden = 0x01,
/// Visit submodules.
VisitSubmodules = 0x02,
/// Skip the declarations in a Swift overlay module.
SkipOverlay = 0x04,
SkipOverlay = 0x04,
/// Visit exported modules where their public module name matches the current
/// module.
VisitMatchingExported = 0x08,
};
/// Options used to describe the traversal of a module for printing.

View File

@@ -6028,6 +6028,11 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
Name = Mod->getASTContext().getIdentifier(ExportedModuleName);
}
StringRef PublicModuleName = File->getPublicModuleName();
if (Options.UsePublicModuleNames && !PublicModuleName.empty()) {
Name = Mod->getASTContext().getIdentifier(PublicModuleName);
}
if (Options.UseOriginallyDefinedInModuleNames) {
Decl *D = Ty->getDecl();
for (auto attr: D->getAttrs().getAttributes<OriginallyDefinedInAttr>()) {

View File

@@ -304,6 +304,34 @@ static bool compareSwiftDecls(Decl *LHS, Decl *RHS) {
return LHS->getKind() < RHS->getKind();
}
static bool shouldPrintImport(ImportDecl *ImportD, ModuleDecl *OrigMod,
const clang::Module *OrigClangMod) {
if (ImportD->getAttrs().hasAttribute<ImplementationOnlyAttr>())
return false;
auto *ImportedMod = ImportD->getModule();
if (ImportedMod) {
if (ImportedMod == OrigMod)
return false;
if (ImportedMod->isOnoneSupportModule())
return false;
if (ImportedMod->getName().hasUnderscoredNaming())
return false;
}
if (!OrigClangMod)
return true;
auto ImportedClangMod = ImportD->getClangModule();
if (!ImportedClangMod)
return true;
if (!ImportedClangMod->isSubModule())
return true;
if (ImportedClangMod == OrigClangMod)
return false;
return ImportedClangMod->isSubModuleOf(OrigClangMod);
}
static std::pair<ArrayRef<Decl*>, ArrayRef<Decl*>>
getDeclsFromCrossImportOverlay(ModuleDecl *Overlay, ModuleDecl *Declaring,
SmallVectorImpl<Decl *> &Decls,
@@ -329,7 +357,8 @@ getDeclsFromCrossImportOverlay(ModuleDecl *Overlay, ModuleDecl *Declaring,
// Ignore imports of the underlying module, or any cross-import
// that would map back to it.
if (Imported == Declaring || Imported->isCrossImportOverlayOf(Declaring))
if (!shouldPrintImport(ID, Declaring, nullptr) ||
Imported->isCrossImportOverlayOf(Declaring))
return false;
// Ignore an imports of modules also imported by the underlying module.
@@ -457,19 +486,40 @@ void swift::ide::printModuleInterface(
auto AdjustedOptions = Options;
adjustPrintOptions(AdjustedOptions);
llvm::DenseSet<const void *> SeenImportedDecls;
SmallVector<ModuleDecl *, 1> ModuleList;
ModuleList.push_back(TargetMod);
SeenImportedDecls.insert(TargetMod);
SmallVector<ImportDecl *, 1> ImportDecls;
llvm::DenseSet<const clang::Module *> ClangModulesForImports;
SmallVector<Decl *, 1> SwiftDecls;
SmallVector<ImportDecl *, 0> ImportDecls;
SmallVector<Decl *, 0> SwiftDecls;
llvm::DenseMap<const clang::Module *,
SmallVector<std::pair<Decl *, clang::SourceLocation>, 1>>
ClangDecls;
SmallVector<std::pair<Decl *, clang::SourceLocation>, 0>>
ClangDecls;
// Add exported modules that have the same public module name as this module
// (excluding the underlying clang module if there is one).
if (TraversalOptions & ModuleTraversal::VisitMatchingExported) {
SmallVector<ImportedModule> Imports;
TargetMod->getImportedModules(Imports,
ModuleDecl::ImportFilterKind::Exported);
for (ImportedModule Import : Imports) {
if (Import.importedModule->getPublicModuleName(
/*onlyIfImported=*/false) != TargetMod->getName())
continue;
if (TargetClangMod != nullptr &&
Import.importedModule->findUnderlyingClangModule() == TargetClangMod)
continue;
ModuleList.push_back(Import.importedModule);
SeenImportedDecls.insert(Import.importedModule);
}
}
// If we're printing recursively, find all of the submodules to print.
if (TargetClangMod) {
if (TraversalOptions) {
// Add clang submodules if they're being visited
if (TraversalOptions & ModuleTraversal::VisitSubmodules) {
SmallVector<const clang::Module *, 8> Worklist;
SmallPtrSet<const clang::Module *, 8> Visited;
Worklist.push_back(TargetClangMod);
@@ -482,16 +532,15 @@ void swift::ide::printModuleInterface(
ClangDecls.insert({ CM, {} });
if (CM != TargetClangMod)
if (auto *OwningModule = Importer.getWrapperForModule(CM))
if (CM != TargetClangMod) {
if (auto *OwningModule = Importer.getWrapperForModule(CM)) {
ModuleList.push_back(OwningModule);
}
}
// If we're supposed to visit submodules, add them now.
if (TraversalOptions & ModuleTraversal::VisitSubmodules) {
for (clang::Module * submodule: CM->submodules()) {
if (Visited.insert(submodule).second) {
Worklist.push_back(submodule);
}
for (clang::Module *submodule : CM->submodules()) {
if (Visited.insert(submodule).second) {
Worklist.push_back(submodule);
}
}
}
@@ -500,8 +549,7 @@ void swift::ide::printModuleInterface(
}
}
SmallVector<Decl *, 1> Decls;
SmallVector<Decl *, 0> Decls;
for (ModuleDecl *M : ModuleList) {
swift::getTopLevelDeclsForDisplay(M, Decls);
}
@@ -527,42 +575,38 @@ void swift::ide::printModuleInterface(
continue;
}
auto ShouldPrintImport = [&](ImportDecl *ImportD) -> bool {
if (ImportD->getAttrs().hasAttribute<ImplementationOnlyAttr>())
return false;
if (!TargetClangMod)
return true;
if (ImportD->getModule() == TargetMod)
return false;
auto ImportedMod = ImportD->getClangModule();
if (!ImportedMod)
return true;
if (!ImportedMod->isSubModule())
return true;
if (ImportedMod == TargetClangMod)
return false;
return ImportedMod->isSubModuleOf(TargetClangMod);
};
if (auto ID = dyn_cast<ImportDecl>(D)) {
if (ShouldPrintImport(ID)) {
if (ID->getClangModule())
// Erase those submodules that are not missing.
NoImportSubModules.erase(ID->getClangModule());
if (ID->getImportKind() == ImportKind::Module) {
// Make sure we don't print duplicate imports, due to getting imports
// for both a clang module and its overlay.
if (auto *ClangMod = getUnderlyingClangModuleForImport(ID)) {
auto P = ClangModulesForImports.insert(ClangMod);
bool IsNew = P.second;
if (!IsNew)
continue;
}
if (!shouldPrintImport(ID, TargetMod, TargetClangMod))
continue;
// Erase submodules that are not missing
if (ID->getClangModule())
NoImportSubModules.erase(ID->getClangModule());
if (ID->getImportKind() == ImportKind::Module) {
// Could have a duplicate import from a clang module's overlay or
// because we're merging modules. Skip them.
if (auto *ClangMod = getUnderlyingClangModuleForImport(ID)) {
if (!SeenImportedDecls.insert(ClangMod).second)
continue;
}
ImportDecls.push_back(ID);
if (auto *ImportedMod = ID->getModule()) {
if (!SeenImportedDecls.insert(ImportedMod).second)
continue;
}
} else {
bool AnyNewDecls = false;
for (auto *ImportedDecl : ID->getDecls()) {
AnyNewDecls |= SeenImportedDecls.insert(ImportedDecl).second;
}
if (!AnyNewDecls)
continue;
}
ImportDecls.push_back(ID);
continue;
}
@@ -684,9 +728,12 @@ void swift::ide::printModuleInterface(
// Imports from the stdlib are internal details that don't need to be exposed.
if (!TargetMod->isStdlibModule()) {
for (auto *D : ImportDecls)
for (auto *D : ImportDecls) {
PrintDecl(D);
Printer.printNewline();
}
if (!ImportDecls.empty()) {
Printer.printNewline();
}
}
{

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func %%% (lhs: Int, rhs: Int) -> Int
postfix func =-> (lhs: Int) -> Int
postfix func => (lhs: Int) -> Int

View File

@@ -10,7 +10,5 @@ import FooOverlay
// CHECK: @_exported import Foo
// CHECK: @_exported import struct Foo.FooStruct1
// CHECK: @_exported import Foo.FooSub
// CHECK: @_exported import func Foo.FooSub.fooSubFunc1
// FIXME: this duplicate import is silly, but not harmful.
// CHECK: @_exported import func Foo.fooSubFunc1
// CHECK: func fooSubOverlayFunc1(x: Int32) -> Int32

View File

@@ -41,7 +41,7 @@ public class ASwiftType {
}
// LibA is a mixed framework with no source info and a submodule
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:36 -print-raw-response | %FileCheck %s --check-prefix=CHECKA
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:36 -print-raw-response | %FileCheck %s --check-prefix=CHECKA
// CHECKA: key.name: "ASwiftType"
// CHECKA: key.modulename: "LibA"
// CHECKA: key.decl_lang: source.lang.swift
@@ -60,7 +60,7 @@ framework module LibA {
@interface AObjcType
@end
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:54 -print-raw-response | %FileCheck %s --check-prefix=CHECKAOBJ
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:54 -print-raw-response | %FileCheck %s --check-prefix=CHECKAOBJ
// CHECKAOBJ: key.name: "AObjcType"
// CHECKAOBJ: key.line: [[@LINE-5]]
// CHECKAOBJ: key.column: 12
@@ -72,7 +72,7 @@ framework module LibA {
@interface ASubType
@end
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=12:70 -print-raw-response | %FileCheck %s --check-prefix=CHECKASUB
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=11:70 -print-raw-response | %FileCheck %s --check-prefix=CHECKASUB
// CHECKASUB: key.name: "ASubType"
// CHECKASUB: key.line: [[@LINE-5]]
// CHECKASUB: key.column: 12
@@ -84,7 +84,7 @@ framework module LibA {
public class BType {}
// LibB has source info
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:32 -print-raw-response | %FileCheck %s --check-prefix=CHECKB
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:32 -print-raw-response | %FileCheck %s --check-prefix=CHECKB
// CHECKB: key.name: "BType"
// CHECKB: key.line: [[@LINE-5]]
// CHECKB: key.column: 14
@@ -96,7 +96,7 @@ public class BType {}
public class CType {}
// LibC has no source info
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:47 -print-raw-response | %FileCheck %s --check-prefix=CHECKC
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:47 -print-raw-response | %FileCheck %s --check-prefix=CHECKC
// CHECKC: key.name: "CType"
// CHECKC: key.modulename: "LibC"
// CHECKC: key.decl_lang: source.lang.swift
@@ -105,7 +105,7 @@ public class CType {}
@interface DType
@end
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=14:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKD
// RUN: %sourcekitd-test -req=interface-gen-open -module LibA -- -F %t/frameworks -target %target-triple == -req=cursor -pos=13:57 -print-raw-response | %FileCheck %s --check-prefix=CHECKD
// CHECKD: key.name: "DType"
// CHECKD: key.line: [[@LINE-5]]
// CHECKD: key.column: 12

View File

@@ -1,4 +1,3 @@
func fooSubFunc1(_ a: Int32) -> Int32
struct FooSubEnum1 : Hashable, Equatable, RawRepresentable {
@@ -26,314 +25,314 @@ var FooSubUnnamedEnumeratorA1: Int { get }
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 1,
key.offset: 0,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 6,
key.offset: 5,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 18,
key.offset: 17,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 20,
key.offset: 19,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
key.offset: 23,
key.offset: 22,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int32",
key.usr: "s:s5Int32V",
key.offset: 33,
key.offset: 32,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 40,
key.offset: 39,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 47,
key.offset: 46,
key.length: 11
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "Hashable",
key.usr: "s:SH",
key.offset: 61,
key.offset: 60,
key.length: 8
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "Equatable",
key.usr: "s:SQ",
key.offset: 71,
key.offset: 70,
key.length: 9
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "RawRepresentable",
key.usr: "s:SY",
key.offset: 82,
key.offset: 81,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 106,
key.offset: 105,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 111,
key.offset: 110,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 113,
key.offset: 112,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
key.offset: 123,
key.offset: 122,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 136,
key.offset: 135,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 141,
key.offset: 140,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 150,
key.offset: 149,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
key.offset: 160,
key.offset: 159,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 173,
key.offset: 172,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 177,
key.offset: 176,
key.length: 8
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "UInt32",
key.usr: "s:s6UInt32V",
key.offset: 187,
key.offset: 186,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 199,
key.offset: 198,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 210,
key.offset: 209,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 214,
key.offset: 213,
key.length: 9
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
key.offset: 225,
key.offset: 224,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 231,
key.offset: 230,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 242,
key.offset: 241,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 253,
key.offset: 252,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 258,
key.offset: 257,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 263,
key.offset: 262,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 268,
key.offset: 267,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 276,
key.offset: 275,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Hasher",
key.usr: "s:s6HasherV",
key.offset: 282,
key.offset: 281,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 295,
key.offset: 294,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 302,
key.offset: 301,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.operator,
key.offset: 307,
key.offset: 306,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 311,
key.offset: 310,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 313,
key.offset: 312,
key.length: 3
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
key.offset: 318,
key.offset: 317,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 331,
key.offset: 330,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 333,
key.offset: 332,
key.length: 3
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
key.offset: 338,
key.offset: 337,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Bool",
key.usr: "s:Sb",
key.offset: 354,
key.offset: 353,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 362,
key.offset: 361,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 366,
key.offset: 365,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
key.offset: 380,
key.offset: 379,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 394,
key.offset: 393,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 401,
key.offset: 400,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 405,
key.offset: 404,
key.length: 12
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
key.offset: 419,
key.offset: 418,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 433,
key.offset: 432,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 440,
key.offset: 439,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 444,
key.offset: 443,
key.length: 25
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
key.offset: 471,
key.offset: 470,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 477,
key.offset: 476,
key.length: 3
}
]
@@ -342,7 +341,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.free,
key.name: "fooSubFunc1(_:)",
key.usr: "c:@F@fooSubFunc1",
key.offset: 1,
key.offset: 0,
key.length: 37,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fooSubFunc1</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>a</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.var.parameter.type></decl.var.parameter>) -&gt; <decl.function.returntype><ref.struct usr=\"s:s5Int32V\">Int32</ref.struct></decl.function.returntype></decl.function.free>",
key.entities: [
@@ -350,7 +349,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "a",
key.offset: 23,
key.offset: 22,
key.length: 5
}
],
@@ -360,7 +359,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.struct,
key.name: "FooSubEnum1",
key.usr: "c:@E@FooSubEnum1",
key.offset: 40,
key.offset: 39,
key.length: 320,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>FooSubEnum1</decl.name> : <ref.protocol usr=\"s:SH\">Hashable</ref.protocol>, <ref.protocol usr=\"s:SQ\">Equatable</ref.protocol>, <ref.protocol usr=\"s:SY\">RawRepresentable</ref.protocol></decl.struct>",
key.conforms: [
@@ -385,7 +384,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(_:)",
key.usr: "s:So11FooSubEnum1VyABs6UInt32Vcfc",
key.offset: 106,
key.offset: 105,
key.length: 24,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>rawValue</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -393,7 +392,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "rawValue",
key.offset: 123,
key.offset: 122,
key.length: 6
}
]
@@ -402,7 +401,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.constructor,
key.name: "init(rawValue:)",
key.usr: "s:So11FooSubEnum1V8rawValueABs6UInt32V_tcfc",
key.offset: 136,
key.offset: 135,
key.length: 31,
key.fully_annotated_decl: "<decl.function.constructor><syntaxtype.keyword>init</syntaxtype.keyword>(<decl.var.parameter><decl.var.parameter.argument_label>rawValue</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.constructor>",
key.entities: [
@@ -410,7 +409,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.local,
key.keyword: "rawValue",
key.name: "rawValue",
key.offset: 160,
key.offset: 159,
key.length: 6
}
]
@@ -419,7 +418,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.instance,
key.name: "rawValue",
key.usr: "s:So11FooSubEnum1V8rawValues6UInt32Vvp",
key.offset: 173,
key.offset: 172,
key.length: 20,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>rawValue</decl.name>: <decl.var.type><ref.struct usr=\"s:s6UInt32V\">UInt32</ref.struct></decl.var.type></decl.var.instance>"
},
@@ -428,7 +427,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.name: "hashValue",
key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp::SYNTHESIZED::c:@E@FooSubEnum1",
key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE04hashB0Sivp",
key.offset: 199,
key.offset: 198,
key.length: 37,
key.fully_annotated_decl: "<decl.var.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>hashValue</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.instance>"
},
@@ -437,7 +436,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.name: "hash(into:)",
key.usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF::SYNTHESIZED::c:@E@FooSubEnum1",
key.original_usr: "s:SYsSHRzSH8RawValueSYRpzrlE4hash4intoys6HasherVz_tF",
key.offset: 242,
key.offset: 241,
key.length: 47,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.attribute.builtin><syntaxtype.attribute.name>@inlinable</syntaxtype.attribute.name></syntaxtype.attribute.builtin> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>hash</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>into</decl.var.parameter.argument_label> <decl.var.parameter.name>hasher</decl.var.parameter.name>: <syntaxtype.keyword>inout</syntaxtype.keyword> <decl.var.parameter.type><ref.struct usr=\"s:s6HasherV\">Hasher</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.method.instance>",
key.entities: [
@@ -445,7 +444,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.local,
key.keyword: "into",
key.name: "hasher",
key.offset: 282,
key.offset: 281,
key.length: 6
}
]
@@ -456,7 +455,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.usr: "s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@FooSubEnum1",
key.original_usr: "s:SQsE2neoiySbx_xtFZ",
key.doc.full_as_xml: "<Function><Name>!=(_:_:)</Name><USR>s:SQsE2neoiySbx_xtFZ::SYNTHESIZED::c:@E@FooSubEnum1</USR><Declaration>static func != (lhs: FooSubEnum1, rhs: FooSubEnum1) -&gt; Bool</Declaration><CommentParts><Abstract><Para>Returns a Boolean value indicating whether two values are not equal.</Para></Abstract><Parameters><Parameter><Name>lhs</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>A value to compare.</Para></Discussion></Parameter><Parameter><Name>rhs</Name><Direction isExplicit=\"0\">in</Direction><Discussion><Para>Another value to compare.</Para></Discussion></Parameter></Parameters><Discussion><Para>Inequality is the inverse of equality. For any values <codeVoice>a</codeVoice> and <codeVoice>b</codeVoice>, <codeVoice>a != b</codeVoice> implies that <codeVoice>a == b</codeVoice> is <codeVoice>false</codeVoice>.</Para><Para>This is the default implementation of the not-equal-to operator (<codeVoice>!=</codeVoice>) for any type that conforms to <codeVoice>Equatable</codeVoice>.</Para></Discussion></CommentParts></Function>",
key.offset: 295,
key.offset: 294,
key.length: 63,
key.fully_annotated_decl: "<decl.function.operator.infix><syntaxtype.keyword>static</syntaxtype.keyword> <syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>!= </decl.name>(<decl.var.parameter><decl.var.parameter.name>lhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.parameter.type></decl.var.parameter>, <decl.var.parameter><decl.var.parameter.name>rhs</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.parameter.type></decl.var.parameter>) -&gt; <decl.function.returntype><ref.struct usr=\"s:Sb\">Bool</ref.struct></decl.function.returntype></decl.function.operator.infix>",
key.entities: [
@@ -464,14 +463,14 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "lhs",
key.offset: 318,
key.offset: 317,
key.length: 11
},
{
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "rhs",
key.offset: 338,
key.offset: 337,
key.length: 11
}
]
@@ -483,7 +482,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubEnum1X",
key.usr: "c:@E@FooSubEnum1@FooSubEnum1X",
key.offset: 362,
key.offset: 361,
key.length: 37,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubEnum1X</decl.name>: <decl.var.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"
@@ -492,7 +491,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubEnum1Y",
key.usr: "c:@E@FooSubEnum1@FooSubEnum1Y",
key.offset: 401,
key.offset: 400,
key.length: 37,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubEnum1Y</decl.name>: <decl.var.type><ref.struct usr=\"c:@E@FooSubEnum1\">FooSubEnum1</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"
@@ -501,7 +500,7 @@ var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.name: "FooSubUnnamedEnumeratorA1",
key.usr: "c:@Ea@FooSubUnnamedEnumeratorA1@FooSubUnnamedEnumeratorA1",
key.offset: 440,
key.offset: 439,
key.length: 42,
key.fully_annotated_decl: "<decl.var.global><syntaxtype.keyword>var</syntaxtype.keyword> <decl.name>FooSubUnnamedEnumeratorA1</decl.name>: <decl.var.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.type> { <syntaxtype.keyword>get</syntaxtype.keyword> }</decl.var.global>",
key.modulename: "Foo.FooSub"

View File

@@ -1,11 +1,8 @@
func fromClangFramework()
// MARK: - BystandingLibrary Additions
import SwiftOnoneSupport
// Available when BystandingLibrary is imported with ClangFramework
func fromClangFrameworkCrossImport()
@@ -13,47 +10,37 @@ func fromClangFrameworkCrossImport()
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 1,
key.offset: 0,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 6,
key.offset: 5,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 29,
key.offset: 28,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 32,
key.offset: 31,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 69,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 76,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 95,
key.offset: 68,
key.length: 68
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 163,
key.offset: 136,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 168,
key.offset: 141,
key.length: 29
}
]
@@ -62,7 +49,7 @@ func fromClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromClangFramework()",
key.usr: "c:@F@fromClangFramework",
key.offset: 1,
key.offset: 0,
key.length: 25,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromClangFramework</decl.name>()</decl.function.free>"
},
@@ -70,7 +57,7 @@ func fromClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromClangFrameworkCrossImport()",
key.usr: "s:33_ClangFramework_BystandingLibrary04fromaB11CrossImportyyF",
key.offset: 163,
key.offset: 136,
key.length: 36,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromClangFrameworkCrossImport</decl.name>()</decl.function.free>",
key.required_bystanders: [

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func fromOverlaidClangFramework()
func fromOverlaidClangFrameworkOverlay()
@@ -15,56 +13,46 @@ func fromOverlaidClangFrameworkCrossImport()
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 31,
key.offset: 5,
key.length: 26
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 61,
key.offset: 35,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 66,
key.offset: 40,
key.length: 33
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 104,
key.offset: 78,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 107,
key.offset: 81,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 144,
key.offset: 118,
key.length: 76
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 220,
key.offset: 194,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 225,
key.offset: 199,
key.length: 37
}
]
@@ -73,7 +61,7 @@ func fromOverlaidClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromOverlaidClangFramework()",
key.usr: "c:@F@fromOverlaidClangFramework",
key.offset: 26,
key.offset: 0,
key.length: 33,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromOverlaidClangFramework</decl.name>()</decl.function.free>"
},
@@ -81,7 +69,7 @@ func fromOverlaidClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromOverlaidClangFrameworkOverlay()",
key.usr: "s:22OverlaidClangFramework04fromabC7OverlayyyF",
key.offset: 61,
key.offset: 35,
key.length: 40,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromOverlaidClangFrameworkOverlay</decl.name>()</decl.function.free>"
},
@@ -89,7 +77,7 @@ func fromOverlaidClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromOverlaidClangFrameworkCrossImport()",
key.usr: "s:41_OverlaidClangFramework_BystandingLibrary04fromabC11CrossImportyyF",
key.offset: 220,
key.offset: 194,
key.length: 44,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromOverlaidClangFrameworkCrossImport</decl.name>()</decl.function.free>",
key.required_bystanders: [

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func fromSwiftFramework()
@@ -13,46 +11,36 @@ func fromSwiftFrameworkCrossImport()
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 31,
key.offset: 5,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 54,
key.offset: 28,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 57,
key.offset: 31,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 94,
key.offset: 68,
key.length: 68
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 162,
key.offset: 136,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 167,
key.offset: 141,
key.length: 29
}
]
@@ -61,7 +49,7 @@ func fromSwiftFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromSwiftFramework()",
key.usr: "s:14SwiftFramework04fromaB0yyF",
key.offset: 26,
key.offset: 0,
key.length: 25,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromSwiftFramework</decl.name>()</decl.function.free>"
},
@@ -69,7 +57,7 @@ func fromSwiftFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromSwiftFrameworkCrossImport()",
key.usr: "s:33_SwiftFramework_BystandingLibrary04fromaB11CrossImportyyF",
key.offset: 162,
key.offset: 136,
key.length: 36,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromSwiftFrameworkCrossImport</decl.name>()</decl.function.free>",
key.required_bystanders: [

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func foo(_ callback: (_ myInternalParam: Int) -> Void)
@@ -7,55 +5,45 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void)
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 31,
key.offset: 5,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 35,
key.offset: 9,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 37,
key.offset: 11,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 48,
key.offset: 22,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 50,
key.offset: 24,
key.length: 15
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "Int",
key.usr: "s:Si",
key.offset: 67,
key.offset: 41,
key.length: 3
},
{
key.kind: source.lang.swift.ref.typealias,
key.name: "Void",
key.usr: "s:s4Voida",
key.offset: 75,
key.offset: 49,
key.length: 4
}
]
@@ -64,7 +52,7 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void)
key.kind: source.lang.swift.decl.function.free,
key.name: "foo(_:)",
key.usr: "s:5label3fooyyySiXEF",
key.offset: 26,
key.offset: 0,
key.length: 54,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>foo</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>_</decl.var.parameter.argument_label> <decl.var.parameter.name>callback</decl.var.parameter.name>: <decl.var.parameter.type>(<decl.var.parameter>_ <decl.var.parameter.name>myInternalParam</decl.var.parameter.name>: <decl.var.parameter.type><ref.struct usr=\"s:Si\">Int</ref.struct></decl.var.parameter.type></decl.var.parameter>) -&gt; <decl.function.returntype><ref.typealias usr=\"s:s4Voida\">Void</ref.typealias></decl.function.returntype></decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
key.entities: [
@@ -72,7 +60,7 @@ func foo(_ callback: (_ myInternalParam: Int) -> Void)
key.kind: source.lang.swift.decl.var.local,
key.keyword: "_",
key.name: "callback",
key.offset: 47,
key.offset: 21,
key.length: 32
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
class C<T> {
}
@@ -52,154 +50,164 @@ extension P8 where Self.T : module_with_class_extension.E {
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 32,
key.offset: 6,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 34,
key.offset: 8,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 42,
key.offset: 16,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "C",
key.usr: "s:27module_with_class_extension1CC",
key.offset: 52,
key.offset: 26,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 56,
key.offset: 30,
key.length: 27
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "P8",
key.usr: "s:27module_with_class_extension2P8P",
key.offset: 84,
key.offset: 58,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 92,
key.offset: 66,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "C",
key.usr: "s:27module_with_class_extension1CC",
key.offset: 102,
key.offset: 76,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 104,
key.offset: 78,
key.length: 5
},
{
key.kind: source.lang.swift.ref.generic_type_param,
key.name: "T",
key.usr: "s:27module_with_class_extension1CC1Txmfp",
key.offset: 110,
key.offset: 84,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 114,
key.offset: 88,
key.length: 27
},
{
key.kind: source.lang.swift.ref.class,
key.name: "D",
key.usr: "s:27module_with_class_extension1DC",
key.offset: 142,
key.offset: 116,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 151,
key.offset: 125,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 156,
key.offset: 130,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 167,
key.offset: 141,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 172,
key.offset: 146,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 181,
key.offset: 155,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "C",
key.usr: "s:27module_with_class_extension1CC",
key.offset: 191,
key.offset: 165,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 193,
key.offset: 167,
key.length: 5
},
{
key.kind: source.lang.swift.ref.generic_type_param,
key.name: "T",
key.usr: "s:27module_with_class_extension1CC1Txmfp",
key.offset: 199,
key.offset: 173,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 203,
key.offset: 177,
key.length: 27
},
{
key.kind: source.lang.swift.ref.class,
key.name: "E",
key.usr: "s:27module_with_class_extension1EC",
key.offset: 231,
key.offset: 205,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 240,
key.offset: 214,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 245,
key.offset: 219,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 228,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 234,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 241,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 247,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 254,
@@ -210,213 +218,193 @@ extension P8 where Self.T : module_with_class_extension.E {
key.offset: 260,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 267,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 273,
key.offset: 262,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 280,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 286,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 288,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 291,
key.offset: 265,
key.length: 5
},
{
key.kind: source.lang.swift.ref.generic_type_param,
key.name: "T",
key.usr: "s:27module_with_class_extension1FC1Txmfp",
key.offset: 297,
key.offset: 271,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 301,
key.offset: 275,
key.length: 27
},
{
key.kind: source.lang.swift.ref.class,
key.name: "D",
key.usr: "s:27module_with_class_extension1DC",
key.offset: 329,
key.offset: 303,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 338,
key.offset: 312,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 343,
key.offset: 317,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 352,
key.offset: 326,
key.length: 9
},
{
key.kind: source.lang.swift.ref.class,
key.name: "F",
key.usr: "s:27module_with_class_extension1FC",
key.offset: 362,
key.offset: 336,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 366,
key.offset: 340,
key.length: 27
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "P8",
key.usr: "s:27module_with_class_extension2P8P",
key.offset: 394,
key.offset: 368,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 402,
key.offset: 376,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 411,
key.offset: 385,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 421,
key.offset: 395,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 436,
key.offset: 410,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 441,
key.offset: 415,
key.length: 9
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "P8",
key.usr: "s:27module_with_class_extension2P8P",
key.offset: 451,
key.offset: 425,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 454,
key.offset: 428,
key.length: 5
},
{
key.kind: source.lang.swift.ref.generic_type_param,
key.name: "Self",
key.usr: "s:27module_with_class_extension2P8P4Selfxmfp",
key.offset: 460,
key.offset: 434,
key.length: 4
},
{
key.kind: source.lang.swift.ref.associatedtype,
key.name: "T",
key.usr: "s:27module_with_class_extension2P8P1TQa",
key.offset: 465,
key.offset: 439,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 469,
key.offset: 443,
key.length: 27
},
{
key.kind: source.lang.swift.ref.class,
key.name: "D",
key.usr: "s:27module_with_class_extension1DC",
key.offset: 497,
key.offset: 471,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 506,
key.offset: 480,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 511,
key.offset: 485,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 520,
key.offset: 494,
key.length: 9
},
{
key.kind: source.lang.swift.ref.protocol,
key.name: "P8",
key.usr: "s:27module_with_class_extension2P8P",
key.offset: 530,
key.offset: 504,
key.length: 2
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 533,
key.offset: 507,
key.length: 5
},
{
key.kind: source.lang.swift.ref.generic_type_param,
key.name: "Self",
key.usr: "s:27module_with_class_extension2P8P4Selfxmfp",
key.offset: 539,
key.offset: 513,
key.length: 4
},
{
key.kind: source.lang.swift.ref.associatedtype,
key.name: "T",
key.usr: "s:27module_with_class_extension2P8P1TQa",
key.offset: 544,
key.offset: 518,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 548,
key.offset: 522,
key.length: 27
},
{
key.kind: source.lang.swift.ref.class,
key.name: "E",
key.usr: "s:27module_with_class_extension1EC",
key.offset: 576,
key.offset: 550,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 585,
key.offset: 559,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 590,
key.offset: 564,
key.length: 3
}
]
@@ -430,7 +418,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.name: "T"
}
],
key.offset: 26,
key.offset: 0,
key.length: 14,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>C</decl.name>&lt;<decl.generic_type_param usr=\"s:27module_with_class_extension1CC1Txmfp\"><decl.generic_type_param.name>T</decl.generic_type_param.name></decl.generic_type_param>&gt;</decl.class>"
},
@@ -441,7 +429,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.name: "T"
}
],
key.offset: 42,
key.offset: 16,
key.length: 48,
key.fully_annotated_decl: "<decl.extension.class><syntaxtype.keyword>extension</syntaxtype.keyword> <decl.name><ref.class usr=\"s:27module_with_class_extension1CC\">C</ref.class></decl.name> : <ref.protocol usr=\"s:27module_with_class_extension2P8P\">P8</ref.protocol></decl.extension.class>",
key.conforms: [
@@ -469,7 +457,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "T : D"
}
],
key.offset: 92,
key.offset: 66,
key.length: 87,
key.fully_annotated_decl: "<decl.extension.class><syntaxtype.keyword>extension</syntaxtype.keyword> <decl.name><ref.class usr=\"s:27module_with_class_extension1CC\">C</ref.class></decl.name> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:27module_with_class_extension1CC1Txmfp\">T</ref.generic_type_param> : <ref.class usr=\"s:27module_with_class_extension1DC\">D</ref.class></decl.generic_type_requirement></decl.extension.class>",
key.extends: {
@@ -482,7 +470,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "foo()",
key.usr: "s:27module_with_class_extension1CCA2A1DCRbzlE3fooyyF",
key.offset: 151,
key.offset: 125,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>foo</decl.name>()</decl.function.method.instance>"
},
@@ -491,7 +479,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.name: "bar()",
key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF::SYNTHESIZED::s:27module_with_class_extension1CC",
key.original_usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF",
key.offset: 167,
key.offset: 141,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>bar</decl.name>()</decl.function.method.instance>"
}
@@ -504,7 +492,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "T : E"
}
],
key.offset: 181,
key.offset: 155,
key.length: 71,
key.fully_annotated_decl: "<syntaxtype.keyword>extension</syntaxtype.keyword> <ref.class usr=\"s:27module_with_class_extension1CC\">C</ref.class> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:27module_with_class_extension1CC1Txmfp\">T</ref.generic_type_param> : <ref.class usr=\"s:27module_with_class_extension1EC\">E</ref.class></decl.generic_type_requirement>",
key.extends: {
@@ -518,7 +506,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.name: "baz()",
key.usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF::SYNTHESIZED::s:27module_with_class_extension1CC",
key.original_usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF",
key.offset: 240,
key.offset: 214,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>baz</decl.name>()</decl.function.method.instance>"
}
@@ -528,7 +516,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.class,
key.name: "D",
key.usr: "s:27module_with_class_extension1DC",
key.offset: 254,
key.offset: 228,
key.length: 11,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>D</decl.name></decl.class>"
},
@@ -536,7 +524,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.class,
key.name: "E",
key.usr: "s:27module_with_class_extension1EC",
key.offset: 267,
key.offset: 241,
key.length: 11,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>E</decl.name></decl.class>"
},
@@ -554,7 +542,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "T : D"
}
],
key.offset: 280,
key.offset: 254,
key.length: 70,
key.fully_annotated_decl: "<decl.class><syntaxtype.keyword>class</syntaxtype.keyword> <decl.name>F</decl.name>&lt;<decl.generic_type_param usr=\"s:27module_with_class_extension1FC1Txmfp\"><decl.generic_type_param.name>T</decl.generic_type_param.name></decl.generic_type_param>&gt; <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:27module_with_class_extension1FC1Txmfp\">T</ref.generic_type_param> : <ref.class usr=\"s:27module_with_class_extension1DC\">D</ref.class></decl.generic_type_requirement></decl.class>",
key.entities: [
@@ -563,7 +551,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.name: "bar()",
key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF::SYNTHESIZED::s:27module_with_class_extension1FC",
key.original_usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF",
key.offset: 338,
key.offset: 312,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>bar</decl.name>()</decl.function.method.instance>"
}
@@ -581,7 +569,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "T : D"
}
],
key.offset: 352,
key.offset: 326,
key.length: 48,
key.fully_annotated_decl: "<decl.extension.class><syntaxtype.keyword>extension</syntaxtype.keyword> <decl.name><ref.class usr=\"s:27module_with_class_extension1FC\">F</ref.class></decl.name> : <ref.protocol usr=\"s:27module_with_class_extension2P8P\">P8</ref.protocol></decl.extension.class>",
key.conforms: [
@@ -601,7 +589,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.protocol,
key.name: "P8",
key.usr: "s:27module_with_class_extension2P8P",
key.offset: 402,
key.offset: 376,
key.length: 37,
key.fully_annotated_decl: "<decl.protocol><syntaxtype.keyword>protocol</syntaxtype.keyword> <decl.name>P8</decl.name></decl.protocol>",
key.entities: [
@@ -609,7 +597,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.associatedtype,
key.name: "T",
key.usr: "s:27module_with_class_extension2P8P1TQa",
key.offset: 421,
key.offset: 395,
key.length: 16,
key.fully_annotated_decl: "<decl.associatedtype><syntaxtype.keyword>associatedtype</syntaxtype.keyword> <decl.name>T</decl.name></decl.associatedtype>"
}
@@ -622,7 +610,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "Self.T : D"
}
],
key.offset: 441,
key.offset: 415,
key.length: 77,
key.fully_annotated_decl: "<decl.extension.protocol><syntaxtype.keyword>extension</syntaxtype.keyword> <decl.name><ref.protocol usr=\"s:27module_with_class_extension2P8P\">P8</ref.protocol></decl.name> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:27module_with_class_extension2P8P4Selfxmfp\">Self</ref.generic_type_param>.<ref.associatedtype usr=\"s:27module_with_class_extension2P8P1TQa\">T</ref.associatedtype> : <ref.class usr=\"s:27module_with_class_extension1DC\">D</ref.class></decl.generic_type_requirement></decl.extension.protocol>",
key.extends: {
@@ -635,7 +623,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "bar()",
key.usr: "s:27module_with_class_extension2P8PA2A1DC1TRczrlE3baryyF",
key.offset: 506,
key.offset: 480,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>bar</decl.name>()</decl.function.method.instance>"
}
@@ -648,7 +636,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.description: "Self.T : E"
}
],
key.offset: 520,
key.offset: 494,
key.length: 77,
key.fully_annotated_decl: "<decl.extension.protocol><syntaxtype.keyword>extension</syntaxtype.keyword> <decl.name><ref.protocol usr=\"s:27module_with_class_extension2P8P\">P8</ref.protocol></decl.name> <syntaxtype.keyword>where</syntaxtype.keyword> <decl.generic_type_requirement><ref.generic_type_param usr=\"s:27module_with_class_extension2P8P4Selfxmfp\">Self</ref.generic_type_param>.<ref.associatedtype usr=\"s:27module_with_class_extension2P8P1TQa\">T</ref.associatedtype> : <ref.class usr=\"s:27module_with_class_extension1EC\">E</ref.class></decl.generic_type_requirement></decl.extension.protocol>",
key.extends: {
@@ -661,7 +649,7 @@ extension P8 where Self.T : module_with_class_extension.E {
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "baz()",
key.usr: "s:27module_with_class_extension2P8PA2A1EC1TRczrlE3bazyyF",
key.offset: 585,
key.offset: 559,
key.length: 10,
key.fully_annotated_decl: "<decl.function.method.instance><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>baz</decl.name>()</decl.function.method.instance>"
}

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func fromA()
@@ -30,143 +28,133 @@ func other(x x: A.From_ABAdditionsType)
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 31,
key.offset: 5,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 41,
key.offset: 15,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 44,
key.offset: 18,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 65,
key.offset: 39,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 72,
key.offset: 46,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 75,
key.offset: 49,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 114,
key.offset: 88,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 121,
key.offset: 95,
key.length: 20
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 147,
key.offset: 121,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 186,
key.offset: 160,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 191,
key.offset: 165,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 212,
key.offset: 186,
key.length: 29
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 215,
key.offset: 189,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 242,
key.offset: 216,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 249,
key.offset: 223,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 252,
key.offset: 226,
key.length: 46
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 298,
key.offset: 272,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 303,
key.offset: 277,
key.length: 27
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 334,
key.offset: 308,
key.length: 46
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 380,
key.offset: 354,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 385,
key.offset: 359,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.argument,
key.offset: 391,
key.offset: 365,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.parameter,
key.offset: 393,
key.offset: 367,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 396,
key.offset: 370,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.name: "From_ABAdditionsType",
key.usr: "s:12_ABAdditions05From_A4TypeV",
key.offset: 398,
key.offset: 372,
key.length: 20
}
]
@@ -175,7 +163,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.name: "fromA()",
key.usr: "s:1A5fromAyyF",
key.offset: 26,
key.offset: 0,
key.length: 12,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromA</decl.name>()</decl.function.free>"
},
@@ -183,7 +171,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.struct,
key.name: "From_ABAdditionsType",
key.usr: "s:12_ABAdditions05From_A4TypeV",
key.offset: 114,
key.offset: 88,
key.length: 31,
key.fully_annotated_decl: "<decl.struct><syntaxtype.keyword>struct</syntaxtype.keyword> <decl.name>From_ABAdditionsType</decl.name></decl.struct>",
key.required_bystanders: [
@@ -194,7 +182,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.name: "from_ABAdditions()",
key.usr: "s:12_ABAdditions05from_A0yyF",
key.offset: 186,
key.offset: 160,
key.length: 23,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>from_ABAdditions</decl.name>()</decl.function.free>",
key.required_bystanders: [
@@ -205,7 +193,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.name: "from__ABAdditionsCAdditions()",
key.usr: "s:23__ABAdditionsCAdditions06from__aB0yyF",
key.offset: 298,
key.offset: 272,
key.length: 34,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>from__ABAdditionsCAdditions</decl.name>()</decl.function.free>",
key.required_bystanders: [
@@ -217,7 +205,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.name: "other(x:)",
key.usr: "s:23__ABAdditionsCAdditions5other1xy01_A005From_A4TypeV_tF",
key.offset: 380,
key.offset: 354,
key.length: 39,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>other</decl.name>(<decl.var.parameter><decl.var.parameter.argument_label>x</decl.var.parameter.argument_label>: <decl.var.parameter.type><ref.struct usr=\"s:12_ABAdditions05From_A4TypeV\">From_ABAdditionsType</ref.struct></decl.var.parameter.type></decl.var.parameter>)</decl.function.free>",
key.entities: [
@@ -225,7 +213,7 @@ func other(x x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.var.local,
key.keyword: "x",
key.name: "x",
key.offset: 396,
key.offset: 370,
key.length: 22
}
],

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
func fromOther()
@@ -7,7 +5,6 @@ func fromOther()
import B
import C
import A
// Available when C is imported with Other
func filtered()
@@ -20,91 +17,71 @@ func from_OtherCAdditions()
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 26,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 31,
key.offset: 5,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 45,
key.offset: 19,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 48,
key.offset: 22,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 69,
key.offset: 43,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 76,
key.offset: 50,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 78,
key.offset: 52,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 85,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 87,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 94,
key.offset: 59,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 97,
key.offset: 62,
key.length: 43
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 140,
key.offset: 105,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 145,
key.offset: 110,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 157,
key.offset: 122,
key.length: 43
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 200,
key.offset: 165,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 205,
key.offset: 170,
key.length: 20
}
]
@@ -113,7 +90,7 @@ func from_OtherCAdditions()
key.kind: source.lang.swift.decl.function.free,
key.name: "fromOther()",
key.usr: "s:5Other04fromA0yyF",
key.offset: 26,
key.offset: 0,
key.length: 16,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>fromOther</decl.name>()</decl.function.free>"
},
@@ -121,7 +98,7 @@ func from_OtherCAdditions()
key.kind: source.lang.swift.decl.function.free,
key.name: "filtered()",
key.usr: "s:16_OtherCAdditions8filteredyyF",
key.offset: 140,
key.offset: 105,
key.length: 15,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>filtered</decl.name>()</decl.function.free>",
key.attributes: [
@@ -140,7 +117,7 @@ func from_OtherCAdditions()
key.name: "from_OtherCAdditions()",
key.usr: "s:16_OtherCAdditions05from_aB0yyF",
key.doc.full_as_xml: "<Function><Name>from_OtherCAdditions()</Name><USR>s:16_OtherCAdditions05from_aB0yyF</USR><Declaration>func from_OtherCAdditions()</Declaration><CommentParts><Abstract><Para>This has some interesting documentation that shouldnt be separated from the decl when we print the comment detailing its required bystanders in the generated interface of Other.</Para></Abstract></CommentParts></Function>",
key.offset: 200,
key.offset: 165,
key.length: 27,
key.fully_annotated_decl: "<decl.function.free><syntaxtype.keyword>func</syntaxtype.keyword> <decl.name>from_OtherCAdditions</decl.name>()</decl.function.free>",
key.required_bystanders: [

View File

@@ -31,7 +31,7 @@ var x: FooClassBase
// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN: == -req=cursor -pos=191:67 | %FileCheck -check-prefix=CHECK1 %s
// RUN: == -req=cursor -pos=190:57 | %FileCheck -check-prefix=CHECK1 %s
// The cursor points to 'FooClassBase' inside the list of base classes, see 'gen_clang_module.swift.response'
// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
@@ -47,7 +47,7 @@ var x: FooClassBase
// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN: == -req=cursor -pos=211:20 | %FileCheck -check-prefix=CHECK2 %s
// RUN: == -req=cursor -pos=210:15 | %FileCheck -check-prefix=CHECK2 %s
// The cursor points inside the interface, see 'gen_clang_module.swift.response'
// CHECK2: source.lang.swift.decl.function.method.instance ({{.*}}Foo.framework/Headers/Foo.h:170:10-170:27)
@@ -61,7 +61,7 @@ var x: FooClassBase
// RUN: == -req=find-usr -usr "c:objc(cs)FooClassDerived(im)fooInstanceFunc0" | %FileCheck -check-prefix=CHECK-USR %s
// The returned line:col points inside the interface, see 'gen_clang_module.swift.response'
// CHECK-USR: (211:15-211:33)
// CHECK-USR: (210:15-210:33)
// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN: -target %target-triple %clang-importer-sdk-nosource -I %t \

View File

@@ -1,54 +1,53 @@
public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 13,
key.offset: 12,
key.length: 31
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 45,
key.offset: 44,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 47,
key.offset: 46,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 50,
key.offset: 49,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 60,
key.offset: 59,
key.length: 5
}
]
[
{
key.kind: source.lang.swift.ref.struct,
key.offset: 50,
key.offset: 49,
key.length: 5,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 60,
key.offset: 59,
key.length: 5,
key.is_system: 1
}
@@ -58,14 +57,14 @@ public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fooHelperExplicitFrameworkFunc1(_:)",
key.offset: 8,
key.offset: 7,
key.length: 57,
key.typename: "Int32",
key.nameoffset: 13,
key.nameoffset: 12,
key.namelength: 43,
key.attributes: [
{
key.offset: 1,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -74,7 +73,7 @@ public func fooHelperExplicitFrameworkFunc1(_ a: Int32) -> Int32
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "a",
key.offset: 45,
key.offset: 44,
key.length: 10,
key.typename: "Int32"
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,3 @@
public func fooSubFunc1(_ a: Int32) -> Int32
public struct FooSubEnum1 : Hashable, Equatable, RawRepresentable {
@@ -20,272 +19,272 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 13,
key.offset: 12,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 25,
key.offset: 24,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 27,
key.offset: 26,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 30,
key.offset: 29,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 40,
key.offset: 39,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 47,
key.offset: 46,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 54,
key.offset: 53,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 61,
key.offset: 60,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 75,
key.offset: 74,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 85,
key.offset: 84,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 96,
key.offset: 95,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 120,
key.offset: 119,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 127,
key.offset: 126,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 132,
key.offset: 131,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 134,
key.offset: 133,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 144,
key.offset: 143,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 157,
key.offset: 156,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 164,
key.offset: 163,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 169,
key.offset: 168,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 179,
key.offset: 178,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 192,
key.offset: 191,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 199,
key.offset: 198,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 203,
key.offset: 202,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 213,
key.offset: 212,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 223,
key.offset: 222,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 230,
key.offset: 229,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 234,
key.offset: 233,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 248,
key.offset: 247,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 262,
key.offset: 261,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 269,
key.offset: 268,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 276,
key.offset: 275,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 280,
key.offset: 279,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 294,
key.offset: 293,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 308,
key.offset: 307,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 315,
key.offset: 314,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 322,
key.offset: 321,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 326,
key.offset: 325,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 353,
key.offset: 352,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 359,
key.offset: 358,
key.length: 3
}
]
[
{
key.kind: source.lang.swift.ref.struct,
key.offset: 30,
key.offset: 29,
key.length: 5,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 40,
key.offset: 39,
key.length: 5,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.protocol,
key.offset: 75,
key.offset: 74,
key.length: 8,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.protocol,
key.offset: 85,
key.offset: 84,
key.length: 9,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.protocol,
key.offset: 96,
key.offset: 95,
key.length: 16,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 144,
key.offset: 143,
key.length: 6,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 179,
key.offset: 178,
key.length: 6,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 213,
key.offset: 212,
key.length: 6,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 248,
key.offset: 247,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 294,
key.offset: 293,
key.length: 11
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 353,
key.offset: 352,
key.length: 3,
key.is_system: 1
}
@@ -295,14 +294,14 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fooSubFunc1(_:)",
key.offset: 8,
key.offset: 7,
key.length: 37,
key.typename: "Int32",
key.nameoffset: 13,
key.nameoffset: 12,
key.namelength: 23,
key.attributes: [
{
key.offset: 1,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -311,7 +310,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "a",
key.offset: 25,
key.offset: 24,
key.length: 10,
key.typename: "Int32"
}
@@ -321,11 +320,11 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.struct,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "FooSubEnum1",
key.offset: 54,
key.offset: 53,
key.length: 167,
key.nameoffset: 61,
key.nameoffset: 60,
key.namelength: 11,
key.bodyoffset: 114,
key.bodyoffset: 113,
key.bodylength: 106,
key.inheritedtypes: [
{
@@ -340,7 +339,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
],
key.attributes: [
{
key.offset: 47,
key.offset: 46,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -348,17 +347,17 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.elements: [
{
key.kind: source.lang.swift.structure.elem.typeref,
key.offset: 75,
key.offset: 74,
key.length: 8
},
{
key.kind: source.lang.swift.structure.elem.typeref,
key.offset: 85,
key.offset: 84,
key.length: 9
},
{
key.kind: source.lang.swift.structure.elem.typeref,
key.offset: 96,
key.offset: 95,
key.length: 16
}
],
@@ -367,13 +366,13 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "init(_:)",
key.offset: 127,
key.offset: 126,
key.length: 24,
key.nameoffset: 127,
key.nameoffset: 126,
key.namelength: 24,
key.attributes: [
{
key.offset: 120,
key.offset: 119,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -382,7 +381,7 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "rawValue",
key.offset: 132,
key.offset: 131,
key.length: 18,
key.typename: "UInt32"
}
@@ -392,13 +391,13 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "init(rawValue:)",
key.offset: 164,
key.offset: 163,
key.length: 22,
key.nameoffset: 164,
key.nameoffset: 163,
key.namelength: 22,
key.attributes: [
{
key.offset: 157,
key.offset: 156,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -407,10 +406,10 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "rawValue",
key.offset: 169,
key.offset: 168,
key.length: 16,
key.typename: "UInt32",
key.nameoffset: 169,
key.nameoffset: 168,
key.namelength: 8
}
]
@@ -420,14 +419,14 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.accessibility: source.lang.swift.accessibility.public,
key.setter_accessibility: source.lang.swift.accessibility.public,
key.name: "rawValue",
key.offset: 199,
key.offset: 198,
key.length: 20,
key.typename: "UInt32",
key.nameoffset: 203,
key.nameoffset: 202,
key.namelength: 8,
key.attributes: [
{
key.offset: 192,
key.offset: 191,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -439,16 +438,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "FooSubEnum1X",
key.offset: 230,
key.offset: 229,
key.length: 37,
key.typename: "FooSubEnum1",
key.nameoffset: 234,
key.nameoffset: 233,
key.namelength: 12,
key.bodyoffset: 261,
key.bodyoffset: 260,
key.bodylength: 5,
key.attributes: [
{
key.offset: 223,
key.offset: 222,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -458,16 +457,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "FooSubEnum1Y",
key.offset: 276,
key.offset: 275,
key.length: 37,
key.typename: "FooSubEnum1",
key.nameoffset: 280,
key.nameoffset: 279,
key.namelength: 12,
key.bodyoffset: 307,
key.bodyoffset: 306,
key.bodylength: 5,
key.attributes: [
{
key.offset: 269,
key.offset: 268,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -477,16 +476,16 @@ public var FooSubUnnamedEnumeratorA1: Int { get }
key.kind: source.lang.swift.decl.var.global,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "FooSubUnnamedEnumeratorA1",
key.offset: 322,
key.offset: 321,
key.length: 42,
key.typename: "Int",
key.nameoffset: 326,
key.nameoffset: 325,
key.namelength: 25,
key.bodyoffset: 358,
key.bodyoffset: 357,
key.bodylength: 5,
key.attributes: [
{
key.offset: 315,
key.offset: 314,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -0,0 +1,97 @@
// RUN: %empty-directory(%t)
// RUN: split-file %s %t --leading-lines
// RUN: %target-swift-frontend %t/common.swift -sdk %t/sdk \
// RUN: -module-name Common \
// RUN: -emit-module-path %t/sdk/Common.swiftmodule \
// RUN: -emit-module-interface-path %t/sdk/Common.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6
// RUN: %target-swift-frontend %t/subimpl.swift -sdk %t/sdk -I %t/sdk \
// RUN: -module-name SubImpl \
// RUN: -emit-module-path %t/sdk/SubImpl.swiftmodule \
// RUN: -emit-module-interface-path %t/sdk/SubImpl.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6
//
// RUN: %target-swift-frontend %t/modimpl.swift -sdk %t/sdk -I %t/sdk \
// RUN: -module-name ModImpl \
// RUN: -emit-module-path %t/sdk/ModImpl.swiftmodule \
// RUN: -emit-module-interface-path %t/sdk/ModImpl.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6 \
// RUN: -public-module-name PubMod
// RUN: %target-swift-frontend %t/mod.swift -sdk %t/sdk -I %t/sdk \
// RUN: -module-name PubMod \
// RUN: -emit-module-path %t/sdk/PubMod.swiftmodule \
// RUN: -emit-module-interface-path %t/sdk/PubMod.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6
// RUN: %sourcekitd-test -req=interface-gen -module PubMod -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple &> %t/PubMod.generatedinterface
// RUN: %FileCheck -input-file=%t/PubMod.generatedinterface -check-prefix INTERFACE %s
// Cursor info on the type of `ModTy.member2`, ie. `ImplTy` (see the generated `PubMod.generatedinterface`)
// RUN: %sourcekitd-test -req=interface-gen-open -module PubMod -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple \
// RUN: == -req=cursor -pos=13:24 | %FileCheck %s --check-prefix=INTERFACE-DEF
// INTERFACE-DEF: ImplTy
// INTERFACE-DEF: PubMod
//--- common.swift
public struct CommonType {}
//--- subimpl.swift
public struct SubImplTy {}
//--- modimpl.swift
import struct Common.CommonType
import SubImpl
public struct ImplTy {
public let member: SubImplTy
public let member2: SubImpl.SubImplTy
}
public func fromModImpl(arg: ImplTy, arg2: ModImpl.ImplTy) {}
//--- mod.swift
@_exported import ModImpl
import struct Common.CommonType
public struct ModTy {
public let member: ImplTy
public let member2: ModImpl.ImplTy
}
public func fromMod(arg: ModTy, arg2: PubMod.ModTy) {}
// INTERFACE-NOT: import ModImpl
// INTERFACE: import struct Common.CommonType
// INTERFACE: import SubImpl
// INTERFACE-NOT: import
// INTERFACE: struct ImplTy
// INTERFACE: let member: SubImplTy
// INTERFACE: let member2: SubImplTy
// INTERFACE: struct ModTy
// INTERFACE: let member: ImplTy
// INTERFACE: let member2: ImplTy
// INTERFACE: func fromMod(arg: ModTy, arg2: ModTy)
// INTERFACE: func fromModImpl(arg: ImplTy, arg2: ImplTy)
//--- use.swift
import PubMod
func test() {
// RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 %t/use.swift -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple %t/use.swift | %FileCheck -check-prefix=MOD %s
fromMod()
// MOD: fromMod
// MOD: PubMod
// RUN: %sourcekitd-test -req=cursor -pos=%(line+1):3 %t/use.swift -- -swift-version 6 -sdk %t/sdk -I %t/sdk -target %target-triple %t/use.swift | %FileCheck -check-prefix=MODIMPL %s
fromModImpl()
// MODIMPL: fromModImpl
// MODIMPL: PubMod
}

View File

@@ -1,4 +1,3 @@
public class MyClass {
public func pub_method()
@@ -18,104 +17,104 @@ public func pub_function() -> Int
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.offset: 7,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 14,
key.offset: 13,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 29,
key.offset: 28,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 36,
key.offset: 35,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 41,
key.offset: 40,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 59,
key.offset: 58,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 69,
key.offset: 68,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 76,
key.offset: 75,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 85,
key.offset: 84,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 93,
key.offset: 92,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 107,
key.offset: 106,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 122,
key.offset: 121,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 131,
key.offset: 130,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 150,
key.offset: 149,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 157,
key.offset: 156,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 162,
key.offset: 161,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 180,
key.offset: 179,
key.length: 3
}
]
[
{
key.kind: source.lang.swift.ref.associatedtype,
key.offset: 93,
key.offset: 92,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 180,
key.offset: 179,
key.length: 3,
key.is_system: 1
}
@@ -125,15 +124,15 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.class,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "MyClass",
key.offset: 8,
key.offset: 7,
key.length: 59,
key.nameoffset: 14,
key.nameoffset: 13,
key.namelength: 7,
key.bodyoffset: 23,
key.bodyoffset: 22,
key.bodylength: 43,
key.attributes: [
{
key.offset: 1,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -143,13 +142,13 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_method()",
key.offset: 36,
key.offset: 35,
key.length: 17,
key.nameoffset: 41,
key.nameoffset: 40,
key.namelength: 12,
key.attributes: [
{
key.offset: 29,
key.offset: 28,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -161,15 +160,15 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.protocol,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "MyProto",
key.offset: 76,
key.offset: 75,
key.length: 53,
key.nameoffset: 85,
key.nameoffset: 84,
key.namelength: 7,
key.bodyoffset: 101,
key.bodyoffset: 100,
key.bodylength: 27,
key.attributes: [
{
key.offset: 69,
key.offset: 68,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -179,9 +178,9 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.associatedtype,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "Assoc",
key.offset: 107,
key.offset: 106,
key.length: 20,
key.nameoffset: 122,
key.nameoffset: 121,
key.namelength: 5
}
]
@@ -190,19 +189,19 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_function()",
key.offset: 157,
key.offset: 156,
key.length: 26,
key.typename: "Int",
key.nameoffset: 162,
key.nameoffset: 161,
key.namelength: 14,
key.attributes: [
{
key.offset: 150,
key.offset: 149,
key.length: 6,
key.attribute: source.decl.attribute.public
},
{
key.offset: 131,
key.offset: 130,
key.length: 18,
key.attribute: source.decl.attribute.discardableResult
}

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public class MyClass {
public func pub_method()
@@ -16,116 +14,100 @@ public func pub_function() -> Int
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 39,
key.offset: 13,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 54,
key.offset: 28,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 61,
key.offset: 35,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 66,
key.offset: 40,
key.length: 10
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 82,
key.offset: 56,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 89,
key.offset: 63,
key.length: 8
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 98,
key.offset: 72,
key.length: 7
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 106,
key.offset: 80,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 120,
key.offset: 94,
key.length: 14
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 135,
key.offset: 109,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 144,
key.offset: 118,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 163,
key.offset: 137,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 170,
key.offset: 144,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 175,
key.offset: 149,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 193,
key.offset: 167,
key.length: 3
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.associatedtype,
key.offset: 106,
key.offset: 80,
key.length: 5
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 193,
key.offset: 167,
key.length: 3,
key.is_system: 1
}
@@ -135,15 +117,15 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.class,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "MyClass",
key.offset: 33,
key.offset: 7,
key.length: 47,
key.nameoffset: 39,
key.nameoffset: 13,
key.namelength: 7,
key.bodyoffset: 48,
key.bodyoffset: 22,
key.bodylength: 31,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -153,13 +135,13 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_method()",
key.offset: 61,
key.offset: 35,
key.length: 17,
key.nameoffset: 66,
key.nameoffset: 40,
key.namelength: 12,
key.attributes: [
{
key.offset: 54,
key.offset: 28,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -171,15 +153,15 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.protocol,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "MyProto",
key.offset: 89,
key.offset: 63,
key.length: 53,
key.nameoffset: 98,
key.nameoffset: 72,
key.namelength: 7,
key.bodyoffset: 114,
key.bodyoffset: 88,
key.bodylength: 27,
key.attributes: [
{
key.offset: 82,
key.offset: 56,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -189,9 +171,9 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.associatedtype,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "Assoc",
key.offset: 120,
key.offset: 94,
key.length: 20,
key.nameoffset: 135,
key.nameoffset: 109,
key.namelength: 5
}
]
@@ -200,19 +182,19 @@ public func pub_function() -> Int
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "pub_function()",
key.offset: 170,
key.offset: 144,
key.length: 26,
key.typename: "Int",
key.nameoffset: 175,
key.nameoffset: 149,
key.namelength: 14,
key.attributes: [
{
key.offset: 163,
key.offset: 137,
key.length: 6,
key.attribute: source.decl.attribute.public
},
{
key.offset: 144,
key.offset: 118,
key.length: 18,
key.attribute: source.decl.attribute.discardableResult
}

View File

@@ -9,7 +9,7 @@
// Make sure cursor info within the generated interface of A on one of the
// decls originally from a cross-import decls shows 'A' as the parent module.
//
// RUN: %sourcekitd-test -req=interface-gen-open -module A -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %S/../Inputs/CrossImport -module-cache-path %t.mod/mcp == -req=cursor -print-raw-response -pos=11:15 -- -I %S/../Inputs/CrossImport -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %sourcekitd-test -req=interface-gen-open -module A -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %S/../Inputs/CrossImport -module-cache-path %t.mod/mcp == -req=cursor -print-raw-response -pos=9:15 -- -I %S/../Inputs/CrossImport -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %FileCheck --input-file %t.response %s
//
// CHECK: key.name: "From_ABAdditionsType"

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public func fromA()
@@ -28,191 +26,175 @@ public func other(x: A.From_ABAdditionsType)
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 38,
key.offset: 12,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 48,
key.offset: 22,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 51,
key.offset: 25,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 72,
key.offset: 46,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 79,
key.offset: 53,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 82,
key.offset: 56,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 121,
key.offset: 95,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 128,
key.offset: 102,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 135,
key.offset: 109,
key.length: 20
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 161,
key.offset: 135,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 200,
key.offset: 174,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 207,
key.offset: 181,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 212,
key.offset: 186,
key.length: 16
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 233,
key.offset: 207,
key.length: 29
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 236,
key.offset: 210,
key.length: 25
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 263,
key.offset: 237,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 270,
key.offset: 244,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 273,
key.offset: 247,
key.length: 46
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 319,
key.offset: 293,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 326,
key.offset: 300,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 331,
key.offset: 305,
key.length: 27
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 362,
key.offset: 336,
key.length: 46
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 408,
key.offset: 382,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 415,
key.offset: 389,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 420,
key.offset: 394,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 426,
key.offset: 400,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 429,
key.offset: 403,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 431,
key.offset: 405,
key.length: 20
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 79,
key.offset: 53,
key.length: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 270,
key.offset: 244,
key.length: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 429,
key.offset: 403,
key.length: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 431,
key.offset: 405,
key.length: 20
}
]
@@ -221,13 +203,13 @@ public func other(x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromA()",
key.offset: 33,
key.offset: 7,
key.length: 12,
key.nameoffset: 38,
key.nameoffset: 12,
key.namelength: 7,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -237,15 +219,15 @@ public func other(x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.struct,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "From_ABAdditionsType",
key.offset: 128,
key.offset: 102,
key.length: 31,
key.nameoffset: 135,
key.nameoffset: 109,
key.namelength: 20,
key.bodyoffset: 157,
key.bodyoffset: 131,
key.bodylength: 1,
key.attributes: [
{
key.offset: 121,
key.offset: 95,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -255,13 +237,13 @@ public func other(x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "from_ABAdditions()",
key.offset: 207,
key.offset: 181,
key.length: 23,
key.nameoffset: 212,
key.nameoffset: 186,
key.namelength: 18,
key.attributes: [
{
key.offset: 200,
key.offset: 174,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -271,13 +253,13 @@ public func other(x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "from__ABAdditionsCAdditions()",
key.offset: 326,
key.offset: 300,
key.length: 34,
key.nameoffset: 331,
key.nameoffset: 305,
key.namelength: 29,
key.attributes: [
{
key.offset: 319,
key.offset: 293,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -287,13 +269,13 @@ public func other(x: A.From_ABAdditionsType)
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "other(x:)",
key.offset: 415,
key.offset: 389,
key.length: 37,
key.nameoffset: 420,
key.nameoffset: 394,
key.namelength: 32,
key.attributes: [
{
key.offset: 408,
key.offset: 382,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -302,10 +284,10 @@ public func other(x: A.From_ABAdditionsType)
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "x",
key.offset: 426,
key.offset: 400,
key.length: 25,
key.typename: "A.From_ABAdditionsType",
key.nameoffset: 426,
key.nameoffset: 400,
key.namelength: 1
}
]

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public func fromOther()
@@ -7,7 +5,6 @@ public func fromOther()
import B
import C
import A
// Available when C is imported with Other
/// This has some interesting documentation that shouldn't be separated from
@@ -18,126 +15,95 @@ public func from_OtherCAdditions()
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 38,
key.offset: 12,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 52,
key.offset: 26,
key.length: 23
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 55,
key.offset: 29,
key.length: 19
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 76,
key.offset: 50,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 83,
key.offset: 57,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 85,
key.offset: 59,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 92,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 94,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 101,
key.offset: 66,
key.length: 1
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 104,
key.offset: 69,
key.length: 43
},
{
key.kind: source.lang.swift.syntaxtype.doccomment,
key.offset: 147,
key.offset: 112,
key.length: 77
},
{
key.kind: source.lang.swift.syntaxtype.doccomment,
key.offset: 224,
key.offset: 189,
key.length: 80
},
{
key.kind: source.lang.swift.syntaxtype.doccomment,
key.offset: 304,
key.offset: 269,
key.length: 36
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 340,
key.offset: 305,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 347,
key.offset: 312,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 352,
key.offset: 317,
key.length: 20
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 83,
key.offset: 57,
key.length: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 92,
key.length: 1
},
{
key.kind: source.lang.swift.ref.module,
key.offset: 101,
key.offset: 66,
key.length: 1
}
]
@@ -146,13 +112,13 @@ public func from_OtherCAdditions()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromOther()",
key.offset: 33,
key.offset: 7,
key.length: 16,
key.nameoffset: 38,
key.nameoffset: 12,
key.namelength: 11,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -162,15 +128,15 @@ public func from_OtherCAdditions()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "from_OtherCAdditions()",
key.offset: 347,
key.offset: 312,
key.length: 27,
key.nameoffset: 352,
key.nameoffset: 317,
key.namelength: 22,
key.docoffset: 147,
key.docoffset: 112,
key.doclength: 193,
key.attributes: [
{
key.offset: 340,
key.offset: 305,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -12,7 +12,7 @@
// Make sure cursor info within the generated interface of SwiftFramework on one of the
// decls originally from a cross-import decls shows 'SwiftFramework' as the parent module.
//
// RUN: %sourcekitd-test -req=interface-gen-open -module SwiftFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=9:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %sourcekitd-test -req=interface-gen-open -module SwiftFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=7:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %FileCheck --input-file %t.response --check-prefix=CHECKSWIFT %s
//
// CHECKSWIFT: key.name: "fromSwiftFrameworkCrossImport()"
@@ -27,7 +27,7 @@
// Make sure cursor info within the generated interface of ClangFramework on one of the
// decls originally from a cross-import decls shows 'ClangFramework' as the parent module.
//
// RUN: %sourcekitd-test -req=interface-gen-open -module ClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=10:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %sourcekitd-test -req=interface-gen-open -module ClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=7:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %FileCheck --input-file %t.response --check-prefix=CHECKCLANG %s
//
// CHECKCLANG: key.name: "fromClangFrameworkCrossImport()"
@@ -42,7 +42,7 @@
// Make sure cursor info within the generated interface of OverlaidClangFramework on one of the
// decls originally from a cross-import decls shows 'OverlaidClangFramework' as the parent module.
//
// RUN: %sourcekitd-test -req=interface-gen-open -module OverlaidClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=11:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %sourcekitd-test -req=interface-gen-open -module OverlaidClangFramework -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -module-cache-path %t/mcp == -req=cursor -print-raw-response -pos=9:13 -- -target %target-triple -I %t/include -I %t/lib/swift -F %t/Frameworks -Xfrontend -enable-cross-import-overlays > %t.response
// RUN: %FileCheck --input-file %t.response --check-prefix=CHECKOVERLAIDCLANG %s
//
// CHECKOVERLAIDCLANG: key.name: "fromOverlaidClangFrameworkCrossImport()"

View File

@@ -1,11 +1,8 @@
public func fromClangFramework()
// MARK: - BystandingLibrary Additions
import SwiftOnoneSupport
// Available when BystandingLibrary is imported with ClangFramework
public func fromClangFrameworkCrossImport()
@@ -13,80 +10,63 @@ public func fromClangFrameworkCrossImport()
[
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 1,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 8,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 13,
key.offset: 12,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 36,
key.offset: 35,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 39,
key.offset: 38,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 76,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 83,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 102,
key.offset: 75,
key.length: 68
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 170,
key.offset: 143,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 177,
key.offset: 150,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 182,
key.offset: 155,
key.length: 29
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 83,
key.length: 17,
key.is_system: 1
}
]
<<NULL>>
[
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromClangFramework()",
key.offset: 8,
key.offset: 7,
key.length: 25,
key.nameoffset: 13,
key.nameoffset: 12,
key.namelength: 20,
key.attributes: [
{
key.offset: 1,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -96,13 +76,13 @@ public func fromClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromClangFrameworkCrossImport()",
key.offset: 177,
key.offset: 150,
key.length: 36,
key.nameoffset: 182,
key.nameoffset: 155,
key.namelength: 31,
key.attributes: [
{
key.offset: 170,
key.offset: 143,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public func fromOverlaidClangFramework()
public func fromOverlaidClangFrameworkOverlay()
@@ -13,96 +11,79 @@ public func fromOverlaidClangFrameworkCrossImport()
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 38,
key.offset: 12,
key.length: 26
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 68,
key.offset: 42,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 75,
key.offset: 49,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 80,
key.offset: 54,
key.length: 33
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 118,
key.offset: 92,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 121,
key.offset: 95,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 158,
key.offset: 132,
key.length: 76
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 234,
key.offset: 208,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 241,
key.offset: 215,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 246,
key.offset: 220,
key.length: 37
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
}
]
<<NULL>>
[
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromOverlaidClangFramework()",
key.offset: 33,
key.offset: 7,
key.length: 33,
key.nameoffset: 38,
key.nameoffset: 12,
key.namelength: 28,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -112,13 +93,13 @@ public func fromOverlaidClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromOverlaidClangFrameworkOverlay()",
key.offset: 75,
key.offset: 49,
key.length: 40,
key.nameoffset: 80,
key.nameoffset: 54,
key.namelength: 35,
key.attributes: [
{
key.offset: 68,
key.offset: 42,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -128,13 +109,13 @@ public func fromOverlaidClangFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromOverlaidClangFrameworkCrossImport()",
key.offset: 241,
key.offset: 215,
key.length: 44,
key.nameoffset: 246,
key.nameoffset: 220,
key.namelength: 39,
key.attributes: [
{
key.offset: 234,
key.offset: 208,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public func fromSwiftFramework()
@@ -11,81 +9,64 @@ public func fromSwiftFrameworkCrossImport()
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 38,
key.offset: 12,
key.length: 18
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 61,
key.offset: 35,
key.length: 39
},
{
key.kind: source.lang.swift.syntaxtype.comment.mark,
key.offset: 64,
key.offset: 38,
key.length: 35
},
{
key.kind: source.lang.swift.syntaxtype.comment,
key.offset: 101,
key.offset: 75,
key.length: 68
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 169,
key.offset: 143,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 176,
key.offset: 150,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 181,
key.offset: 155,
key.length: 29
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
}
]
<<NULL>>
[
{
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromSwiftFramework()",
key.offset: 33,
key.offset: 7,
key.length: 25,
key.nameoffset: 38,
key.nameoffset: 12,
key.namelength: 20,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -95,13 +76,13 @@ public func fromSwiftFrameworkCrossImport()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "fromSwiftFrameworkCrossImport()",
key.offset: 176,
key.offset: 150,
key.length: 36,
key.nameoffset: 181,
key.nameoffset: 155,
key.namelength: 31,
key.attributes: [
{
key.offset: 169,
key.offset: 143,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -1,5 +1,3 @@
import SwiftOnoneSupport
public class PublicClass {
}
@@ -17,148 +15,132 @@ public func publicFunc()
[
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 0,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 7,
key.length: 17
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 26,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 33,
key.offset: 7,
key.length: 5
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 39,
key.offset: 13,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 56,
key.offset: 30,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 63,
key.offset: 37,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 70,
key.offset: 44,
key.length: 9
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 87,
key.offset: 61,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 94,
key.offset: 68,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 98,
key.offset: 72,
key.length: 11
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 111,
key.offset: 85,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 117,
key.offset: 91,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 128,
key.offset: 102,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 135,
key.offset: 109,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 140,
key.offset: 114,
key.length: 12
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 158,
key.offset: 132,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 167,
key.offset: 141,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 174,
key.offset: 148,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 179,
key.offset: 153,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.typeidentifier,
key.offset: 187,
key.offset: 161,
key.length: 3
},
{
key.kind: source.lang.swift.syntaxtype.attribute.builtin,
key.offset: 195,
key.offset: 169,
key.length: 6
},
{
key.kind: source.lang.swift.syntaxtype.keyword,
key.offset: 202,
key.offset: 176,
key.length: 4
},
{
key.kind: source.lang.swift.syntaxtype.identifier,
key.offset: 207,
key.offset: 181,
key.length: 10
}
]
[
{
key.kind: source.lang.swift.ref.module,
key.offset: 7,
key.length: 17,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 111,
key.offset: 85,
key.length: 3,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 158,
key.offset: 132,
key.length: 3,
key.is_system: 1
},
{
key.kind: source.lang.swift.ref.struct,
key.offset: 187,
key.offset: 161,
key.length: 3,
key.is_system: 1
}
@@ -168,15 +150,15 @@ public func publicFunc()
key.kind: source.lang.swift.decl.class,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "PublicClass",
key.offset: 33,
key.offset: 7,
key.length: 21,
key.nameoffset: 39,
key.nameoffset: 13,
key.namelength: 11,
key.bodyoffset: 52,
key.bodyoffset: 26,
key.bodylength: 1,
key.attributes: [
{
key.offset: 26,
key.offset: 0,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -186,15 +168,15 @@ public func publicFunc()
key.kind: source.lang.swift.decl.struct,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "SomeValue",
key.offset: 63,
key.offset: 37,
key.length: 130,
key.nameoffset: 70,
key.nameoffset: 44,
key.namelength: 9,
key.bodyoffset: 81,
key.bodyoffset: 55,
key.bodylength: 111,
key.attributes: [
{
key.offset: 56,
key.offset: 30,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -204,16 +186,16 @@ public func publicFunc()
key.kind: source.lang.swift.decl.var.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "publicValue",
key.offset: 94,
key.offset: 68,
key.length: 28,
key.typename: "Int",
key.nameoffset: 98,
key.nameoffset: 72,
key.namelength: 11,
key.bodyoffset: 116,
key.bodyoffset: 90,
key.bodylength: 5,
key.attributes: [
{
key.offset: 87,
key.offset: 61,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -223,14 +205,14 @@ public func publicFunc()
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "publicMethod()",
key.offset: 135,
key.offset: 109,
key.length: 26,
key.typename: "Int",
key.nameoffset: 140,
key.nameoffset: 114,
key.namelength: 14,
key.attributes: [
{
key.offset: 128,
key.offset: 102,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -240,13 +222,13 @@ public func publicFunc()
key.kind: source.lang.swift.decl.function.method.instance,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "init(public:)",
key.offset: 174,
key.offset: 148,
key.length: 17,
key.nameoffset: 174,
key.nameoffset: 148,
key.namelength: 17,
key.attributes: [
{
key.offset: 167,
key.offset: 141,
key.length: 6,
key.attribute: source.decl.attribute.public
}
@@ -255,10 +237,10 @@ public func publicFunc()
{
key.kind: source.lang.swift.decl.var.parameter,
key.name: "public",
key.offset: 179,
key.offset: 153,
key.length: 11,
key.typename: "Int",
key.nameoffset: 179,
key.nameoffset: 153,
key.namelength: 6
}
]
@@ -269,13 +251,13 @@ public func publicFunc()
key.kind: source.lang.swift.decl.function.free,
key.accessibility: source.lang.swift.accessibility.public,
key.name: "publicFunc()",
key.offset: 202,
key.offset: 176,
key.length: 17,
key.nameoffset: 207,
key.nameoffset: 181,
key.namelength: 12,
key.attributes: [
{
key.offset: 195,
key.offset: 169,
key.length: 6,
key.attribute: source.decl.attribute.public
}

View File

@@ -387,8 +387,11 @@ static bool getModuleInterfaceInfo(
Options.SkipInlineCXXNamespace = true;
}
}
// Skip submodules but include any exported modules that have the same public
// module name as this module.
ModuleTraversalOptions TraversalOptions =
std::nullopt; // Don't print submodules.
ModuleTraversal::VisitMatchingExported;
SmallString<128> Text;
llvm::raw_svector_ostream OS(Text);
AnnotatingPrinter Printer(Info, OS);

View File

@@ -764,7 +764,8 @@ static StringRef getModuleName(const ValueDecl *VD,
// overlay's declaring module as the owning module.
if (ModuleDecl *Declaring = MD->getDeclaringModuleIfCrossImportOverlay())
MD = Declaring;
return MD->getNameStr();
return MD->getPublicModuleName(/*onlyIfImported=*/false).str();
}
struct DeclInfo {