Skip to content

Commit

Permalink
Revert redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
mkondratek committed Nov 28, 2024
1 parent d082e88 commit e2c81fc
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 2,161 deletions.
19 changes: 0 additions & 19 deletions src/main/java/com/sourcegraph/cody/Icons.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

public interface Icons {
Icon CodyLogo = IconLoader.getIcon("/icons/codyLogo.svg", Icons.class);
Icon HiImCody = IconLoader.getIcon("/icons/hiImCodyLogo.svg", Icons.class);

interface Actions {
Icon Add = IconLoader.getIcon("/icons/actions/huge_plus.svg", Icons.class);
Expand All @@ -26,26 +25,8 @@ interface StatusBar {
IconLoader.getIcon("/icons/codyLogoMonochromaticUnavailable.svg", Icons.class);
}

interface Onboarding {
Icon Autocomplete = IconLoader.getIcon("/icons/onboarding/autocomplete.svg", Icons.class);
Icon Chat = IconLoader.getIcon("/icons/onboarding/chat.svg", Icons.class);
Icon Commands = IconLoader.getIcon("/icons/onboarding/commands.svg", Icons.class);
}

interface SignIn {
Icon Github = IconLoader.getIcon("/icons/signIn/sign-in-logo-github.svg", Icons.class);
Icon Gitlab = IconLoader.getIcon("/icons/signIn/sign-in-logo-gitlab.svg", Icons.class);
Icon Google = IconLoader.getIcon("/icons/signIn/sign-in-logo-google.svg", Icons.class);
}

interface Chat {
Icon ChatLeaf = IconLoader.getIcon("/icons/chat/chatLeaf.svg", Icons.class);
Icon Download = IconLoader.getIcon("/icons/chat/download.svg", Icons.class);
}

interface Edit {
Icon Error = IconLoader.getIcon("/icons/edit/error.svg", Icons.class);
Icon Beta = IconLoader.getIcon("/icons/edit/beta.svg", Icons.class);
}

interface LLM {
Expand Down

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/java/com/sourcegraph/config/AccessTokenStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public static Optional<String> getEnterpriseAccessToken() {
return token;
}

public static void setApplicationEnterpriseAccessToken(@NotNull String accessToken) {
setApplicationLevelSecureConfig(enterpriseAccessTokenKeyParts, accessToken);
cachedEnterpriseAccessToken = accessToken;
}

// Empty string means empty or no token. No value means user denied access to token.
@NotNull
public static Optional<String> getDotComAccessToken() {
Expand All @@ -45,11 +40,6 @@ public static Optional<String> getDotComAccessToken() {
return token;
}

public static void setApplicationDotComAccessToken(@NotNull String accessToken) {
setApplicationLevelSecureConfig(dotComAccessTokenKeyParts, accessToken);
cachedDotComAccessToken = accessToken;
}

// Empty string means empty or no password. No value means user denied access to password.
@NotNull
private static Optional<String> getApplicationLevelSecureConfig(@NotNull List<String> keyParts) {
Expand All @@ -66,13 +56,6 @@ private static Optional<String> getApplicationLevelSecureConfig(@NotNull List<St
return Optional.of(password);
}

private static void setApplicationLevelSecureConfig(
@NotNull List<String> keyParts, @NotNull String accessToken) {
CredentialAttributes credentialAttributes = createCredentialAttributes(createKey(keyParts));
Credentials credentials = new Credentials(null, accessToken);
PasswordSafe.getInstance().set(credentialAttributes, credentials);
}

@NotNull
private static String createKey(@NotNull List<String> keyParts) {
return StringUtils.join(keyParts, ".");
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/sourcegraph/config/CodyProjectService.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,4 @@ public void loadState(@NotNull CodyProjectService settings) {
public String getEnterpriseAccessToken() {
return enterpriseAccessToken;
}

public boolean areChatPredictionsEnabled() {
// TODO: implement
return false;
}

public String getCodebase() {
// TODO: implement
return null;
}
}
4 changes: 0 additions & 4 deletions src/main/java/com/sourcegraph/config/UserLevelConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,4 @@ private static Properties readPropertiesFile(File file) throws IOException {

return properties;
}

public static boolean isVerboseLoggingEnabled() {
return Boolean.getBoolean("sourcegraph.verbose-logging");
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ package com.sourcegraph.cody.api

object SourcegraphGQLQueries {
const val getUserDetails = "graphql/query/getUserDetails.graphql"
const val getUserCodyProEnabled = "graphql/query/getUserCodyProEnabled.graphql"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.sourcegraph.cody.auth
import com.intellij.util.xmlb.annotations.Attribute
import com.intellij.util.xmlb.annotations.Tag
import com.sourcegraph.cody.config.SourcegraphParseException
import com.sourcegraph.config.ConfigUtil
import java.net.URI
import java.util.regex.Pattern

Expand All @@ -27,7 +26,6 @@ data class SourcegraphServerPath(
get() = URI.create(url).host

companion object {
const val DEFAULT_HOST = ConfigUtil.DOTCOM_URL

// 1 - schema, 2 - host, 4 - port, 5 - path
private val URL_REGEX =
Expand Down
29 changes: 0 additions & 29 deletions src/main/kotlin/com/sourcegraph/cody/chat/ui/UIComponents.kt

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/kotlin/com/sourcegraph/cody/error/CodyError.kt

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/kotlin/com/sourcegraph/cody/history/state/ChatState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package com.sourcegraph.cody.history.state
import com.intellij.openapi.components.BaseState
import com.intellij.util.xmlb.annotations.OptionTag
import com.intellij.util.xmlb.annotations.Tag
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

@Tag("chat")
class ChatState() : BaseState() {
Expand All @@ -31,24 +29,4 @@ class ChatState() : BaseState() {

@get:OptionTag(tag = "enhancedContext", nameAttribute = "")
var enhancedContext: EnhancedContextState? by property()

private var updatedAtDate: LocalDateTime? = null

fun title(): String? = messages.firstOrNull()?.text?.take(48)

fun setUpdatedTimeAt(date: LocalDateTime) {
updatedAtDate = date
updatedAt = date.format(DATE_FORMAT)
}

fun getUpdatedTimeAt(): LocalDateTime {
if (updatedAt == null) return LocalDateTime.now()
if (updatedAtDate == null) updatedAtDate = LocalDateTime.parse(updatedAt, DATE_FORMAT)
return updatedAtDate ?: LocalDateTime.now()
}

companion object {

private val DATE_FORMAT = DateTimeFormatter.ISO_LOCAL_DATE_TIME
}
}
18 changes: 0 additions & 18 deletions src/main/kotlin/com/sourcegraph/cody/ui/Colors.kt

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/kotlin/com/sourcegraph/common/AuthorizationUtil.kt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/resources/icons/chat/chatLeaf.svg

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/resources/icons/chat/download.svg

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/resources/icons/chat/download_dark.svg

This file was deleted.

Loading

0 comments on commit e2c81fc

Please sign in to comment.