Skip to content

Commit

Permalink
Progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjprescott committed Dec 10, 2024
1 parent ac0581b commit 818d841
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/swift/SwiftAPIViewCore/Sources/APIViewManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ public class APIViewManager: SyntaxVisitor {
}
config.packageName = packageName!
config.packageVersion = packageVersion!
let apiViewName = "\(packageName!) (version \(packageVersion!))"
let apiView = APIViewModel(name: apiViewName, packageName: packageName!, versionString: packageVersion!, statements: Array(statements.values))
let apiView = APIViewModel(packageName: packageName!, packageVersion: packageVersion!, statements: Array(statements.values))
return apiView
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class APIViewModel: Tokenizable, Encodable {
// FIXME: Actually wire this up!
self.crossLanguagePackageId = nil
self.tokenize(apiview: self, parent: nil)
model.navigationTokenize(apiview: self, parent: nil)
}

// MARK: Codable
Expand Down
7 changes: 4 additions & 3 deletions src/swift/SwiftAPIViewCore/Sources/Models/PackageModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ class PackageModel: Tokenizable, Linkable {
func resolveTypeReferences(apiview a: APIViewModel) {
for line in a.reviewLines {
for (idx, token) in line.tokens.enumerated() {
guard token.navigateToId == APIViewModel.unresolved else { continue }
line.tokens[idx].navigateToId = a.definitionId(for: token.value!, withParent: nil)
assert (line.tokens[idx].navigateToId != APIViewModel.unresolved)
// FIXME: Fix this up.
// guard token.navigateToId == APIViewModel.unresolved else { continue }
// line.tokens[idx].navigateToId = a.definitionId(for: token.value!, withParent: nil)
// assert (line.tokens[idx].navigateToId != APIViewModel.unresolved)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/swift/SwiftAPIViewCore/Sources/Models/ReviewLine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class ReviewLine: Tokenizable, Encodable {

/// Returns the text-based representation of all tokens
var text: String {
return tokens.map { $0.text }.joined()
var tokenText = tokens.map { $0.text }
tokenText.append("\n")
return tokenText.joined()
}

// MARK: Codable
Expand Down

0 comments on commit 818d841

Please sign in to comment.