Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fixed
  • Loading branch information
RoshanNagaram-eng committed Oct 4, 2024
commit 50df34cfed1e6fac9d8399c98366c2dab72ce85e
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ struct CompletionPart: Codable {
}

struct CodeiumDocument: Codable {
var absolute_path: String
// Path relative to the root of the workspace.
var relative_path: String
var absolute_path_migrate_me_to_uri: String
var text: String
// Language ID provided by the editor.
var editor_language: String
Expand Down
16 changes: 8 additions & 8 deletions Tool/Sources/CodeiumService/Services/CodeiumService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,14 @@ extension CodeiumService: CodeiumSuggestionServiceType {

requestCounter += 1
let languageId = languageIdentifierFromFileURL(fileURL)
let relativePath = getRelativePath(of: fileURL)
// let relativePath = getRelativePath(of: fileURL)

let task = Task {
let request = try await CodeiumRequest.GetCompletion(requestBody: .init(
metadata: getMetadata(),
document: .init(
absolute_path: fileURL.path,
relative_path: relativePath,
absolute_path_migrate_me_to_uri: fileURL.path,
// relative_path: relativePath,
text: content,
editor_language: languageId.rawValue,
language: .init(codeLanguage: languageId),
Expand All @@ -278,8 +278,8 @@ extension CodeiumService: CodeiumSuggestionServiceType {
.map { openedDocument in
let languageId = languageIdentifierFromFileURL(openedDocument.url)
return .init(
absolute_path: openedDocument.url.path,
relative_path: openedDocument.relativePath,
absolute_path_migrate_me_to_uri: openedDocument.url.path,
// relative_path: openedDocument.relativePath,
text: openedDocument.content,
editor_language: languageId.rawValue,
language: .init(codeLanguage: languageId)
Expand Down Expand Up @@ -417,11 +417,11 @@ extension CodeiumService: CodeiumSuggestionServiceType {
workspaceURL: URL
) async throws {
let languageId = languageIdentifierFromFileURL(fileURL)
let relativePath = getRelativePath(of: fileURL)
// let relativePath = getRelativePath(of: fileURL)
let request = await CodeiumRequest.RefreshContextForIdeAction(requestBody: .init(
active_document: .init(
absolute_path: fileURL.path,
relative_path: relativePath,
absolute_path_migrate_me_to_uri: fileURL.path,
// relative_path: relativePath,
text: content,
editor_language: languageId.rawValue,
language: .init(codeLanguage: languageId),
Expand Down