Skip to content

Commit 10ed00f

Browse files
committed
Address comments.
1 parent 1480706 commit 10ed00f

16 files changed

Lines changed: 391 additions & 375 deletions

File tree

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ private Constants() {
1818

1919
public static final String PLUGIN_ID = "com.microsoft.copilot.eclipse";
2020
public static final String AUTO_SHOW_COMPLETION = "enableAutoCompletions";
21-
public static final String USAGE_ALERT_THRESHOLD = "usageAlertThreshold";
2221
public static final String ENABLE_NEXT_EDIT_SUGGESTION = "enableNextEditSuggestion";
2322
public static final String ENABLE_STRICT_SSL = "enableStrictSsl";
2423
public static final String PROXY_KERBEROS_SP = "proxyKerberosSp";

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotLanguageServerSettings.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,6 @@ public static class CopilotSettings {
278278

279279
private CopilotAgentSettings agent;
280280

281-
private int usageAlertThreshold;
282-
283281
/**
284282
* Constructor.
285283
*/
@@ -322,29 +320,19 @@ public void setAgent(CopilotAgentSettings agent) {
322320
this.agent = agent;
323321
}
324322

325-
public int getUsageAlertThreshold() {
326-
return usageAlertThreshold;
327-
}
328-
329-
public void setUsageAlertThreshold(int usageAlertThreshold) {
330-
this.usageAlertThreshold = usageAlertThreshold;
331-
}
332-
333323
@Override
334324
public String toString() {
335325
ToStringBuilder builder = new ToStringBuilder(this);
336326
builder.append("mcpServers", mcpServers);
337327
builder.append("workspaceCopilotInstructions", workspaceCopilotInstructions);
338328
builder.append("gitCommitCopilotInstructions", gitCommitCopilotInstructions);
339329
builder.append("agent", agent);
340-
builder.append("usageAlertThreshold", usageAlertThreshold);
341330
return builder.toString();
342331
}
343332

344333
@Override
345334
public int hashCode() {
346-
return Objects.hash(agent, gitCommitCopilotInstructions, mcpServers, usageAlertThreshold,
347-
workspaceCopilotInstructions);
335+
return Objects.hash(agent, gitCommitCopilotInstructions, mcpServers, workspaceCopilotInstructions);
348336
}
349337

350338
@Override
@@ -358,7 +346,7 @@ public boolean equals(Object obj) {
358346
CopilotSettings other = (CopilotSettings) obj;
359347
return Objects.equals(agent, other.agent)
360348
&& Objects.equals(gitCommitCopilotInstructions, other.gitCommitCopilotInstructions)
361-
&& Objects.equals(mcpServers, other.mcpServers) && usageAlertThreshold == other.usageAlertThreshold
349+
&& Objects.equals(mcpServers, other.mcpServers)
362350
&& Objects.equals(workspaceCopilotInstructions, other.workspaceCopilotInstructions);
363351
}
364352
}

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/quota/CheckQuotaResult.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ public class CheckQuotaResult {
1111
private Quota chat;
1212
private Quota completions;
1313
private Quota premiumInteractions;
14+
15+
/**
16+
* Quota usage for the 5-hour rolling interval (session limit). Only included for CFI (Copilot for Individuals)
17+
* token-based billing users
18+
*/
1419
private TbbQuota immediateUsageInterval;
20+
21+
/**
22+
* Quota usage for the 7-day rolling interval (weekly limit). Only included for CFI (Copilot for Individuals)
23+
* token-based billing users (all CFI plans).
24+
*/
1525
private TbbQuota extendedUsageInterval;
1626
private String resetDate;
1727
private String resetDateUtc;
@@ -101,8 +111,7 @@ public boolean equals(Object obj) {
101111
CheckQuotaResult other = (CheckQuotaResult) obj;
102112
return Objects.equals(chat, other.chat) && Objects.equals(completions, other.completions)
103113
&& copilotPlan == other.copilotPlan && Objects.equals(premiumInteractions, other.premiumInteractions)
104-
&& Objects.equals(resetDate, other.resetDate)
105-
&& Objects.equals(resetDateUtc, other.resetDateUtc)
114+
&& Objects.equals(resetDate, other.resetDate) && Objects.equals(resetDateUtc, other.resetDateUtc)
106115
&& Objects.equals(immediateUsageInterval, other.immediateUsageInterval)
107116
&& Objects.equals(extendedUsageInterval, other.extendedUsageInterval);
108117
}

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/quota/Quota.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class Quota {
1212
private double percentRemaining;
1313
private boolean unlimited;
1414
private boolean overagePermitted;
15+
@SerializedName("overage_count")
16+
private int overageCount;
1517
private int entitlement;
1618
private int quotaRemaining;
1719
@SerializedName("timeStamp")
@@ -49,6 +51,14 @@ public void setOveragePermitted(boolean overagePermitted) {
4951
this.overagePermitted = overagePermitted;
5052
}
5153

54+
public int getOverageCount() {
55+
return overageCount;
56+
}
57+
58+
public void setOverageCount(int overageCount) {
59+
this.overageCount = overageCount;
60+
}
61+
5262
public int getEntitlement() {
5363
return entitlement;
5464
}
@@ -75,7 +85,8 @@ public void setTimestamp(String timestamp) {
7585

7686
@Override
7787
public int hashCode() {
78-
return Objects.hash(entitlement, overagePermitted, percentRemaining, quotaRemaining, timestamp, unlimited);
88+
return Objects.hash(entitlement, overagePermitted, overageCount, percentRemaining, quotaRemaining, timestamp,
89+
unlimited);
7990
}
8091

8192
@Override
@@ -89,8 +100,8 @@ public boolean equals(Object obj) {
89100
Quota other = (Quota) obj;
90101
return Double.doubleToLongBits(percentRemaining) == Double.doubleToLongBits(other.percentRemaining)
91102
&& unlimited == other.unlimited && overagePermitted == other.overagePermitted
92-
&& entitlement == other.entitlement && quotaRemaining == other.quotaRemaining
93-
&& Objects.equals(timestamp, other.timestamp);
103+
&& overageCount == other.overageCount && entitlement == other.entitlement
104+
&& quotaRemaining == other.quotaRemaining && Objects.equals(timestamp, other.timestamp);
94105
}
95106

96107
@Override
@@ -99,6 +110,7 @@ public String toString() {
99110
builder.append("percentRemaining", percentRemaining);
100111
builder.append("unlimited", unlimited);
101112
builder.append("overagePermitted", overagePermitted);
113+
builder.append("overageCount", overageCount);
102114
builder.append("entitlement", entitlement);
103115
builder.append("quotaRemaining", quotaRemaining);
104116
builder.append("timestamp", timestamp);

com.microsoft.copilot.eclipse.ui/css/dark.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216

217217
/* Action items in dropdown popups */
218218
#popup-item-default Label.popup-action-text,
219-
#popup-item-selected Label.popup-action-text {
219+
#popup-item-selected Label.popup-action-text,
220+
#dropdown-popup Label.popup-action-text {
220221
color: #74A7DC;
221222
}

com.microsoft.copilot.eclipse.ui/css/light.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216

217217
/* Action items in dropdown popups */
218218
#popup-item-default Label.popup-action-text,
219-
#popup-item-selected Label.popup-action-text {
219+
#popup-item-selected Label.popup-action-text,
220+
#dropdown-popup Label.popup-action-text {
220221
color: #286EC5;
221222
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferenceInitializer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public void initializeDefaultPreferences() {
2929
pref.setDefault(Constants.CUSTOM_INSTRUCTIONS_WORKSPACE_ENABLED, false);
3030
pref.setDefault(Constants.CUSTOM_INSTRUCTIONS_WORKSPACE, "");
3131
pref.setDefault(Constants.AUTO_BREAKPOINT_RESPONSE, false);
32-
pref.setDefault(Constants.USAGE_ALERT_THRESHOLD, 90);
3332
pref.setDefault(Constants.MCP, """
3433
{
3534
"servers": {

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferencesPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected Control createContents(Composite parent) {
3535
McpPreferencePage.ID);
3636
PreferencePageUtils.createPreferenceLink(getShell(), container, "<a>Model Management</a>", null,
3737
ByokPreferencePage.ID);
38-
PreferencePageUtils.createPreferenceLink(getShell(), container, "<a>Usage Status</a>", null,
38+
PreferencePageUtils.createPreferenceLink(getShell(), container, "<a>Usage</a>", null,
3939
UsageStatusPreferencePage.ID);
4040
return container;
4141
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManager.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ public LanguageServerSettingManager(CopilotLanguageServerConnection conn, IProxy
7575
getSettings().getHttp().setProxyStrictSsl(preferenceStore.getBoolean(Constants.ENABLE_STRICT_SSL));
7676
getSettings().getHttp().setProxyKerberosServicePrincipal(preferenceStore.getString(Constants.PROXY_KERBEROS_SP));
7777
getSettings().getGithubEnterprise().setUri(preferenceStore.getString(Constants.GITHUB_ENTERPRISE));
78-
getSettings().getGithubSettings().getCopilotSettings()
79-
.setUsageAlertThreshold(preferenceStore.getInt(Constants.USAGE_ALERT_THRESHOLD));
8078

8179
// agent related settings
8280
getSettings().getGithubSettings().getCopilotSettings().getAgent()
@@ -167,11 +165,6 @@ public void propertyChange(PropertyChangeEvent event) {
167165
.setAgentMaxRequests(preferenceStore.getInt(Constants.AGENT_MAX_REQUESTS));
168166
singleSetting = new CopilotLanguageServerSettings(null, null, null, settings.getGithubSettings());
169167
break;
170-
case Constants.USAGE_ALERT_THRESHOLD:
171-
settings.getGithubSettings().getCopilotSettings()
172-
.setUsageAlertThreshold(preferenceStore.getInt(Constants.USAGE_ALERT_THRESHOLD));
173-
singleSetting = new CopilotLanguageServerSettings(null, null, null, settings.getGithubSettings());
174-
break;
175168
default:
176169
return;
177170
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/Messages.java

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -151,34 +151,39 @@ public class Messages extends NLS {
151151
public static String setting_managed_by_organization;
152152
public static String setting_disabled_by_organization;
153153

154-
// Usage Status
155-
public static String usage_status_account;
156-
public static String usage_status_account_label;
157-
public static String usage_status_plan_prefix;
158-
public static String usage_status_plan_free;
159-
public static String usage_status_plan_pro;
160-
public static String usage_status_plan_pro_plus;
161-
public static String usage_status_plan_business;
162-
public static String usage_status_plan_enterprise;
163-
public static String usage_status_plan_unknown;
164-
public static String usage_status_upgrade_plan;
165-
public static String usage_status_configure_overage;
166-
public static String usage_status_copilot_usage;
167-
public static String usage_status_session_limit;
168-
public static String usage_status_session_limit_description;
169-
public static String usage_status_weekly_limit;
170-
public static String usage_status_weekly_limit_description;
171-
public static String usage_status_monthly_limit;
172-
public static String usage_status_not_signed_in;
173-
public static String usage_status_no_monthly_limit;
174-
public static String usage_status_resets_in;
175-
public static String usage_status_resets_on_at;
176-
public static String usage_status_alert_threshold;
177-
public static String usage_status_duration_hours_mins;
178-
public static String usage_status_duration_hour_mins;
179-
public static String usage_status_duration_hours;
180-
public static String usage_status_duration_hour;
181-
public static String usage_status_duration_mins;
154+
// Usage
155+
public static String usage_plan_free;
156+
public static String usage_plan_pro;
157+
public static String usage_plan_pro_plus;
158+
public static String usage_plan_max;
159+
public static String usage_plan_business;
160+
public static String usage_plan_enterprise;
161+
public static String usage_plan_unknown;
162+
public static String usage_upgrade_plan;
163+
public static String usage_manage_budget;
164+
public static String usage_copilot_usage;
165+
public static String usage_session_limit;
166+
public static String usage_session_limit_description;
167+
public static String usage_weekly_limit;
168+
public static String usage_weekly_limit_description;
169+
public static String usage_monthly_limit;
170+
public static String usage_monthly_limit_description;
171+
public static String usage_percentage_suffix;
172+
public static String usage_overage_configured;
173+
public static String usage_overage_spend_tooltip;
174+
public static String usage_overage_not_configured;
175+
public static String usage_not_signed_in;
176+
public static String usage_no_monthly_limit;
177+
public static String usage_no_session_limit;
178+
public static String usage_no_weekly_limit;
179+
public static String usage_resets_in;
180+
public static String usage_resets_on_at;
181+
public static String usage_resets_no_usage_yet;
182+
public static String usage_duration_hours_mins;
183+
public static String usage_duration_hour_mins;
184+
public static String usage_duration_hours;
185+
public static String usage_duration_hour;
186+
public static String usage_duration_mins;
182187

183188
static {
184189
// initialize resource bundle

0 commit comments

Comments
 (0)