Skip to content

Commit

Permalink
Change name of cleanup identifier.
Browse files Browse the repository at this point in the history
Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
  • Loading branch information
rgrunber committed Mar 18, 2024
1 parent 6f0c589 commit a88ee95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public abstract class BaseDocumentLifeCycleHandler {

public static final String DOCUMENT_LIFE_CYCLE_JOBS = "DocumentLifeCycleJobs";
public static final String PUBLISH_DIAGNOSTICS_JOBS = "DocumentLifeCyclePublishDiagnosticsJobs";
public static final String RENAME_FILE_TO_TYPE = "renameFileToType";

/**
* The max & init value of adaptive debounce time for document lifecycle job.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ public void didSave(DidSaveTextDocumentParams params) {
lspCleanups = preferences.getCleanUpActions();
}

if (lspCleanups.contains("renameFile")) {
if (lspCleanups.contains(BaseDocumentLifeCycleHandler.RENAME_FILE_TO_TYPE)) {
computeAsync((monitor) -> {
DocumentLifeCycleHandler.handleFileRenameForTypeDeclaration(documentUri);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public List<TextEdit> willSaveWaitUntil(WillSaveTextDocumentParams params, IProg
Collection<String> jdtSettingCleanups = getCleanupsFromJDTUIPreferences(jdtUiPreferences);

cleanUpIds.addAll(canUseInternalSettings ? jdtSettingCleanups : lspCleanups);
cleanUpIds.remove("renameFile");
cleanUpIds.remove(BaseDocumentLifeCycleHandler.RENAME_FILE_TO_TYPE);
List<TextEdit> cleanUpEdits = cleanUpRegistry.getEditsForAllActiveCleanUps(params.getTextDocument(), new ArrayList<>(cleanUpIds), monitor);
edit.addAll(cleanUpEdits);
return edit;
Expand All @@ -103,7 +103,7 @@ public WorkspaceEdit performManualCleanupActions(TextDocumentIdentifier doc, IPr
Collection<String> jdtSettingCleanups = getCleanupsFromJDTUIPreferences(jdtUiPreferences);

cleanUpIds.addAll(canUseInternalSettings ? jdtSettingCleanups : lspCleanups);
cleanUpIds.remove("renameFile");
cleanUpIds.remove(BaseDocumentLifeCycleHandler.RENAME_FILE_TO_TYPE);
List<TextEdit> cleanUpEdits = cleanUpRegistry.getEditsForAllActiveCleanUps(doc, new ArrayList<>(cleanUpIds), monitor);
edit.addAll(cleanUpEdits);
Map<String, List<TextEdit>> editMap = new HashMap<>();
Expand Down

0 comments on commit a88ee95

Please sign in to comment.