Skip to content

Commit 82936eb

Browse files
committed
Fix typos in SourceKitServer.swift
1 parent ff2b27a commit 82936eb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Sources/SourceKitLSP/SourceKitServer.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ extension SourceKitServer {
17521752
}
17531753
guard let usr = symbol.usr else { return [] }
17541754
logger.info("performing indexed jump-to-def with usr \(usr)")
1755-
var occurrences = index.definitionOrDeclarationOccurances(ofUSR: usr)
1755+
var occurrences = index.definitionOrDeclarationOccurrences(ofUSR: usr)
17561756
if symbol.isDynamic ?? true {
17571757
lazy var transitiveReceiverUsrs: [String]? = {
17581758
if let receiverUsrs = symbol.receiverUsrs {
@@ -1853,7 +1853,7 @@ extension SourceKitServer {
18531853
/// to get to the definition of `symbolUSR`.
18541854
///
18551855
/// `originatorUri` is the URI of the file from which the definition request is performed. It is used to determine the
1856-
/// compiler arguments to generate the generated inteface.
1856+
/// compiler arguments to generate the generated interface.
18571857
func definitionInInterface(
18581858
moduleName: String,
18591859
symbolUSR: String?,
@@ -1890,12 +1890,12 @@ extension SourceKitServer {
18901890
return nil
18911891
}
18921892
guard let usr = symbol.usr else { return nil }
1893-
var occurrances = index.occurrences(ofUSR: usr, roles: .baseOf)
1894-
if occurrances.isEmpty {
1895-
occurrances = index.occurrences(relatedToUSR: usr, roles: .overrideOf)
1893+
var occurrences = index.occurrences(ofUSR: usr, roles: .baseOf)
1894+
if occurrences.isEmpty {
1895+
occurrences = index.occurrences(relatedToUSR: usr, roles: .overrideOf)
18961896
}
18971897

1898-
return .locations(occurrances.compactMap { indexToLSPLocation($0.location) })
1898+
return .locations(occurrences.compactMap { indexToLSPLocation($0.location) })
18991899
}
19001900

19011901
func references(
@@ -1963,20 +1963,20 @@ extension SourceKitServer {
19631963

19641964
// Only return a single call hierarchy item. Returning multiple doesn't make sense because they will all have the
19651965
// same USR (because we query them by USR) and will thus expand to the exact same call hierarchy.
1966-
// Also, VS Code doesn't seem to like multiple call hiearchy items being returned and fails to display any results
1966+
// Also, VS Code doesn't seem to like multiple call hierarchy items being returned and fails to display any results
19671967
// if they are, failing with `Cannot read properties of undefined (reading 'map')`.
19681968
guard let definition = index.definitionOrDeclarationOccurrences(ofUSR: usr).first else {
19691969
return nil
19701970
}
19711971
guard let location = indexToLSPLocation(definition.location) else {
19721972
return nil
19731973
}
1974-
let callHierachyItem = self.indexToLSPCallHierarchyItem(
1974+
let callHierarchyItem = self.indexToLSPCallHierarchyItem(
19751975
symbol: definition.symbol,
19761976
moduleName: definition.location.moduleName,
19771977
location: location
19781978
)
1979-
return [callHierachyItem]
1979+
return [callHierarchyItem]
19801980
}
19811981

19821982
/// Extracts our implementation-specific data about a call hierarchy
@@ -2343,8 +2343,8 @@ fileprivate func transitiveSubtypeClosure(ofUsrs usrs: [String], index: IndexSto
23432343
var result: [String] = []
23442344
for usr in usrs {
23452345
result.append(usr)
2346-
let directSubtypes = index.occurrences(ofUSR: usr, roles: .baseOf).flatMap { occurance in
2347-
occurance.relations.filter { $0.roles.contains(.baseOf) }.map(\.symbol.usr)
2346+
let directSubtypes = index.occurrences(ofUSR: usr, roles: .baseOf).flatMap { occurrence in
2347+
occurrence.relations.filter { $0.roles.contains(.baseOf) }.map(\.symbol.usr)
23482348
}
23492349
let transitiveSubtypes = transitiveSubtypeClosure(ofUsrs: directSubtypes, index: index)
23502350
result += transitiveSubtypes

0 commit comments

Comments
 (0)