From ff7a08730bdffa464ea2517b3425af27335d5138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Tue, 16 Jul 2024 16:27:16 +0200 Subject: [PATCH] Revert "Cody: add support for neovim, cody-cli, eclipse, and visualstudio clients (#63854) This reverts commit 00d812c1760a00fdbb83fa6167421b40a598e864. The motivation to revert this commit is because it wasn't a good fix and I want to have an easy-to-cherry-pick commit with a good fix (which I have ready in another branch). ## Test plan Green CI. ## Changelog --- .../internal/httpapi/completions/handler.go | 14 +------------- .../internal/httpapi/completions/handler_test.go | 10 +--------- internal/completions/types/types.go | 10 +++------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/cmd/frontend/internal/httpapi/completions/handler.go b/cmd/frontend/internal/httpapi/completions/handler.go index df60b6dff11..d486d608b74 100644 --- a/cmd/frontend/internal/httpapi/completions/handler.go +++ b/cmd/frontend/internal/httpapi/completions/handler.go @@ -561,10 +561,6 @@ func checkClientCodyIgnoreCompatibility(ctx context.Context, db database.DB, r * } var cvc clientVersionConstraint switch clientName { - case types.CodyClientEclipse: - case types.CodyClientVisualStudio: - case types.CodyClientNeovim: - case types.CodyClientCli: case types.CodyClientWeb: // Cody Web is of the same version as the Sourcegraph instance, thus no version constraint is needed. return nil @@ -582,15 +578,7 @@ func checkClientCodyIgnoreCompatibility(ctx context.Context, db database.DB, r * } default: return &codyIgnoreCompatibilityError{ - reason: fmt.Sprintf("please use one of the supported clients: %s, %s, %s, %s, %s, %s, %s.", - types.CodyClientVscode, - types.CodyClientJetbrains, - types.CodyClientWeb, - types.CodyClientEclipse, - types.CodyClientCli, - types.CodyClientVisualStudio, - types.CodyClientNeovim, - ), + reason: fmt.Sprintf("please use one of the supported clients: %s, %s, %s.", types.CodyClientVscode, types.CodyClientJetbrains, types.CodyClientWeb), statusCode: http.StatusNotAcceptable, } } diff --git a/cmd/frontend/internal/httpapi/completions/handler_test.go b/cmd/frontend/internal/httpapi/completions/handler_test.go index 40ca337adc8..7623286ae8e 100644 --- a/cmd/frontend/internal/httpapi/completions/handler_test.go +++ b/cmd/frontend/internal/httpapi/completions/handler_test.go @@ -84,15 +84,7 @@ func TestCheckClientCodyIgnoreCompatibility(t *testing.T) { "client-name": []string{"sublime"}, }, want: &codyIgnoreCompatibilityError{ - reason: fmt.Sprintf("please use one of the supported clients: %s, %s, %s, %s, %s, %s, %s.", - types.CodyClientVscode, - types.CodyClientJetbrains, - types.CodyClientWeb, - types.CodyClientEclipse, - types.CodyClientCli, - types.CodyClientVisualStudio, - types.CodyClientNeovim, - ), + reason: fmt.Sprintf("please use one of the supported clients: %s, %s, %s.", types.CodyClientVscode, types.CodyClientJetbrains, types.CodyClientWeb), statusCode: http.StatusNotAcceptable, }, }, diff --git a/internal/completions/types/types.go b/internal/completions/types/types.go index 469b158fd4c..e4cb87e774b 100644 --- a/internal/completions/types/types.go +++ b/internal/completions/types/types.go @@ -262,13 +262,9 @@ const ( type CodyClientName string const ( - CodyClientWeb CodyClientName = "web" - CodyClientVscode CodyClientName = "vscode" - CodyClientJetbrains CodyClientName = "jetbrains" - CodyClientEclipse CodyClientName = "eclipse" - CodyClientVisualStudio CodyClientName = "visualstudio" - CodyClientNeovim CodyClientName = "neovim" - CodyClientCli CodyClientName = "cody-cli" + CodyClientWeb CodyClientName = "web" + CodyClientVscode CodyClientName = "vscode" + CodyClientJetbrains CodyClientName = "jetbrains" ) type CompletionRequest struct {