Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/SymbolGraphGen/SymbolGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ PrintOptions SymbolGraph::getDeclarationFragmentsPrintOptions() const {
ExcludeAttrs.insert(std::make_pair("DAK_Postfix", DAK_Postfix));
ExcludeAttrs.insert(std::make_pair("DAK_Infix", DAK_Infix));

// In "emit modules separately" jobs, access modifiers show up as attributes,
// but we don't want them to be printed in declarations
ExcludeAttrs.insert(std::make_pair("DAK_AccessControl", DAK_AccessControl));

for (const auto &Entry : ExcludeAttrs) {
Opts.ExcludeAttrList.push_back(Entry.getValue());
}
Expand Down
9 changes: 0 additions & 9 deletions test/SourceKit/CursorInfo/cursor_symbol_graph.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,6 @@ enum MyEnum {
// CHECKY: "symbols": [
// CHECKY: {
// CHECKY: "accessLevel": "private",
// CHECKY: "declarationFragments": [
// CHECKY: {
// CHECKY: "kind": "keyword",
// CHECKY: "spelling": "private"
// CHECKY: },
// CHECKY: {
// CHECKY: "kind": "text",
// CHECKY: "spelling": " "
// CHECKY: },
// CHECKY: {
// CHECKY: "kind": "keyword",
// CHECKY: "spelling": "var"
Expand Down
16 changes: 0 additions & 16 deletions test/SourceKit/CursorInfo/cursor_symbol_graph_referenced.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,6 @@ extension Parent {
// PRIVATE: "declarationFragments": [
// PRIVATE-NEXT: {
// PRIVATE-NEXT: "kind": "keyword",
// PRIVATE-NEXT: "spelling": "private"
// PRIVATE-NEXT: },
// PRIVATE-NEXT: {
// PRIVATE-NEXT: "kind": "text",
// PRIVATE-NEXT: "spelling": " "
// PRIVATE-NEXT: },
// PRIVATE-NEXT: {
// PRIVATE-NEXT: "kind": "keyword",
// PRIVATE-NEXT: "spelling": "func"
// PRIVATE-NEXT: },
// PRIVATE-NEXT: {
Expand Down Expand Up @@ -302,14 +294,6 @@ extension Parent {
// SPI: "declarationFragments": [
// SPI-NEXT: {
// SPI-NEXT: "kind": "keyword",
// SPI-NEXT: "spelling": "internal"
// SPI-NEXT: },
// SPI-NEXT: {
// SPI-NEXT: "kind": "text",
// SPI-NEXT: "spelling": " "
// SPI-NEXT: },
// SPI-NEXT: {
// SPI-NEXT: "kind": "keyword",
// SPI-NEXT: "spelling": "func"
// SPI-NEXT: },
// SPI-NEXT: {
Expand Down
26 changes: 26 additions & 0 deletions test/SymbolGraph/ClangImporter/EmitWhileBuilding.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// RUN: %empty-directory(%t)
// RUN: cp -r %S/Inputs/EmitWhileBuilding/EmitWhileBuilding.framework %t
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %s -emit-symbol-graph -emit-symbol-graph-dir %t
// RUN: %{python} -m json.tool %t/EmitWhileBuilding.symbols.json %t/EmitWhileBuilding.formatted.symbols.json
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.formatted.symbols.json

// REQUIRES: objc_interop

import Foundation

public enum SwiftEnum {}

// CHECK: "declarationFragments": [
// CHECK-NEXT: {
// CHECK-NEXT: "kind": "keyword",
// CHECK-NEXT: "spelling": "enum"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "kind": "text",
// CHECK-NEXT: "spelling": " "
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT: "kind": "identifier",
// CHECK-NEXT: "spelling": "SwiftEnum"
// CHECK-NEXT: }
// CHECK-NEXT: ],
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
double testVariable = 1.0;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
framework module EmitWhileBuilding {
header "EmitWhileBuilding.h"
export *
}