diff --git a/.github/workflows/snapshot-eclipse-ls-extensions-build.yml b/.github/workflows/snapshot-eclipse-ls-extensions-build.yml index c0307c642..d2f9a7771 100644 --- a/.github/workflows/snapshot-eclipse-ls-extensions-build.yml +++ b/.github/workflows/snapshot-eclipse-ls-extensions-build.yml @@ -4,16 +4,16 @@ concurrency: group: eclipse-ls-extension-snapshot cancel-in-progress: true +# on: +# workflow_dispatch: on: - workflow_dispatch: -#on: -# push: -# branches: -# - 'main' + push: + branches: + - 'main' jobs: eclipse-ls-extensions: uses: ./.github/workflows/eclipse-ls-extensions-build.yml with: build_type: 'snapshot' - secrets: inherit \ No newline at end of file + secrets: inherit diff --git a/eclipse-extensions/org.springframework.ide.eclipse.boot.launch/src/org/springframework/ide/eclipse/boot/launch/BootLaunchConfigurationDelegate.java b/eclipse-extensions/org.springframework.ide.eclipse.boot.launch/src/org/springframework/ide/eclipse/boot/launch/BootLaunchConfigurationDelegate.java index 4c9224f9d..f22509a79 100644 --- a/eclipse-extensions/org.springframework.ide.eclipse.boot.launch/src/org/springframework/ide/eclipse/boot/launch/BootLaunchConfigurationDelegate.java +++ b/eclipse-extensions/org.springframework.ide.eclipse.boot.launch/src/org/springframework/ide/eclipse/boot/launch/BootLaunchConfigurationDelegate.java @@ -37,9 +37,12 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; +import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; import org.eclipse.jdt.launching.IRuntimeClasspathEntry; import org.eclipse.jdt.launching.JavaRuntime; @@ -518,9 +521,22 @@ public class BootLaunchConfigurationDelegate extends AbstractBootLaunchConfigura projectName+" - "+shortTypeName)); BootLaunchConfigurationDelegate.setDefaults(wc, project, typeName); wc.setMappedResources(new IResource[] {type.getUnderlyingResource()}); + wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_EXCLUDE_TEST_CODE, !isTestCode(type)); return wc; } + private static boolean isTestCode(IType type) throws JavaModelException { + IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type.getPackageFragment().getParent(); + IJavaProject javaProject = packageFragmentRoot.getJavaProject(); + if (javaProject != null) { + IClasspathEntry entry = javaProject.getClasspathEntryFor(packageFragmentRoot.getPath()); + if (entry != null && !entry.isTest()) { + return false; + } + } + return true; + } + public static ILaunchConfiguration createConf(IProject project) throws CoreException { return createConf(JavaCore.create(project)); } diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/NoRequestMappingAnnotationCodeAction.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/NoRequestMappingAnnotationCodeAction.java index 2a95eb75c..78103a2d4 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/NoRequestMappingAnnotationCodeAction.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/reconcile/NoRequestMappingAnnotationCodeAction.java @@ -48,9 +48,9 @@ public class NoRequestMappingAnnotationCodeAction implements RecipeCodeActionDes String uri = getCursor().firstEnclosing(SourceFile.class).getSourcePath().toUri().toASCIIString(); FixAssistMarker fixAssistMarker = new FixAssistMarker(Tree.randomId(), getId()) .withFixes( - new FixDescriptor(ID, List.of(uri), RecipeCodeActionDescriptor.buildLabel(LABEL, RecipeScope.NODE)) - .withRangeScope(a.getMarkers().findFirst(Range.class).get()) - .withRecipeScope(RecipeScope.NODE), +// new FixDescriptor(ID, List.of(uri), RecipeCodeActionDescriptor.buildLabel(LABEL, RecipeScope.NODE)) +// .withRangeScope(a.getMarkers().findFirst(Range.class).get()) +// .withRecipeScope(RecipeScope.NODE), new FixDescriptor(ID, List.of(uri), RecipeCodeActionDescriptor.buildLabel(LABEL, RecipeScope.FILE)) .withRecipeScope(RecipeScope.FILE), new FixDescriptor(ID, List.of(uri), RecipeCodeActionDescriptor.buildLabel(LABEL, RecipeScope.PROJECT))