Merge branch 'main' into jdt-diagnostics-via-symbols

This commit is contained in:
aboyko
2023-08-22 14:19:20 -04:00
3 changed files with 25 additions and 9 deletions

View File

@@ -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
secrets: inherit

View File

@@ -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));
}

View File

@@ -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))