Skip to content

Commit 7d34ed2

Browse files
committed
Prepare for Windsurf "Explain With AI..." support
1 parent 0f9baf9 commit 7d34ed2

File tree

2 files changed

+12
-12
lines changed
  • headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers
  • vscode-extensions/vscode-spring-boot/lib/copilot

2 files changed

+12
-12
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/handlers/QueryType.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package org.springframework.ide.vscode.boot.java.handlers;
22

33
public enum QueryType {
4-
SPEL("Explain SpEL Expression with Copilot", "Explain the following SpEL Expression with a clear summary first, followed by a breakdown of the expression with details: \n\n"),
5-
JPQL("Explain Query with Copilot", "Explain the following JPQL query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
6-
HQL("Explain Query with Copilot", "Explain the following HQL query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
7-
MONGODB("Explain Query with Copilot", "Explain the following MongoDB query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
8-
AOP("Explain AOP annotation with Copilot", "Explain the following AOP annotation with a clear summary first, followed by a detailed contextual explanation of annotation and its purpose: \n\n"),
9-
DEFAULT("Explain Query with Copilot", "Explain the following query with a clear summary first, followed by a detailed explanation: \n\n");
4+
SPEL("Explain SpEL Expression with AI", "Explain the following SpEL Expression with a clear summary first, followed by a breakdown of the expression with details: \n\n"),
5+
JPQL("Explain Query with AI", "Explain the following JPQL query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
6+
HQL("Explain Query with AI", "Explain the following HQL query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
7+
MONGODB("Explain Query with AI", "Explain the following MongoDB query with a clear summary first, followed by a detailed explanation. If the query contains any SpEL expressions, explain those parts as well: \n\n"),
8+
AOP("Explain AOP annotation with AI", "Explain the following AOP annotation with a clear summary first, followed by a detailed contextual explanation of annotation and its purpose: \n\n"),
9+
DEFAULT("Explain Query with AI", "Explain the following query with a clear summary first, followed by a detailed explanation: \n\n");
1010

1111
private final String title;
1212
private final String prompt;

vscode-extensions/vscode-spring-boot/lib/copilot/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export async function activateCopilotFeatures(context: ExtensionContext): Promis
2323
}
2424

2525
async function configureGenAi() {
26-
if (isCursor) {
27-
updateConfigurationForCursor();
26+
if (isCursor() || isWindSurf()) {
27+
await updateConfiguration(true)
2828
} else {
2929
await ensureExtensionInstalledAndActivated();
3030
await updateConfigurationBasedOnCopilotAccess();
@@ -35,6 +35,10 @@ function isCursor() {
3535
return env.appName === 'Cursor';
3636
}
3737

38+
function isWindSurf() {
39+
return env.appName === 'Windsurf';
40+
}
41+
3842
async function ensureExtensionInstalledAndActivated() {
3943
if (!isExtensionInstalled(REQUIRED_EXTENSION)) {
4044
logger.error(`Required extension ${REQUIRED_EXTENSION} is not installed.`);
@@ -84,10 +88,6 @@ async function updateConfigurationBasedOnCopilotAccess() {
8488
}
8589
}
8690

87-
async function updateConfigurationForCursor() {
88-
await updateConfiguration(true)
89-
}
90-
9191
async function updateConfiguration(value: boolean) {
9292
const configValue = workspace.getConfiguration().get('boot-java.highlight-copilot-codelens.on');
9393
if(value && configValue === true) {

0 commit comments

Comments
 (0)