mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-04 14:40:53 +00:00
feat: improved multi-line edits (#923)
* fix: llama.cpp copy task * feat: next edit predictions * feat: minor clean up
This commit is contained in:
parent
c75fad5ec7
commit
5f58880884
26 changed files with 384 additions and 366 deletions
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
public class TelemetryConfiguration extends CompositeConfiguration {
|
||||
|
||||
public static final String KEY_MODE = "ee.carlrobert.telemetry.mode";
|
||||
public static final String KEY_COMPLETION_TELEMETRY_ENABLED = "ee.carlrobert.telemetry.completionStatisticsEnabled";
|
||||
|
||||
private static final SaveableFileConfiguration FILE = new SaveableFileConfiguration(
|
||||
Directories.PATH.resolve("ee.carlrobert.intellij.telemetry"));
|
||||
|
|
@ -50,6 +51,14 @@ public class TelemetryConfiguration extends CompositeConfiguration {
|
|||
setMode(Mode.valueOf(enabled));
|
||||
}
|
||||
|
||||
public boolean isCompletionTelemetryEnabled() {
|
||||
return Boolean.parseBoolean(get(KEY_COMPLETION_TELEMETRY_ENABLED));
|
||||
}
|
||||
|
||||
public void setCompletionTelemetryEnabled(boolean enabled) {
|
||||
put(KEY_COMPLETION_TELEMETRY_ENABLED, String.valueOf(enabled));
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return getMode() == Mode.DEBUG;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,19 +21,27 @@ import javax.swing.JPanel;
|
|||
*/
|
||||
public class TelemetryComponent {
|
||||
|
||||
private static final String DESCRIPTION =
|
||||
private static final String USAGE_DESCRIPTION =
|
||||
"Help ProxyAI improve its products by sending anonymous data about features and plugins used, "
|
||||
+ "hardware and software configuration.<br/>"
|
||||
+ "<br/>"
|
||||
+ "Please note that this will not include personal data or any sensitive Information.<br/>"
|
||||
+ "Please note that this will not include personal data or any sensitive Information.";
|
||||
|
||||
private static final String COMPLETION_DESCRIPTION =
|
||||
"Help ProxyAI improve its products by sharing your code inputs and completions.<br/>"
|
||||
+ "<br/>"
|
||||
+ "The data sent complies with the <a href=\"https://tryproxy.io/privacy\">Privacy Policy</a>.";
|
||||
|
||||
private final JPanel panel;
|
||||
private final JBCheckBox enabled = new JBCheckBox("Send usage statistics");
|
||||
private final JBCheckBox usageStatisticsEnabled = new JBCheckBox("Send usage statistics");
|
||||
private final JBCheckBox completionStatisticsEnabled = new JBCheckBox("Send completion statistics");
|
||||
|
||||
public TelemetryComponent() {
|
||||
this.panel = FormBuilder.createFormBuilder()
|
||||
.addComponent(createCommentedPanel(enabled, DESCRIPTION), 1)
|
||||
.addComponent(
|
||||
createCommentedPanel(usageStatisticsEnabled, USAGE_DESCRIPTION), 1)
|
||||
.addComponent(
|
||||
createCommentedPanel(completionStatisticsEnabled, COMPLETION_DESCRIPTION), 1)
|
||||
.addComponentFillVertically(new JPanel(), 0)
|
||||
.getPanel();
|
||||
}
|
||||
|
|
@ -50,15 +58,22 @@ public class TelemetryComponent {
|
|||
}
|
||||
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
return enabled;
|
||||
return usageStatisticsEnabled;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled.isSelected();
|
||||
public boolean getUsageStatisticsEnabled() {
|
||||
return usageStatisticsEnabled.isSelected();
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled.setSelected(enabled);
|
||||
public void setUsageStatisticsEnabled(boolean usageStatisticsEnabled) {
|
||||
this.usageStatisticsEnabled.setSelected(usageStatisticsEnabled);
|
||||
}
|
||||
|
||||
public boolean getCompletionStatisticsEnabled() {
|
||||
return completionStatisticsEnabled.isSelected();
|
||||
}
|
||||
|
||||
public void setCompletionStatisticsEnabled(boolean completionStatisticsEnabled) {
|
||||
this.completionStatisticsEnabled.setSelected(completionStatisticsEnabled);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,13 +53,15 @@ public class TelemetryConfigurable implements SearchableConfigurable {
|
|||
@Override
|
||||
public boolean isModified() {
|
||||
boolean modified = false;
|
||||
modified |= (component.isEnabled() != configuration.isEnabled());
|
||||
modified |= (component.getUsageStatisticsEnabled() != configuration.isEnabled());
|
||||
modified |= (component.getCompletionStatisticsEnabled() != configuration.isCompletionTelemetryEnabled());
|
||||
return modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
configuration.setEnabled(component.isEnabled());
|
||||
configuration.setEnabled(component.getUsageStatisticsEnabled());
|
||||
configuration.setCompletionTelemetryEnabled(component.getCompletionStatisticsEnabled());
|
||||
try {
|
||||
configuration.save();
|
||||
} catch (IOException e) {
|
||||
|
|
@ -69,7 +71,8 @@ public class TelemetryConfigurable implements SearchableConfigurable {
|
|||
|
||||
@Override
|
||||
public void reset() {
|
||||
component.setEnabled(configuration.isEnabled());
|
||||
component.setUsageStatisticsEnabled(configuration.isEnabled());
|
||||
component.setCompletionStatisticsEnabled(configuration.isCompletionTelemetryEnabled());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue