Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete large number of files that duplicate files in jdt.core.manipulations #2947

Merged
merged 6 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions org.eclipse.jdt.ls.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ Export-Package: org.eclipse.jdt.ls.core.contentassist;x-friends:="org.eclipse.jd
org.eclipse.jdt.ls.core.internal.commands;x-friends:="org.eclipse.jdt.ls.tests",
org.eclipse.jdt.ls.core.internal.contentassist;x-friends:="org.eclipse.jdt.ls.tests",
org.eclipse.jdt.ls.core.internal.corext.refactoring;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.refactoring.changes;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.refactoring.code;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.refactoring.rename;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.refactoring.reorg;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.refactoring.util;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corext.template.java;x-friends:="org.eclipse.jdt.ls.tests",
org.eclipse.jdt.ls.core.internal.corext.util;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corrections;x-internal:=true,
org.eclipse.jdt.ls.core.internal.corrections.proposals;x-internal:=true,
org.eclipse.jdt.ls.core.internal.decompiler;x-friends:="org.eclipse.jdt.ls.tests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
import org.eclipse.jdt.core.dom.rewrite.ASTRewrite;
import org.eclipse.jdt.internal.corext.dom.IASTSharedValues;
import org.eclipse.jdt.internal.corext.refactoring.changes.CreateCompilationUnitChange;
import org.eclipse.jdt.internal.corext.refactoring.changes.MoveCompilationUnitChange;
import org.eclipse.jdt.internal.corext.refactoring.changes.RenameCompilationUnitChange;
import org.eclipse.jdt.internal.corext.refactoring.changes.RenamePackageChange;
import org.eclipse.jdt.internal.corext.refactoring.nls.changes.CreateFileChange;
import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil;
import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
import org.eclipse.jdt.ls.core.internal.corext.refactoring.changes.MoveCompilationUnitChange;
import org.eclipse.jdt.ls.core.internal.corext.refactoring.changes.RenameCompilationUnitChange;
import org.eclipse.jdt.ls.core.internal.corext.refactoring.changes.RenamePackageChange;
import org.eclipse.jdt.ls.core.internal.corext.refactoring.nls.changes.CreateFileChange;
import org.eclipse.lsp4j.AnnotatedTextEdit;
import org.eclipse.lsp4j.CreateFile;
import org.eclipse.lsp4j.CreateFileOptions;
Expand Down Expand Up @@ -162,10 +162,10 @@ private static void convertResourceChange(ResourceChange resourceChange, Workspa
convertRenamePackcageChange(edit, renamePackageChange, annotationId);
} else if (resourceChange instanceof MoveCompilationUnitChange moveCUChange) {
convertMoveCompilationUnitChange(edit, moveCUChange, annotationId);
} else if (resourceChange instanceof CreateFileChange createFileChange) {
convertCreateFileChange(edit, createFileChange);
} else if (resourceChange instanceof CreateCompilationUnitChange createCUChange) {
convertCreateCompilationUnitChange(edit, createCUChange, annotationId);
} else if (resourceChange instanceof CreateFileChange createFileChange) {
convertCreateFileChange(edit, createFileChange);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.manipulation.CUCorrectionProposalCore;
import org.eclipse.jdt.internal.ui.text.correction.IProposalRelevance;
import org.eclipse.jdt.ls.core.internal.ChangeUtil;
import org.eclipse.jdt.ls.core.internal.IConstants;
import org.eclipse.jdt.ls.core.internal.JDTUtils;
import org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin;
import org.eclipse.jdt.ls.core.internal.ResourceUtils;
import org.eclipse.jdt.ls.core.internal.TextEditConverter;
import org.eclipse.jdt.ls.core.internal.corrections.InnovationContext;
import org.eclipse.jdt.ls.core.internal.corrections.proposals.CUCorrectionProposal;
import org.eclipse.jdt.ls.core.internal.corrections.proposals.IProposalRelevance;
import org.eclipse.jdt.ls.core.internal.handlers.OrganizeImportsHandler;
import org.eclipse.lsp4j.CodeActionKind;
import org.eclipse.lsp4j.WorkspaceEdit;
import org.eclipse.ltk.core.refactoring.TextChange;
import org.eclipse.text.edits.TextEdit;
Expand Down Expand Up @@ -172,7 +171,8 @@ public void organizeImportsInPackageFragment(IPackageFragment fragment, Workspac
public void organizeImportsInCompilationUnit(ICompilationUnit unit, WorkspaceEdit rootEdit) {
try {
InnovationContext context = new InnovationContext(unit, 0, unit.getBuffer().getLength() - 1);
CUCorrectionProposal proposal = OrganizeImportsHandler.getOrganizeImportsProposal("OrganizeImports", CodeActionKind.SourceOrganizeImports, unit, IProposalRelevance.ORGANIZE_IMPORTS, context.getASTRoot(), false, false);
// kind: CodeActionKind.SourceOrganizeImports,
CUCorrectionProposalCore proposal = OrganizeImportsHandler.getOrganizeImportsProposal("OrganizeImports", unit, IProposalRelevance.ORGANIZE_IMPORTS, context.getASTRoot(), false, false);
if (proposal != null) {
addWorkspaceEdit(unit, proposal, rootEdit);
}
Expand Down Expand Up @@ -233,7 +233,7 @@ private void collectCompilationUnits(IPackageFragmentRoot root, Collection<IJava
}
}

private void addWorkspaceEdit(ICompilationUnit cu, CUCorrectionProposal proposal, WorkspaceEdit rootEdit) throws CoreException {
private void addWorkspaceEdit(ICompilationUnit cu, CUCorrectionProposalCore proposal, WorkspaceEdit rootEdit) throws CoreException {
TextChange textChange = proposal.getTextChange();
TextEdit edit = textChange.getEdit();
TextEditConverter converter = new TextEditConverter(cu, edit);
Expand Down

This file was deleted.

This file was deleted.

Loading