Skip to content

Commit

Permalink
removed basic telemetry checkbox, removed "--http", removed "--stderr"
Browse files Browse the repository at this point in the history
  • Loading branch information
olegklimov committed Jan 2, 2024
1 parent 2ffd984 commit 97ead1a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 36 deletions.
10 changes: 2 additions & 8 deletions MultilineGreyText/Options/General.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RefactAI{

//This uses visual studio toolkit to create an options page
//The GeneralOptions xaml file controls the presentation of the page
internal partial class OptionsProvider {
internal partial class OptionsProvider {
// Register the options with these attributes in your package class:
// [ProvideOptionPage(typeof(OptionsProvider.GeneralOptions), "My options", "General", 0, 0, true)]
// [ProvideProfile(typeof(OptionsProvider.GeneralOptions), "My options", "General", 0, 0, true)]
Expand Down Expand Up @@ -57,18 +57,12 @@ public class General : BaseOptionModel<General>{
[DefaultValue(false)]
public bool PauseCompletion{ get; set; } = false;

[Category("Refact Assistant")]
[DisplayName("Telemetry Basic")]
[Description("An informative description.")]
[DefaultValue(false)]
public bool TelemetryBasic{ get; set; } = false;

[Category("Refact Assistant")]
[DisplayName("Telemetry Code Snippets")]
[Description("An informative description.")]
[DefaultValue(false)]
public bool TelemetryCodeSnippets{ get; set; } = false;

//enters a message into the log when the options are saved
public General() : base(){
Saved += delegate { VS.StatusBar.ShowMessageAsync("Options Saved").FireAndForget(); };
Expand Down
11 changes: 3 additions & 8 deletions MultilineGreyText/Options/GeneralOptions.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<UserControl x:Class="RefactAI.GeneralOptions"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:RefactAI"
mc:Ignorable="d"
mc:Ignorable="d"
d:DesignHeight="742" d:DesignWidth="830.431"
FontSize="13"
>
Expand Down Expand Up @@ -47,11 +47,6 @@
IsThreeState="False"
Checked="pPauseCompletion_Checked" Unchecked="pPauseCompletion_Unchecked"/>

<TextBlock Margin="0 15 0 10">Refactai: <Bold>Telemetry Basic</Bold></TextBlock>
<CheckBox x:Name="pTelemetryBasic" Content="Send errors for debugging, human/robot character counters."
IsThreeState="False"
Checked="pTelemetryBasic_Checked" Unchecked="pTelemetryBasic_Unchecked"/>

<TextBlock Margin="0 15 0 10">Refactai: <Bold>Telemetry Code Snippets</Bold></TextBlock>
<CheckBox x:Name="pTelemetryCodeSnippets" Content="Send corrected code snippets."
IsThreeState="False"
Expand Down
17 changes: 2 additions & 15 deletions MultilineGreyText/Options/GeneralOptions.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@ namespace RefactAI{
/// <summary>
/// Interaction logic for GeneralOptions.xaml
/// </summary>
public partial class GeneralOptions : UserControl {
public partial class GeneralOptions : UserControl {

internal GeneralOptionPage generalOptionsPage;

public GeneralOptions() {
public GeneralOptions() {
InitializeComponent();
}

//Sets up all of the variables to display the current settings
public void Initialize(){
pPauseCompletion.IsChecked = General.Instance.PauseCompletion;
pTelemetryBasic.IsChecked = General.Instance.TelemetryBasic;
pTelemetryCodeSnippets.IsChecked = General.Instance.TelemetryCodeSnippets;

AddressURL.Text = General.Instance.AddressURL;
Expand All @@ -40,18 +39,6 @@ private void pPauseCompletion_Unchecked(object sender, System.Windows.RoutedEven
General.Instance.Save();
}

//telemetry checked
private void pTelemetryBasic_Checked(object sender, System.Windows.RoutedEventArgs e){
General.Instance.TelemetryBasic = (bool)pTelemetryBasic.IsChecked;
General.Instance.Save();
}

//telemetry unchecked
private void pTelemetryBasic_Unchecked(object sender, System.Windows.RoutedEventArgs e){
General.Instance.TelemetryBasic = (bool)pTelemetryBasic.IsChecked;
General.Instance.Save();
}

//code snippets checked
private void pTelemetryCodeSnippets_Checked(object sender, System.Windows.RoutedEventArgs e){
General.Instance.TelemetryCodeSnippets = (bool)pTelemetryCodeSnippets.IsChecked;
Expand Down
9 changes: 4 additions & 5 deletions MultilineGreyText/RefactLanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,17 @@ public async Task<Connection> ActivateAsync(CancellationToken token){
//get command line args for the lsp
String GetArgs(){
String args = "";
if (General.Instance.TelemetryBasic){
args += "--basic-telemetry ";
}
args += "--basic-telemetry ";

if (General.Instance.TelemetryCodeSnippets){
args += "--snippet-telemetry ";
}

args += "--address-url " + (String.IsNullOrWhiteSpace(General.Instance.AddressURL) ? "Refact" : General.Instance.AddressURL) + " ";
args += "--api-key " + (String.IsNullOrWhiteSpace(General.Instance.APIKey) ? "ZZZWWW" : General.Instance.APIKey) + " ";
args += "--api-key " + (String.IsNullOrWhiteSpace(General.Instance.APIKey) ? "vs-classic-no-key" : General.Instance.APIKey) + " ";
args += "--lsp-stdin-stdout 1";

return args + "--http-port 8001 --lsp-stdin-stdout 1 --logs-stderr";
return args;
}

//used to start loading lsp
Expand Down

0 comments on commit 97ead1a

Please sign in to comment.