Skip to content

Commit

Permalink
Remove Sourcegraph URL option
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Gołębiowski committed Jan 2, 2025
1 parent 35144e8 commit 1baaf5a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 36 deletions.
18 changes: 1 addition & 17 deletions src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<!--Sourcegraph URL-->
<Label
Grid.Row="0"
Grid.Column="0"
Content="Sourcegraph URL"
/>

<TextBox
Name="SourcegraphUrlTextBox"
Grid.Row="0"
Grid.Column="1"
Width="400"
Height="20"
Text="{Binding SourcegraphUrl, Mode=TwoWay}"
ToolTip="Enter the URL of the Sourcegraph instance. For example, https://sourcegraph.example.com"
/>

<!--Custom Cody Configuration-->
<StackPanel
Expand Down Expand Up @@ -90,7 +74,7 @@




</Grid>
</GroupBox>
</Grid>
Expand Down
1 change: 0 additions & 1 deletion src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public void ForceBindingsUpdate()
{
// TextBox binding doesn't work when Visual Studio closes Options window
// This is a workaround to get bindings updated. The second solution is to use NotifyPropertyChange for every TextBox in the Xaml, but current solution is a little more "clean" - everything is clearly visible in a one place.
SourcegraphUrlTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
CustomConfigurationTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
}
}
Expand Down
13 changes: 0 additions & 13 deletions src/Cody.UI/ViewModels/GeneralOptionsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ public string CustomConfiguration
}
}

private string _sourcegraphUrl;
public string SourcegraphUrl
{
get => _sourcegraphUrl;
set
{
if (SetProperty(ref _sourcegraphUrl, value))
{
_logger.Debug($"Sourcegraph Url set:{SourcegraphUrl}");
}
}
}

private bool _acceptNonTrustedCert;
public bool AcceptNonTrustedCert
{
Expand Down
5 changes: 0 additions & 5 deletions src/Cody.VisualStudio/Options/GeneralOptionsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ protected override void OnActivate(CancelEventArgs e)
_logger.Debug($"Settings page activated.");

var customConfiguration = _settingsService.CustomConfiguration;
var sourcegraphUrl = _settingsService.ServerEndpoint;
var acceptNonTrustedCert = _settingsService.AcceptNonTrustedCert;

_generalOptionsViewModel.SourcegraphUrl = sourcegraphUrl;
_generalOptionsViewModel.AcceptNonTrustedCert = acceptNonTrustedCert;
_generalOptionsViewModel.CustomConfiguration = customConfiguration;

Expand All @@ -74,11 +72,9 @@ protected override void OnApply(PageApplyEventArgs args)
_logger.Debug($"{args.ApplyBehavior}");

var customConfiguration = _generalOptionsViewModel.CustomConfiguration;
var sourcegraphUrl = _generalOptionsViewModel.SourcegraphUrl;
var acceptNonTrustedCert = _generalOptionsViewModel.AcceptNonTrustedCert;

_settingsService.CustomConfiguration = customConfiguration;
_settingsService.ServerEndpoint = sourcegraphUrl;
_settingsService.AcceptNonTrustedCert = acceptNonTrustedCert;
}

Expand All @@ -99,7 +95,6 @@ protected override void OnClosed(EventArgs e)
public override void ResetSettings()
{
_settingsService.CustomConfiguration = string.Empty;
_settingsService.ServerEndpoint = string.Empty;
_settingsService.AcceptNonTrustedCert = false;

base.ResetSettings();
Expand Down

0 comments on commit 1baaf5a

Please sign in to comment.