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
2 changes: 1 addition & 1 deletion Sources/IndexStoreDB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_library(IndexStoreDB
Symbol.swift)
set_target_properties(IndexStoreDB PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/swift")
target_link_libraries(IndexStoreDB PRIVATE
Foundation
CIndexStoreDB)
Expand Down
7 changes: 4 additions & 3 deletions Sources/IndexStoreDB/IndexStoreDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

// For `strdup`
Expand All @@ -25,7 +26,7 @@ import Darwin.POSIX
public final class IndexStoreDB {

let delegate: IndexDelegate?
let impl: indexstoredb_index_t
let impl: UnsafeMutableRawPointer // indexstoredb_index_t

/// Create or open an IndexStoreDB at the givin `databasePath`.
///
Expand All @@ -51,7 +52,7 @@ public final class IndexStoreDB {
) throws {
self.delegate = delegate

let libProviderFunc = { (cpath: UnsafePointer<Int8>) -> indexstoredb_indexstore_library_t? in
let libProviderFunc: indexstore_library_provider_t = { (cpath: UnsafePointer<Int8>) -> indexstoredb_indexstore_library_t? in
return library?.library
}

Expand Down Expand Up @@ -294,7 +295,7 @@ public protocol IndexStoreLibraryProvider {
}

public class IndexStoreLibrary {
let library: indexstoredb_indexstore_library_t
let library: UnsafeMutableRawPointer // indexstoredb_indexstore_library_t

public init(dylibPath: String) throws {
var error: indexstoredb_error_t? = nil
Expand Down
2 changes: 2 additions & 0 deletions Sources/IndexStoreDB/IndexStoreDBError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

import protocol Foundation.LocalizedError

public enum IndexStoreDBError: Error {
Expand Down
1 change: 1 addition & 0 deletions Sources/IndexStoreDB/Symbol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

public enum IndexSymbolKind: Hashable {
Expand Down
3 changes: 2 additions & 1 deletion Sources/IndexStoreDB/SymbolLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

public struct SymbolLocation: Equatable {
Expand Down Expand Up @@ -44,7 +45,7 @@ extension SymbolLocation: CustomStringConvertible {
// MARK: CIndexStoreDB conversions

extension SymbolLocation {
public init(_ loc: indexstoredb_symbol_location_t) {
internal init(_ loc: indexstoredb_symbol_location_t) {
path = String(cString: indexstoredb_symbol_location_path(loc))
moduleName = String(cString: indexstoredb_symbol_location_module_name(loc))
isSystem = indexstoredb_symbol_location_is_system(loc)
Expand Down
5 changes: 3 additions & 2 deletions Sources/IndexStoreDB/SymbolOccurrence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

public struct SymbolOccurrence: Equatable {
Expand Down Expand Up @@ -60,7 +61,7 @@ public struct SymbolRelation: Equatable {
extension SymbolOccurrence {

/// Note: `value` is expected to be passed +1.
init(_ value: indexstoredb_symbol_occurrence_t) {
internal init(_ value: indexstoredb_symbol_occurrence_t) {
var relations: [SymbolRelation] = []
indexstoredb_symbol_occurrence_relations(value) { relation in
relations.append(SymbolRelation(relation))
Expand All @@ -76,7 +77,7 @@ extension SymbolOccurrence {
}

extension SymbolRelation {
public init(_ value: indexstoredb_symbol_relation_t) {
internal init(_ value: indexstoredb_symbol_relation_t) {
self.init(
symbol: Symbol(indexstoredb_symbol_relation_get_symbol(value)),
roles: SymbolRole(rawValue: indexstoredb_symbol_relation_get_roles(value)))
Expand Down
3 changes: 2 additions & 1 deletion Sources/IndexStoreDB/SymbolRole.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//
//===----------------------------------------------------------------------===//

@_implementationOnly
import CIndexStoreDB

public struct SymbolRole: OptionSet, Hashable {
Expand Down Expand Up @@ -51,7 +52,7 @@ public struct SymbolRole: OptionSet, Hashable {
self.rawValue = rawValue
}

public init(rawValue: indexstoredb_symbol_role_t) {
internal init(rawValue: indexstoredb_symbol_role_t) {
self.rawValue = UInt64(rawValue.rawValue)
}
}
Expand Down