├── Tests
└── IndexStoreTests
│ ├── Samples
│ ├── EmptySource.swift
│ ├── SourceContents.swift
│ ├── Structs.swift
│ ├── Protocols.swift
│ ├── Classes.swift
│ ├── Enums.swift
│ ├── RelationsRestricted.swift
│ ├── Typealias.swift
│ ├── Colors.swift
│ ├── Extensions.swift
│ ├── Relations.swift
│ ├── InvocationTestCase.swift
│ ├── Inheritance.swift
│ ├── Properties.swift
│ └── Functions.swift
│ ├── Configurations
│ └── test_configuration.json
│ ├── Utilities
│ ├── Logger+Tests.swift
│ └── AnyError.swift
│ ├── SourceLocationTests.swift
│ ├── ProcessInfoExtensionTests.swift
│ ├── SourceSymbolCollectionTests.swift
│ └── SourceResolvingErrorTests.swift
├── .spi.yml
├── IndexStore.doccarchive
├── favicon.ico
├── index
│ ├── data.mdb
│ ├── navigator.index
│ └── availability.index
├── developer-og.jpg
├── metadata.json
├── developer-og-twitter.jpg
├── img
│ ├── no-image@2x.df2a0a50.png
│ ├── deprecated-icon.015b4f17.svg
│ ├── added-icon.d6f7e47d.svg
│ └── modified-icon.f496e73d.svg
├── js
│ ├── highlight-js-shell.dd7f411f.js
│ ├── highlight-js-json.471128d2.js
│ ├── highlight-js-diff.62d66733.js
│ ├── highlight-js-http.163e45b6.js
│ ├── highlight-js-xml.9c3688c7.js
│ └── highlight-js-markdown.90077643.js
├── favicon.svg
├── data
│ └── documentation
│ │ └── indexstore
│ │ ├── indexstorequery
│ │ ├── init().json
│ │ ├── equatable-implementations.json
│ │ └── init(query:).json
│ │ ├── sourcesymbol
│ │ ├── identifiable-implementations.json
│ │ ├── equatable-implementations.json
│ │ └── name.json
│ │ ├── sourceresolvingerror
│ │ ├── error-implementations.json
│ │ ├── equatable-implementations.json
│ │ └── code.json
│ │ ├── sourcerole
│ │ ├── equatable-implementations.json
│ │ ├── rawvalue.json
│ │ ├── description.json
│ │ └── init(rawvalue:).json
│ │ ├── sourcekind
│ │ ├── equatable-implementations.json
│ │ ├── class.json
│ │ ├── enum.json
│ │ ├── macro.json
│ │ ├── struct.json
│ │ ├── field.json
│ │ ├── union.json
│ │ ├── concept.json
│ │ ├── protocol.json
│ │ ├── namespace.json
│ │ ├── parameter.json
│ │ ├── module.json
│ │ ├── using.json
│ │ ├── extension.json
│ │ ├── enumconstant.json
│ │ ├── unsupported.json
│ │ ├── destructor.json
│ │ ├── function.json
│ │ ├── constructor.json
│ │ ├── variable.json
│ │ ├── instancemethod.json
│ │ ├── namespacealias.json
│ │ ├── instanceproperty.json
│ │ ├── conversionfunction.json
│ │ ├── classproperty.json
│ │ ├── classmethod.json
│ │ ├── staticmethod.json
│ │ ├── staticproperty.json
│ │ ├── typealias.json
│ │ ├── commenttag.json
│ │ ├── indexsymbolkind.json
│ │ ├── init(symbolkind:).json
│ │ └── init(rawvalue:).json
│ │ ├── sourcelocation
│ │ ├── equatable-implementations.json
│ │ ├── line.json
│ │ ├── path.json
│ │ ├── column.json
│ │ ├── modulename.json
│ │ ├── offset.json
│ │ ├── issystem.json
│ │ └── description.json
│ │ ├── sourcedetailscollection
│ │ └── equatable-implementations.json
│ │ ├── configuration
│ │ ├── indexstorepath.json
│ │ ├── projectdirectory.json
│ │ ├── indexdatabasepath.json
│ │ └── libindexstorepath.json
│ │ ├── sourcedetailsiterator
│ │ └── equatable-implementations.json
│ │ └── workspace
│ │ └── logger.json
└── css
│ └── documentation-topic~topic.fccbd76c.css
├── Sources
└── IndexStore
│ ├── Internal
│ ├── Utilities
│ │ ├── Logger+Defaults.swift
│ │ ├── Shell.swift
│ │ └── ProcessInfo+Environment.swift
│ └── Extensions
│ │ └── IndexStoreDB+Hashable.swift
│ ├── Resources
│ └── PrivacyInfo.xcprivacy
│ └── Public
│ ├── Convenience
│ └── IndexStore+ExtensionConvenience.swift
│ ├── SourceSymbol
│ └── SourceLocation.swift
│ └── IndexStoreQuery
│ ├── IndexStoreQuery+Extensions.swift
│ ├── IndexStoreQuery+Functions.swift
│ └── IndexStoreQuery+Properties.swift
├── LICENSE
├── Changelog.md
├── Package@swift-5.8.swift
├── Package@swift-5.9.swift
├── Package@swift-5.10.swift
├── Package.swift
├── swift-format.json
└── .github
└── workflows
└── unit-tests.yml
/Tests/IndexStoreTests/Samples/EmptySource.swift:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.spi.yml:
--------------------------------------------------------------------------------
1 | version: 1
2 | builder:
3 | configs:
4 | - documentation_targets: [IndexStore]
--------------------------------------------------------------------------------
/IndexStore.doccarchive/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/favicon.ico
--------------------------------------------------------------------------------
/IndexStore.doccarchive/index/data.mdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/index/data.mdb
--------------------------------------------------------------------------------
/IndexStore.doccarchive/developer-og.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/developer-og.jpg
--------------------------------------------------------------------------------
/IndexStore.doccarchive/index/navigator.index:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/index/navigator.index
--------------------------------------------------------------------------------
/IndexStore.doccarchive/metadata.json:
--------------------------------------------------------------------------------
1 | {"bundleDisplayName":"IndexStore","bundleIdentifier":"IndexStore","schemaVersion":{"major":0,"minor":1,"patch":0}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/developer-og-twitter.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/developer-og-twitter.jpg
--------------------------------------------------------------------------------
/IndexStore.doccarchive/index/availability.index:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/index/availability.index
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Configurations/test_configuration.json:
--------------------------------------------------------------------------------
1 | {"projectDirectory": "/Users/michaelobrien/Development/CheekyGhost/open-source/IndexStore"}
2 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/img/no-image@2x.df2a0a50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CheekyGhost-Labs/IndexStore/HEAD/IndexStore.doccarchive/img/no-image@2x.df2a0a50.png
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/SourceContents.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | enum SourceContents {
4 | typealias SourceAlias = String
5 | enum Bar { typealias SourceAlias = Int }
6 | }
7 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Structs.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | struct RootStruct {
4 |
5 | struct NestedStruct {
6 |
7 | struct DoubleNestedStruct {
8 |
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Protocols.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | protocol RootProtocol {}
4 |
5 | protocol ProtocolWithSystemInheritance: Equatable {}
6 |
7 | protocol BaseProtocol {}
8 |
9 | protocol ProtocolWithInheritance: BaseProtocol {}
10 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Classes.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | class RootClass {
4 |
5 | class NestedClass {
6 |
7 | class DoubleNestedClass {
8 |
9 | }
10 | }
11 | }
12 |
13 | class SampleClass {}
14 |
15 | class OtherInheritanceSubclass: InheritanceClass {
16 |
17 | func sample() {
18 | // no-op
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Enums.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | enum RootEnum {
4 |
5 | enum NestedEnum {
6 |
7 | enum DoubleNestedEnum {
8 |
9 | }
10 | }
11 | }
12 |
13 | struct EnumStruct {
14 |
15 | enum NestedEnum {
16 |
17 | }
18 | }
19 |
20 | class ClassEnum {
21 |
22 | enum NestedEnum {
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/RelationsRestricted.swift:
--------------------------------------------------------------------------------
1 | //
2 | // RelationsRestricted.swift
3 | //
4 | //
5 | // Created by Michael O'Brien on 5/6/2023.
6 | //
7 |
8 | import Foundation
9 |
10 | class CustomRelationClass {
11 |
12 | var customProperty: CustomClass
13 |
14 | init() {
15 | customProperty = CustomClass()
16 | }
17 |
18 | func example() {
19 | _ = CustomClass()
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Utilities/Logger+Tests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Logger+Tests.swift
3 | // IndexStoreTests
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 | import OSLog
10 |
11 | private let testInstance: Logger = .init(subsystem: "com.cheekyghost.MimicKit.tests", category: "unit-tests")
12 |
13 | extension Logger {
14 | /// Unit testing Logger instance
15 | static var test: Logger { testInstance }
16 | }
17 |
--------------------------------------------------------------------------------
/Sources/IndexStore/Internal/Utilities/Logger+Defaults.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Logger+Defaults.swift
3 | // IndexStore
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 | import OSLog
10 |
11 | private let defaultInstance: Logger = .init(subsystem: "com.cheekyghost.IndexStore", category: "client")
12 |
13 | extension Logger {
14 | /// Default client Logger instance
15 | static var `default`: Logger { defaultInstance }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Typealias.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | typealias RootAlias = String
4 |
5 | enum Foo {
6 |
7 | typealias NestedAlias = String
8 |
9 | enum Bar {
10 |
11 | typealias DoubleNestedAlias = String
12 | }
13 | }
14 |
15 | enum Bar {
16 |
17 | typealias NestedAlias = Int
18 |
19 | }
20 |
21 | struct FooBar {
22 |
23 | typealias StructAlias = String
24 | }
25 |
26 | class FooBarClass {
27 |
28 | typealias ClassAlias = String
29 | }
30 |
--------------------------------------------------------------------------------
/Sources/IndexStore/Resources/PrivacyInfo.xcprivacy:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSPrivacyTracking
6 |
7 | NSPrivacyCollectedDataTypes
8 |
9 | NSPrivacyTrackingDomains
10 |
11 | NSPrivacyAccessedAPITypes
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/img/deprecated-icon.015b4f17.svg:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Colors.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | //
4 | //
5 | // Created by Michael O'Brien on 12/8/2023.
6 | //
7 |
8 | import Foundation
9 | import AppKit
10 |
11 | extension NSColor {
12 | static let helperColor: NSColor = .findHighlightColor
13 | }
14 |
15 | class Container {
16 |
17 | let colorOne: NSColor
18 |
19 | let colorTwo: NSColor
20 |
21 | let colorThree: NSColor
22 |
23 | init(color: NSColor = .white) {
24 | self.colorOne = color
25 | self.colorTwo = NSColor(white: 0.5, alpha: 0.5)
26 | self.colorThree = .helperColor
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/img/added-icon.d6f7e47d.svg:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/js/highlight-js-shell.dd7f411f.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * This source file is part of the Swift.org open source project
3 | *
4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors
5 | * Licensed under Apache License v2.0 with Runtime Library Exception
6 | *
7 | * See https://swift.org/LICENSE.txt for license information
8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9 | */
10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-shell"],{b65b:function(s,n){function e(s){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}s.exports=e}}]);
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Extensions.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | extension String {
4 |
5 | func test() {}
6 | }
7 |
8 | extension RootClass {
9 |
10 | func test() {}
11 | }
12 |
13 | extension RootClass {
14 |
15 | }
16 |
17 | extension RootStruct {
18 | func test() {}
19 | }
20 |
21 | extension RootStruct {
22 |
23 | }
24 |
25 | extension RootEnum {
26 |
27 | func test() {}
28 | }
29 |
30 | extension RootEnum {
31 |
32 | }
33 |
34 | extension RootProtocol {
35 | func test() {}
36 | }
37 |
38 | extension RootProtocol {
39 |
40 | }
41 |
42 | extension ProtocolWithSystemInheritance {
43 | func test() {}
44 | }
45 |
46 | extension ProtocolWithSystemInheritance {
47 | func testTwo() {}
48 | }
49 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/SourceLocationTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SourceLocationTests.swift
3 | // IndexStoreTests
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import XCTest
9 |
10 | @testable import IndexStore
11 |
12 | final class SourceLocationTests: XCTestCase {
13 | // MARK: - Tests
14 |
15 | func test_description_returnsExpectedValue() {
16 | let location = SourceLocation(
17 | path: "test-path",
18 | moduleName: "test-module",
19 | line: 123,
20 | column: 12,
21 | offset: 12,
22 | isSystem: false,
23 | isStale: true
24 | )
25 | XCTAssertEqual(location.description, "test-module::test-path::123::12")
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Relations.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Relations.swift
3 | //
4 | //
5 | // Created by Michael O'Brien on 5/6/2023.
6 | //
7 |
8 | import Foundation
9 |
10 | class CustomClass {
11 | init() {}
12 | }
13 |
14 | class RelationClass {
15 |
16 | var customProperty: CustomClass
17 |
18 | init() {
19 | customProperty = CustomClass()
20 | thing = .derp
21 | }
22 |
23 | func example() {
24 | _ = CustomClass()
25 | }
26 |
27 | var relation: RelatedEnum = .sample
28 |
29 | func testThing() {
30 | relation = .sample
31 | }
32 |
33 | var thing: Thing
34 | }
35 |
36 | enum RelatedEnum {
37 | case sample
38 | }
39 |
40 |
41 | class Thing {
42 | class var derp: Thing { Thing() }
43 | }
44 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Utilities/AnyError.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnyError.swift
3 | // IndexStoreTests
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 |
10 | struct AnyError: LocalizedError {
11 | // MARK: - Properties
12 |
13 | var message: String
14 |
15 | var recoveryHint: String?
16 |
17 | // MARK: - LocalizedError
18 |
19 | var errorDescription: String? { failureReason }
20 |
21 | var failureReason: String? { localizedFailureReason }
22 |
23 | var localizedFailureReason: String? { message }
24 |
25 | var recoverySuggestion: String? { recoveryHint }
26 |
27 | // MARK: - Lifecycle
28 |
29 | init(_ message: String, recoveryHint: String? = nil) {
30 | self.message = message
31 | self.recoveryHint = recoveryHint
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/js/highlight-js-json.471128d2.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * This source file is part of the Swift.org open source project
3 | *
4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors
5 | * Licensed under Apache License v2.0 with Runtime Library Exception
6 | *
7 | * See https://swift.org/LICENSE.txt for license information
8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9 | */
10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-json"],{"5ad2":function(n,e){function a(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},a={match:/[{}[\],:]/,className:"punctuation",relevance:0},s={beginKeywords:["true","false","null"].join(" ")};return{name:"JSON",contains:[e,a,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}n.exports=a}}]);
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/InvocationTestCase.swift:
--------------------------------------------------------------------------------
1 | //
2 | // InvocationTestCase.swift
3 | //
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import XCTest
9 |
10 | class SampleTestCase: XCTestCase {
11 |
12 | var baseProperty: String = ""
13 |
14 | static let basePropertyTwo: String = ""
15 | }
16 |
17 | extension XCTestCase {
18 |
19 | func extendedMethod() {
20 | // no-op
21 | }
22 | }
23 |
24 | final class InvocationTestCase: SampleTestCase {
25 |
26 | let instance: FunctionClass = .init()
27 |
28 | func test_invokingMethod() throws {
29 | instance.standardTestCaseInvocation()
30 | }
31 | }
32 |
33 | final class StandardTestCase: XCTestCase {
34 |
35 | let instance: FunctionClass.NestedFunctionClass = .init()
36 |
37 | func test_invokingMethod() throws {
38 | instance.subclassTestCaseInvocation()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/js/highlight-js-diff.62d66733.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * This source file is part of the Swift.org open source project
3 | *
4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors
5 | * Licensed under Apache License v2.0 with Runtime Library Exception
6 | *
7 | * See https://swift.org/LICENSE.txt for license information
8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9 | */
10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-diff"],{"48b8":function(e,n){function a(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}e.exports=a}}]);
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Inheritance.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | struct InheritanceStruct: ProtocolWithSystemInheritance, RootProtocol {
4 |
5 | let name: String = "name"
6 | }
7 |
8 | class InheritanceClass: RootProtocol, ProtocolWithSystemInheritance {
9 |
10 | let name: String = "name"
11 |
12 | public static func == (lhs: InheritanceClass, rhs: InheritanceClass) -> Bool {
13 | true
14 | }
15 | }
16 |
17 | struct CustomInheritanceStruct: ProtocolWithInheritance, RootProtocol {
18 |
19 | let name: String = "name"
20 | }
21 |
22 | class CustomInheritanceClass: RootProtocol, ProtocolWithInheritance {
23 |
24 | let name: String = "name"
25 |
26 | public static func == (lhs: CustomInheritanceClass, rhs: CustomInheritanceClass) -> Bool {
27 | true
28 | }
29 | }
30 |
31 | class InheritanceSubclass: InheritanceClass {
32 |
33 | func sample() {
34 | // no-op
35 | }
36 | }
37 |
38 | class SystemInheritanceSubclass: NSObject {
39 |
40 | override init() {
41 | super.init()
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/Sources/IndexStore/Internal/Utilities/Shell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Shell.swift
3 | // IndexStore
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 |
10 | enum ShellError: LocalizedError, Sendable {
11 | case unableToDecodeResult
12 | }
13 |
14 | /// Will perform a simple shell command and return the result.
15 | /// - Parameter command: The command to invoke.
16 | /// - Returns: ``String``
17 | @discardableResult
18 | func shell(_ command: String) throws -> String {
19 | let task = Process()
20 | let pipe = Pipe()
21 | task.standardOutput = pipe
22 | task.standardError = pipe
23 | task.arguments = ["-c", command]
24 | task.executableURL = URL(fileURLWithPath: "/bin/zsh")
25 | task.standardInput = nil
26 |
27 | try task.run()
28 | let data = pipe.fileHandleForReading.readDataToEndOfFile()
29 | guard let output = String(data: data, encoding: .utf8) else {
30 | throw ShellError.unableToDecodeResult
31 | }
32 |
33 | return output.trimmingCharacters(in: .whitespacesAndNewlines)
34 | }
35 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Michael O'Brien
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/img/modified-icon.f496e73d.svg:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/js/highlight-js-http.163e45b6.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * This source file is part of the Swift.org open source project
3 | *
4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors
5 | * Licensed under Apache License v2.0 with Runtime Library Exception
6 | *
7 | * See https://swift.org/LICENSE.txt for license information
8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9 | */
10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-http"],{c01d:function(e,n){function a(e){const n=e.regex,a="HTTP/(2|1\\.[01])",s=/[A-Za-z][A-Za-z0-9-]*/,t={className:"attribute",begin:n.concat("^",s,"(?=\\:\\s)"),starts:{contains:[{className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]}},i=[t,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})",end:/$/,contains:[{className:"meta",begin:a},{className:"number",begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},{begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:i}},e.inherit(t,{relevance:0})]}}e.exports=a}}]);
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Properties.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Properties.swift
3 | //
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 |
10 | protocol PropertiesProtocol {
11 |
12 | var sampleProperty: String { get set }
13 |
14 | var sampleClosureProperty: () -> Void { get set }
15 | }
16 |
17 | struct PropertiesStruct {
18 |
19 | var sampleProperty: String = ""
20 |
21 | var sampleClosureProperty: () -> Void = {}
22 | }
23 |
24 | class PropertiesClass {
25 |
26 | var sampleProperty: String = "name"
27 |
28 | var sampleClosureProperty: () -> Void = {}
29 |
30 | }
31 |
32 | struct PropertiesConformance: PropertiesProtocol {
33 |
34 | var sampleProperty: String = ""
35 |
36 | var sampleClosureProperty: () -> Void = {}
37 |
38 | mutating func invocation() {
39 | sampleProperty = ""
40 | }
41 | }
42 |
43 | class PropertiesSubclass: PropertiesClass {
44 |
45 | override var sampleProperty: String {
46 | get {
47 | "name"
48 | }
49 | set {}
50 | }
51 |
52 | override var sampleClosureProperty: () -> Void {
53 | get {
54 | {}
55 | }
56 | set {}
57 | }
58 |
59 | func invocation() {
60 | sampleProperty = "test"
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Sources/IndexStore/Public/Convenience/IndexStore+ExtensionConvenience.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IndexStore+Convenience.swift
3 | // IndexStore
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 | import IndexStoreDB
10 | import TSCBasic
11 |
12 | public extension IndexStore {
13 | // MARK: - Convenience: Extensions
14 |
15 | /// Will return any source symbols for any **empty** extensions on types matching the given query.
16 | ///
17 | /// **Note: ** The provided query will have the `kinds` and `roles` modified to enable the search.
18 | /// - Parameter query: The query to search with.
19 | /// - Returns: Array of ``SourceSymbol`` instances
20 | func sourceSymbols(forEmptyExtensionsMatching query: IndexStoreQuery) -> [SourceSymbol] {
21 | let symbols = querySymbols(query)
22 | var results: [SourceSymbol] = []
23 | symbols.forEach {
24 | let references = workspace.occurrences(ofUSR: $0.usr, roles: [.reference])
25 | references.forEach { reference in
26 | guard reference.roles.contains([.reference]), reference.relations.isEmpty else { return }
27 | var details = sourceSymbolFromOccurrence(reference)
28 | details.sourceKind = .extension
29 | results.append(details)
30 | }
31 | }
32 | return results
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/ProcessInfoExtensionTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ProcessInfoExtensionTests.swift
3 | // IndexStoreTests
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import XCTest
9 |
10 | @testable import IndexStore
11 |
12 | final class ProcessInfoExtensionTests: XCTestCase {
13 | func test_missingEnvironmentKey_willThrowExpectedError() throws {
14 | let expectedError = ProcessInfoError.unableToFindValueForKey("missing")
15 | XCTAssertThrowsError(try ProcessInfo().environmentVariable(name: "missing")) { error in
16 | XCTAssertEqual(error as? ProcessInfoError, expectedError)
17 | }
18 | }
19 |
20 | func test_presentEnvironmentKey_willReturnExpectedValue() throws {
21 | let result = try? ProcessInfo().environmentVariable(name: EnvironmentKeys.PWD)
22 | XCTAssertNotNil(result)
23 | }
24 |
25 | func test_processInfoError_willOutputExpectedDescriptions() throws {
26 | let error = ProcessInfoError.unableToFindValueForKey("test")
27 | XCTAssertEqual(error.code, 0)
28 | XCTAssertEqual(error.failureReason, "Unable to resolve value for key: `test`")
29 | XCTAssertEqual(
30 | error.recoverySuggestion,
31 | "Review the `environment` property to ensure expected values are present. Environment values change depending on where the process is running from"
32 | )
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/favicon.svg:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/Changelog.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | ## [3.2.0] - 03-04-2025
6 |
7 | - Bumping swift tools 6.x package to use IndexStoreDB dependency at tag "swift-6.1-RELEASE"
8 |
9 | ### Fixed
10 |
11 | - Added missing compatability commits for swift 5.8, 5.9, and 5.10
12 | - Added modern SPM unit test runners
13 | - Removed xcode-driven tests
14 |
15 | ## [3.0.1] - 2024-01-11
16 |
17 | ### Fixed
18 |
19 | - Added missing compatability commits for swift 5.8, 5.9, and 5.10
20 | - Added modern SPM unit test runners
21 | - Removed xcode-driven tests
22 |
23 | ## [3.0.0] - 2024-01-11
24 |
25 | ### Added
26 |
27 | - Explicit Swift 6 language mode support
28 | - Dropped swift 5.5->5.7
29 |
30 |
31 | ## [2.0.1] - 2023-03-12
32 |
33 | ### Added
34 |
35 | - Added privacy manifest
36 | - Updated to release 5.9.1 of IndexStoreDB
37 | - Hardened querying logic where relevant
38 |
39 |
40 | ## [2.0.0] - 2023-12-08
41 |
42 | ### Added
43 |
44 | - Added support for symbol occurrence querying
45 | - Added support for related symbol occurrence querying
46 | - Hardened querying logic where relevant
47 |
48 | ### Added
49 |
50 | - Added support for Swift 5.6
51 | - Added support for Swift 5.5
52 |
53 | ## [1.0.1] - 2023-05-03
54 |
55 | ### Added
56 |
57 | - Added support for Swift 5.6
58 | - Added support for Swift 5.5
59 |
60 | ### Changed
61 |
62 | - Improved accuracy of inheritance resolving
63 |
64 | ## [1.0.0] - 2023-05-01
65 |
66 | - Initial Release
--------------------------------------------------------------------------------
/Sources/IndexStore/Internal/Utilities/ProcessInfo+Environment.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ProcessInfo+Environment.swift
3 | // IndexStore
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 |
10 | enum ProcessInfoError: LocalizedError, Equatable, Sendable {
11 | case unableToFindValueForKey(String)
12 |
13 | public var code: Int {
14 | switch self {
15 | case .unableToFindValueForKey:
16 | return 0
17 | }
18 | }
19 |
20 | public var errorDescription: String? { failureReason }
21 |
22 | public var failureReason: String? {
23 | switch self {
24 | case let .unableToFindValueForKey(key):
25 | return "Unable to resolve value for key: `\(key)`"
26 | }
27 | }
28 |
29 | public var recoverySuggestion: String? {
30 | switch self {
31 | case .unableToFindValueForKey:
32 | return "Review the `environment` property to ensure expected values are present. Environment values change depending on where the process is running from"
33 | }
34 | }
35 | }
36 |
37 | // Default values for various environment values
38 | enum EnvironmentKeys {
39 | static let PWD = "PWD"
40 | static let xcodeBuiltProducts = "__XCODE_BUILT_PRODUCTS_DIR_PATHS"
41 | static let testConfigurationPath = "XCTestConfigurationFilePath"
42 | }
43 |
44 | extension ProcessInfo {
45 | func environmentVariable(name: String) throws -> String {
46 | guard let value = environment[name] else {
47 | throw ProcessInfoError.unableToFindValueForKey(name)
48 | }
49 | return value
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/Samples/Functions.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | class FunctionClass {
4 |
5 | func performFunction(withPerson: (name: String, age: Int)) {}
6 |
7 | func standardTestCaseInvocation() {}
8 |
9 | class NestedFunctionClass {
10 |
11 | func subclassTestCaseInvocation() {}
12 |
13 | class DoubleNestedFunctionClass {
14 |
15 | func notInvokedInTestCase() {}
16 | }
17 | }
18 | }
19 |
20 | protocol FunctionRootProtocol {
21 | func performOperation(withName: String)
22 | func executeOrder()
23 | }
24 |
25 | protocol FunctionProtocolWithSystemInheritance: Equatable {
26 |
27 | func performOperation(withAge: Int)
28 | }
29 |
30 | protocol FunctionBaseProtocol {
31 |
32 | func performOperation(withName: String, age: Int)
33 | }
34 |
35 | protocol FunctionProtocolWithInheritance: FunctionBaseProtocol {
36 | func performOperation(withName: String, age: Int, handler: @escaping (() -> Void))
37 | }
38 |
39 | struct Invocations {
40 |
41 | let instance = FunctionClass()
42 | let otherInstance = InvocationsConformance()
43 |
44 | init() {
45 | instance.performFunction(withPerson: ("name", 20))
46 | }
47 |
48 | func sample() {
49 | otherInstance.sampleInvocation()
50 | otherInstance.performOperation(withName: "test")
51 | }
52 | }
53 |
54 | func isolatedFunction() {
55 | // no-op
56 | }
57 |
58 | struct InvocationsConformance: FunctionRootProtocol {
59 |
60 | func sampleInvocation() {
61 | let instance = FunctionClass()
62 | instance.performFunction(withPerson: ("name", 20))
63 | }
64 |
65 | func performOperation(withName: String) {
66 | // no-op
67 | }
68 |
69 | func executeOrder() {
70 | // no-op
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/Package@swift-5.8.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.8
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "IndexStore",
8 | platforms: [.macOS(.v11)],
9 | products: [
10 | // Products define the executables and libraries a package produces, and make them visible to other packages.
11 | .library(
12 | name: "IndexStore",
13 | targets: ["IndexStore"]
14 | ),
15 | ],
16 | dependencies: [
17 | .package(url: "https://github.com/swiftlang/indexstore-db.git", revision: "swift-6.0.2-RELEASE"),
18 | .package(url: "https://github.com/swiftlang/swift-tools-support-core.git", exact: Version("0.7.1")),
19 | ],
20 | targets: [
21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
22 | // Targets can depend on other targets in this package, and on products in packages this package depends on.
23 | .target(
24 | name: "IndexStore",
25 | dependencies: [
26 | .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
27 | .product(name: "IndexStoreDB", package: "indexstore-db"),
28 | ],
29 | resources: [
30 | .copy("Resources/PrivacyInfo.xcprivacy")
31 | ]
32 | ),
33 | .testTarget(
34 | name: "IndexStoreTests",
35 | dependencies: [
36 | "IndexStore",
37 | ],
38 | resources: [
39 | .copy("Configurations"),
40 | ]
41 | ),
42 | ]
43 | )
44 |
45 | // Supplementary
46 | package.dependencies.append(contentsOf: [
47 | .package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
48 | ])
49 |
--------------------------------------------------------------------------------
/Package@swift-5.9.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.9
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "IndexStore",
8 | platforms: [.macOS(.v11)],
9 | products: [
10 | // Products define the executables and libraries a package produces, and make them visible to other packages.
11 | .library(
12 | name: "IndexStore",
13 | targets: ["IndexStore"]
14 | ),
15 | ],
16 | dependencies: [
17 | .package(url: "https://github.com/swiftlang/indexstore-db.git", revision: "swift-6.0.2-RELEASE"),
18 | .package(url: "https://github.com/swiftlang/swift-tools-support-core.git", exact: Version("0.7.1")),
19 | ],
20 | targets: [
21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
22 | // Targets can depend on other targets in this package, and on products in packages this package depends on.
23 | .target(
24 | name: "IndexStore",
25 | dependencies: [
26 | .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
27 | .product(name: "IndexStoreDB", package: "indexstore-db"),
28 | ],
29 | resources: [
30 | .copy("Resources/PrivacyInfo.xcprivacy")
31 | ]
32 | ),
33 | .testTarget(
34 | name: "IndexStoreTests",
35 | dependencies: [
36 | "IndexStore",
37 | ],
38 | resources: [
39 | .copy("Configurations"),
40 | ]
41 | ),
42 | ]
43 | )
44 |
45 | // Supplementary
46 | package.dependencies.append(contentsOf: [
47 | .package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
48 | ])
49 |
--------------------------------------------------------------------------------
/Package@swift-5.10.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 5.10
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "IndexStore",
8 | platforms: [.macOS(.v11)],
9 | products: [
10 | // Products define the executables and libraries a package produces, and make them visible to other packages.
11 | .library(
12 | name: "IndexStore",
13 | targets: ["IndexStore"]
14 | ),
15 | ],
16 | dependencies: [
17 | .package(url: "https://github.com/swiftlang/indexstore-db.git", revision: "swift-6.0.2-RELEASE"),
18 | .package(url: "https://github.com/swiftlang/swift-tools-support-core.git", exact: Version("0.7.1")),
19 | ],
20 | targets: [
21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
22 | // Targets can depend on other targets in this package, and on products in packages this package depends on.
23 | .target(
24 | name: "IndexStore",
25 | dependencies: [
26 | .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
27 | .product(name: "IndexStoreDB", package: "indexstore-db"),
28 | ],
29 | resources: [
30 | .copy("Resources/PrivacyInfo.xcprivacy")
31 | ]
32 | ),
33 | .testTarget(
34 | name: "IndexStoreTests",
35 | dependencies: [
36 | "IndexStore",
37 | ],
38 | resources: [
39 | .copy("Configurations"),
40 | ]
41 | ),
42 | ]
43 | )
44 |
45 | // Supplementary
46 | package.dependencies.append(contentsOf: [
47 | .package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
48 | ])
49 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version: 6.0
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "IndexStore",
8 | platforms: [.macOS(.v11)],
9 | products: [
10 | // Products define the executables and libraries a package produces, and make them visible to other packages.
11 | .library(
12 | name: "IndexStore",
13 | targets: ["IndexStore"]
14 | ),
15 | ],
16 | dependencies: [
17 | .package(url: "https://github.com/swiftlang/indexstore-db.git", revision: "swift-6.1-RELEASE"),
18 | .package(url: "https://github.com/apple/swift-tools-support-core.git", exact: Version("0.7.1")),
19 | ],
20 | targets: [
21 | // Targets are the basic building blocks of a package. A target can define a module or a test suite.
22 | // Targets can depend on other targets in this package, and on products in packages this package depends on.
23 | .target(
24 | name: "IndexStore",
25 | dependencies: [
26 | .product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
27 | .product(name: "IndexStoreDB", package: "indexstore-db"),
28 | ],
29 | resources: [
30 | .copy("Resources/PrivacyInfo.xcprivacy")
31 | ],
32 | swiftSettings: [
33 | .swiftLanguageMode(.v6)
34 | ]
35 | ),
36 | .testTarget(
37 | name: "IndexStoreTests",
38 | dependencies: [
39 | "IndexStore",
40 | ],
41 | resources: [
42 | .copy("Configurations"),
43 | ]
44 | ),
45 | ]
46 | )
47 |
48 | // Supplementary
49 | package.dependencies.append(contentsOf: [
50 | .package(url: "https://github.com/SwiftPackageIndex/SPIManifest.git", from: "0.12.0"),
51 | ])
52 |
--------------------------------------------------------------------------------
/Tests/IndexStoreTests/SourceSymbolCollectionTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SourceSymbolCollectionTests.swift
3 | // IndexStoreTests
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import XCTest
9 |
10 | @testable import IndexStore
11 |
12 | final class SourceSymbolCollectionTests: XCTestCase {
13 | // MARK: - Tests
14 |
15 | func test_makeIterator_willReturnExpectedValue() throws {
16 | let location = SourceLocation(
17 | path: "path",
18 | moduleName: "module",
19 | line: 0,
20 | column: 0,
21 | offset: 0,
22 | isSystem: false,
23 | isStale: false
24 | )
25 | let items: [SourceSymbol] = [
26 | SourceSymbol(name: "0", usr: "0", sourceKind: .struct, roles: .declaration, location: location),
27 | SourceSymbol(name: "1", usr: "1", sourceKind: .struct, roles: .declaration, location: location),
28 | SourceSymbol(name: "2", usr: "2", sourceKind: .struct, roles: .declaration, location: location),
29 | ]
30 | let additional = SourceSymbol(name: "3", usr: "3", sourceKind: .struct, roles: .declaration, location: location)
31 | var collection = SourceDetailsCollection(items: items)
32 | collection.append(additional)
33 | XCTAssertEqual(collection.items, items + [additional])
34 | XCTAssertEqual(collection.count, 4)
35 | let instanceUnderTest = collection.makeIterator()
36 | XCTAssertEqual(instanceUnderTest.next()?.name, "0")
37 | XCTAssertEqual(instanceUnderTest.next()?.name, "1")
38 | XCTAssertEqual(instanceUnderTest.next()?.name, "2")
39 | XCTAssertEqual(instanceUnderTest.next()?.name, "3")
40 | let directIterator = SourceDetailsIterator(collection)
41 | XCTAssertEqual(directIterator.count, 4)
42 | let otherIterator = SourceDetailsIterator(collection)
43 | XCTAssertEqual(directIterator, otherIterator)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/indexstorequery/init().json:
--------------------------------------------------------------------------------
1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"init"},{"kind":"text","text":"()"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/indexstore\/indexstorequery\/init()"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/IndexStoreQuery\/init()","interfaceLanguage":"swift"},"kind":"symbol","metadata":{"fragments":[{"kind":"identifier","text":"init"},{"kind":"text","text":"()"}],"title":"init()","roleHeading":"Initializer","role":"symbol","symbolKind":"init","externalID":"s:10IndexStore0aB5QueryVACycfc","modules":[{"name":"IndexStore"}]},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/IndexStoreQuery"]]},"references":{"doc://IndexStore/documentation/IndexStore/IndexStoreQuery/init()":{"role":"symbol","title":"init()","fragments":[{"kind":"identifier","text":"init"},{"kind":"text","text":"()"}],"abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/IndexStoreQuery\/init()","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/indexstorequery\/init()"},"doc://IndexStore/documentation/IndexStore/IndexStoreQuery":{"role":"symbol","title":"IndexStoreQuery","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"IndexStoreQuery"}],"abstract":[{"type":"text","text":"Struct representing a query to give to an "},{"type":"codeVoice","code":"IndexStore"},{"type":"text","text":" instance to search for source symbols."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/IndexStoreQuery","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"IndexStoreQuery"}],"url":"\/documentation\/indexstore\/indexstorequery"},"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"}}}
--------------------------------------------------------------------------------
/Sources/IndexStore/Internal/Extensions/IndexStoreDB+Hashable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IndexStoreDB+Hashable.swift
3 | //
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import IndexStoreDB
9 |
10 | // Extensions that adds Hashable support to IndexStoreDB types so can use OrderedSet results
11 |
12 | #if swift(>=6.0)
13 | extension SymbolOccurrence: @retroactive Hashable {
14 | public func hash(into hasher: inout Hasher) {
15 | hasher.combine(symbol.hashValue)
16 | hasher.combine(location.hashValue)
17 | hasher.combine(roles.hashValue)
18 | hasher.combine(relations.hashValue)
19 | }
20 | }
21 | #else
22 | extension SymbolOccurrence: Hashable {
23 | public func hash(into hasher: inout Hasher) {
24 | hasher.combine(symbol.hashValue)
25 | hasher.combine(location.hashValue)
26 | hasher.combine(roles.hashValue)
27 | hasher.combine(relations.hashValue)
28 | }
29 | }
30 | #endif
31 |
32 | #if swift(>=6.0)
33 | extension SymbolLocation: @retroactive Hashable {
34 | public func hash(into hasher: inout Hasher) {
35 | hasher.combine(path.hashValue)
36 | hasher.combine(moduleName.hashValue)
37 | hasher.combine(isSystem.hashValue)
38 | hasher.combine(line.hashValue)
39 | hasher.combine(utf8Column.hashValue)
40 | }
41 | }
42 | #else
43 | extension SymbolLocation: Hashable {
44 | public func hash(into hasher: inout Hasher) {
45 | hasher.combine(path.hashValue)
46 | hasher.combine(moduleName.hashValue)
47 | hasher.combine(isSystem.hashValue)
48 | hasher.combine(line.hashValue)
49 | hasher.combine(utf8Column.hashValue)
50 | }
51 | }
52 | #endif
53 |
54 | #if swift(>=6.0)
55 | extension SymbolRelation: @retroactive Hashable {
56 | public func hash(into hasher: inout Hasher) {
57 | hasher.combine(symbol.hashValue)
58 | hasher.combine(roles.hashValue)
59 | }
60 | }
61 | #else
62 | extension SymbolRelation: Hashable {
63 | public func hash(into hasher: inout Hasher) {
64 | hasher.combine(symbol.hashValue)
65 | hasher.combine(roles.hashValue)
66 | }
67 | }
68 | #endif
69 |
--------------------------------------------------------------------------------
/Sources/IndexStore/Public/SourceSymbol/SourceLocation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SourceLocation.swift
3 | // IndexStore
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 | import IndexStoreDB
10 |
11 | /// Struct representing the location of a source declaration.
12 | public struct SourceLocation: Equatable, Hashable, CustomStringConvertible, CustomDebugStringConvertible, Sendable {
13 | /// The absolute path for the source file.
14 | public let path: String
15 |
16 | /// The parent package module name.
17 | public let moduleName: String
18 |
19 | /// The line the source declaration/type is on.
20 | public let line: Int
21 |
22 | /// The horizontal position of source declaration/type.
23 | public let column: Int
24 |
25 | /// The UTF-8 byte offset into the file where this location resides.
26 | public let offset: Int
27 |
28 | /// `Bool` whether the source location is part of the system/platform.
29 | public let isSystem: Bool
30 |
31 | /// `Bool` indicating whether the `path` resolves to a stale or missing location.
32 | public let isStale: Bool
33 |
34 | // MARK: - Lifecycle
35 |
36 | public init(path: String, moduleName: String, line: Int, column: Int, offset: Int, isSystem: Bool, isStale: Bool) {
37 | self.path = path
38 | self.moduleName = moduleName
39 | self.line = line
40 | self.column = column
41 | self.offset = offset
42 | self.isSystem = isSystem
43 | self.isStale = isStale
44 | }
45 |
46 | public init(symbol: SymbolOccurrence) {
47 | path = symbol.location.path
48 | moduleName = symbol.location.moduleName
49 | line = symbol.location.line
50 | column = symbol.location.utf8Column
51 | offset = symbol.location.utf8Column
52 | isSystem = symbol.location.isSystem
53 | isStale = !FileManager.default.fileExists(atPath: path)
54 | }
55 |
56 | // MARK: - Conformance: CustomStringConvertible
57 |
58 | public var description: String {
59 | "\(moduleName)::\(path)::\(line)::\(column)"
60 | }
61 |
62 | public var debugDescription: String { description }
63 | }
64 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcesymbol/identifiable-implementations.json:
--------------------------------------------------------------------------------
1 | {"variants":[{"paths":["\/documentation\/indexstore\/sourcesymbol\/identifiable-implementations"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceSymbol\/Identifiable-Implementations","interfaceLanguage":"swift"},"topicSections":[{"title":"Instance Properties","identifiers":["doc:\/\/IndexStore\/documentation\/IndexStore\/SourceSymbol\/id-7w9z9"],"generated":true}],"kind":"article","metadata":{"modules":[{"name":"IndexStore"}],"role":"collectionGroup","title":"Identifiable Implementations"},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceSymbol"]]},"references":{"doc://IndexStore/documentation/IndexStore/SourceSymbol":{"role":"symbol","title":"SourceSymbol","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceSymbol"}],"abstract":[{"type":"text","text":"Result returned by a "},{"type":"reference","isActive":true,"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore"},{"type":"text","text":" instance containing details about a resolved source type."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceSymbol","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceSymbol"}],"url":"\/documentation\/indexstore\/sourcesymbol"},"doc://IndexStore/documentation/IndexStore/SourceSymbol/id-7w9z9":{"role":"symbol","title":"id","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"id"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"ObjectIdentifier","preciseIdentifier":"s:SO"}],"abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceSymbol\/id-7w9z9","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcesymbol\/id-7w9z9"},"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourceresolvingerror/error-implementations.json:
--------------------------------------------------------------------------------
1 | {"variants":[{"paths":["\/documentation\/indexstore\/sourceresolvingerror\/error-implementations"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceResolvingError\/Error-Implementations","interfaceLanguage":"swift"},"topicSections":[{"title":"Instance Properties","identifiers":["doc:\/\/IndexStore\/documentation\/IndexStore\/SourceResolvingError\/localizedDescription"],"generated":true}],"kind":"article","metadata":{"modules":[{"name":"IndexStore"}],"role":"collectionGroup","title":"Error Implementations"},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceResolvingError"]]},"references":{"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"},"doc://IndexStore/documentation/IndexStore/SourceResolvingError/localizedDescription":{"role":"symbol","title":"localizedDescription","fragments":[{"kind":"keyword","text":"var"},{"kind":"text","text":" "},{"kind":"identifier","text":"localizedDescription"},{"kind":"text","text":": "},{"kind":"typeIdentifier","text":"String","preciseIdentifier":"s:SS"}],"abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceResolvingError\/localizedDescription","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourceresolvingerror\/localizeddescription"},"doc://IndexStore/documentation/IndexStore/SourceResolvingError":{"role":"symbol","title":"SourceResolvingError","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceResolvingError"}],"abstract":[{"type":"text","text":"Enumeration of errors that can be thrown while resolving source symbols and details."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceResolvingError","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceResolvingError"}],"url":"\/documentation\/indexstore\/sourceresolvingerror"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcerole/equatable-implementations.json:
--------------------------------------------------------------------------------
1 | {"variants":[{"paths":["\/documentation\/indexstore\/sourcerole\/equatable-implementations"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceRole\/Equatable-Implementations","interfaceLanguage":"swift"},"topicSections":[{"title":"Operators","identifiers":["doc:\/\/IndexStore\/documentation\/IndexStore\/SourceRole\/!=(_:_:)"],"generated":true}],"kind":"article","metadata":{"modules":[{"name":"IndexStore"}],"role":"collectionGroup","title":"Equatable Implementations"},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceRole"]]},"references":{"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"},"doc://IndexStore/documentation/IndexStore/SourceRole":{"role":"symbol","title":"SourceRole","fragments":[{"kind":"keyword","text":"struct"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceRole"}],"abstract":[{"type":"text","text":"Enumeration of supported roles a source declaration can contain."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceRole","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceRole"}],"url":"\/documentation\/indexstore\/sourcerole"},"doc://IndexStore/documentation/IndexStore/SourceRole/!=(_:_:)":{"role":"symbol","title":"!=(_:_:)","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"!="},{"kind":"text","text":" "},{"kind":"text","text":"("},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":", "},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceRole\/!=(_:_:)","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcerole\/!=(_:_:)"}}}
--------------------------------------------------------------------------------
/Sources/IndexStore/Public/IndexStoreQuery/IndexStoreQuery+Extensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IndexStore+Extensions.swift
3 | //
4 | //
5 | // Copyright (c) CheekyGhost Labs 2023. All Rights Reserved.
6 | //
7 |
8 | import Foundation
9 |
10 | public extension IndexStoreQuery {
11 | // MARK: - Functions
12 |
13 | /// Will return a query configured to search for extensions whose name matches the given query.
14 | ///
15 | /// Defaults to:
16 | /// - kinds: [``SourceKind/extension``]
17 | /// - roles: [``SourceRole/definition``]
18 | /// - anchorStart: `false`
19 | /// - anchorEnd: `false`
20 | /// - includeSubsequence: `true`
21 | /// - ignoreCase: `false`
22 | /// - Parameter query: The type name to search for.
23 | /// - Returns: ``IndexStoreQuery``
24 | static func extensions(ofType query: String) -> IndexStoreQuery {
25 | IndexStoreQuery(query: query)
26 | .withKinds([.extension])
27 | .withRoles([.definition])
28 | .withAnchorStart(false)
29 | .withAnchorEnd(false)
30 | .withIncludeSubsequences(true)
31 | .withIgnoringCase(false)
32 | }
33 |
34 | /// Will return a query configured to search for extensions within the given source files.
35 | ///
36 | /// Defaults to:
37 | /// - kinds: [``SourceKind/extension``]
38 | /// - roles: [``SourceRole/definition``]
39 | /// - anchorStart: `false`
40 | /// - anchorEnd: `false`
41 | /// - includeSubsequence: `true`
42 | /// - ignoreCase: `false`
43 | /// - Parameters:
44 | /// - sourceFiles: Array of source files to search for extensions in.
45 | /// - query: Optional type name to search for.
46 | /// - Returns: ``IndexStoreQuery``
47 | /// - Returns: ``IndexStoreQuery``
48 | static func extensions(in sourceFiles: [String], matching query: String? = nil) -> IndexStoreQuery {
49 | IndexStoreQuery(sourceFiles: sourceFiles)
50 | .withQuery(query)
51 | .withKinds([.extension])
52 | .withRoles([.definition])
53 | .withAnchorStart(false)
54 | .withAnchorEnd(false)
55 | .withIncludeSubsequences(true)
56 | .withIgnoringCase(false)
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcekind/equatable-implementations.json:
--------------------------------------------------------------------------------
1 | {"variants":[{"paths":["\/documentation\/indexstore\/sourcekind\/equatable-implementations"],"traits":[{"interfaceLanguage":"swift"}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/Equatable-Implementations","interfaceLanguage":"swift"},"topicSections":[{"title":"Operators","identifiers":["doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/!=(_:_:)"],"generated":true}],"kind":"article","metadata":{"modules":[{"name":"IndexStore"}],"role":"collectionGroup","title":"Equatable Implementations"},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind"]]},"references":{"doc://IndexStore/documentation/IndexStore/SourceKind":{"role":"symbol","title":"SourceKind","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceKind"}],"abstract":[{"type":"text","text":"Enumeration of declaration types source kinds utilised when resolving source types."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceKind"}],"url":"\/documentation\/indexstore\/sourcekind"},"doc://IndexStore/documentation/IndexStore/SourceKind/!=(_:_:)":{"role":"symbol","title":"!=(_:_:)","fragments":[{"kind":"keyword","text":"static"},{"kind":"text","text":" "},{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"!="},{"kind":"text","text":" "},{"kind":"text","text":"("},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":", "},{"kind":"typeIdentifier","text":"Self"},{"kind":"text","text":") -> "},{"kind":"typeIdentifier","text":"Bool","preciseIdentifier":"s:Sb"}],"abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/!=(_:_:)","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcekind\/!=(_:_:)"},"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcekind/class.json:
--------------------------------------------------------------------------------
1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`class`"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/indexstore\/sourcekind\/class"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/class","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Represents a class type."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`class`"}],"title":"SourceKind.class","roleHeading":"Case","role":"symbol","symbolKind":"case","externalID":"s:10IndexStore10SourceKindO5classyA2CmF","modules":[{"name":"IndexStore"}]},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind"]]},"references":{"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"},"doc://IndexStore/documentation/IndexStore/SourceKind":{"role":"symbol","title":"SourceKind","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceKind"}],"abstract":[{"type":"text","text":"Enumeration of declaration types source kinds utilised when resolving source types."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceKind"}],"url":"\/documentation\/indexstore\/sourcekind"},"doc://IndexStore/documentation/IndexStore/SourceKind/class":{"role":"symbol","title":"SourceKind.class","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`class`"}],"abstract":[{"type":"text","text":"Represents a class type."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/class","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcekind\/class"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcekind/enum.json:
--------------------------------------------------------------------------------
1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`enum`"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/indexstore\/sourcekind\/enum"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/enum","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Represents an enumeration type."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`enum`"}],"title":"SourceKind.enum","roleHeading":"Case","role":"symbol","symbolKind":"case","externalID":"s:10IndexStore10SourceKindO4enumyA2CmF","modules":[{"name":"IndexStore"}]},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind"]]},"references":{"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"},"doc://IndexStore/documentation/IndexStore/SourceKind/enum":{"role":"symbol","title":"SourceKind.enum","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`enum`"}],"abstract":[{"type":"text","text":"Represents an enumeration type."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/enum","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcekind\/enum"},"doc://IndexStore/documentation/IndexStore/SourceKind":{"role":"symbol","title":"SourceKind","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceKind"}],"abstract":[{"type":"text","text":"Enumeration of declaration types source kinds utilised when resolving source types."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceKind"}],"url":"\/documentation\/indexstore\/sourcekind"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcekind/macro.json:
--------------------------------------------------------------------------------
1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"macro"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/indexstore\/sourcekind\/macro"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/macro","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Represents a preprocessor macro."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"macro"}],"title":"SourceKind.macro","roleHeading":"Case","role":"symbol","symbolKind":"case","externalID":"s:10IndexStore10SourceKindO5macroyA2CmF","modules":[{"name":"IndexStore"}]},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind"]]},"references":{"doc://IndexStore/documentation/IndexStore/SourceKind/macro":{"role":"symbol","title":"SourceKind.macro","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"macro"}],"abstract":[{"type":"text","text":"Represents a preprocessor macro."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/macro","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcekind\/macro"},"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"},"doc://IndexStore/documentation/IndexStore/SourceKind":{"role":"symbol","title":"SourceKind","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceKind"}],"abstract":[{"type":"text","text":"Enumeration of declaration types source kinds utilised when resolving source types."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceKind"}],"url":"\/documentation\/indexstore\/sourcekind"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/data/documentation/indexstore/sourcekind/struct.json:
--------------------------------------------------------------------------------
1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`struct`"}],"languages":["swift"],"platforms":["macOS"]}]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"sections":[],"variants":[{"paths":["\/documentation\/indexstore\/sourcekind\/struct"],"traits":[{"interfaceLanguage":"swift"}]}],"identifier":{"url":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/struct","interfaceLanguage":"swift"},"abstract":[{"type":"text","text":"Represents a structure type."}],"kind":"symbol","metadata":{"fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`struct`"}],"title":"SourceKind.struct","roleHeading":"Case","role":"symbol","symbolKind":"case","externalID":"s:10IndexStore10SourceKindO6structyA2CmF","modules":[{"name":"IndexStore"}]},"hierarchy":{"paths":[["doc:\/\/IndexStore\/documentation\/IndexStore","doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind"]]},"references":{"doc://IndexStore/documentation/IndexStore/SourceKind":{"role":"symbol","title":"SourceKind","fragments":[{"kind":"keyword","text":"enum"},{"kind":"text","text":" "},{"kind":"identifier","text":"SourceKind"}],"abstract":[{"type":"text","text":"Enumeration of declaration types source kinds utilised when resolving source types."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind","kind":"symbol","type":"topic","navigatorTitle":[{"kind":"identifier","text":"SourceKind"}],"url":"\/documentation\/indexstore\/sourcekind"},"doc://IndexStore/documentation/IndexStore/SourceKind/struct":{"role":"symbol","title":"SourceKind.struct","fragments":[{"kind":"keyword","text":"case"},{"kind":"text","text":" "},{"kind":"identifier","text":"`struct`"}],"abstract":[{"type":"text","text":"Represents a structure type."}],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore\/SourceKind\/struct","kind":"symbol","type":"topic","url":"\/documentation\/indexstore\/sourcekind\/struct"},"doc://IndexStore/documentation/IndexStore":{"role":"collection","title":"IndexStore","abstract":[],"identifier":"doc:\/\/IndexStore\/documentation\/IndexStore","kind":"symbol","type":"topic","url":"\/documentation\/indexstore"}}}
--------------------------------------------------------------------------------
/IndexStore.doccarchive/js/highlight-js-xml.9c3688c7.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * This source file is part of the Swift.org open source project
3 | *
4 | * Copyright (c) 2021 Apple Inc. and the Swift project authors
5 | * Licensed under Apache License v2.0 with Runtime Library Exception
6 | *
7 | * See https://swift.org/LICENSE.txt for license information
8 | * See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9 | */
10 | (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["highlight-js-xml"],{"8dcb":function(e,n){function a(e){const n=e.regex,a=n.concat(/[A-Z_]/,n.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),s=/[A-Za-z0-9._:-]+/,t={className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=e.inherit(i,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),r=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[t]},{begin:/'/,end:/'/,contains:[t]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,r,l,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[i,c,r,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},t,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/