Skip to content

Commit 2dc6742

Browse files
committed
Rename CopilotLanguage to CodeLanguage and move to SuggestionModel
1 parent df9f937 commit 2dc6742

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

Core/Sources/GitHubCopilotService/GitHubCopilotRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct GitHubCopilotDoc: Codable {
1111
var path: String
1212
var uri: String
1313
var relativePath: String
14-
var languageId: CopilotLanguage
14+
var languageId: CodeLanguage
1515
var position: Position
1616
/// Buffer version. Not sure what this is for, not sure how to get it
1717
var version: Int = 0

Core/Sources/PromptToCodeService/CopilotPromptToCodeAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class CopilotPromptToCodeAPI: PromptToCodeAPI {
1212

1313
func modifyCode(
1414
code: String,
15-
language: CopilotLanguage,
15+
language: CodeLanguage,
1616
indentSize: Int,
1717
usesTabsForIndentation: Bool,
1818
requirement: String,

Core/Sources/PromptToCodeService/OpenAIPromptToCodeAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
1414

1515
func modifyCode(
1616
code: String,
17-
language: CopilotLanguage,
17+
language: CodeLanguage,
1818
indentSize: Int,
1919
usesTabsForIndentation: Bool,
2020
requirement: String,

Core/Sources/PromptToCodeService/PromptToCodeService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class PromptToCodeService: ObservableObject {
4747
@Published public var isContinuous = false
4848
public var canRevert: Bool { history != .empty }
4949
public var selectionRange: CursorRange
50-
public var language: CopilotLanguage
50+
public var language: CodeLanguage
5151
public var indentSize: Int
5252
public var usesTabsForIndentation: Bool
5353
public var projectRootURL: URL
@@ -58,7 +58,7 @@ public final class PromptToCodeService: ObservableObject {
5858
public init(
5959
code: String,
6060
selectionRange: CursorRange,
61-
language: CopilotLanguage,
61+
language: CodeLanguage,
6262
identSize: Int,
6363
usesTabsForIndentation: Bool,
6464
projectRootURL: URL,
@@ -143,7 +143,7 @@ public final class PromptToCodeService: ObservableObject {
143143
protocol PromptToCodeAPI {
144144
func modifyCode(
145145
code: String,
146-
language: CopilotLanguage,
146+
language: CodeLanguage,
147147
indentSize: Int,
148148
usesTabsForIndentation: Bool,
149149
requirement: String,

Core/Sources/Service/GUI/WidgetDataSource.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ final class WidgetDataSource {
8989
selectedCode: String,
9090
allCode: String,
9191
selectionRange: CursorRange,
92-
language: CopilotLanguage,
92+
language: CodeLanguage,
9393
identSize: Int = 4,
9494
usesTabsForIndentation: Bool = false,
9595
extraSystemPrompt: String?,

Core/Sources/GitHubCopilotService/LanguageIdentifierFromFilePath.swift renamed to Core/Sources/SuggestionModel/LanguageIdentifierFromFilePath.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22
import LanguageServerProtocol
33

4-
public enum CopilotLanguage: RawRepresentable, Codable {
4+
public enum CodeLanguage: RawRepresentable, Codable {
55
case builtIn(LanguageIdentifier)
66
case plaintext
77
case other(String)
@@ -246,7 +246,7 @@ let fileExtensionToLanguageId = {
246246
return dict
247247
}()
248248

249-
public func languageIdentifierFromFileURL(_ fileURL: URL) -> CopilotLanguage {
249+
public func languageIdentifierFromFileURL(_ fileURL: URL) -> CodeLanguage {
250250
let fileExtension = fileURL.pathExtension
251251
if let builtIn = fileExtensionToLanguageId[fileExtension] {
252252
return .builtIn(builtIn)

0 commit comments

Comments
 (0)