Skip to content

Commit

Permalink
Move file type association to info service package
Browse files Browse the repository at this point in the history
  • Loading branch information
Col-E committed Aug 12, 2023
1 parent 78cfa97 commit fa229f8
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.coley.recaf.services.text;
package software.coley.recaf.services.info;

import jakarta.annotation.Nonnull;
import jakarta.enterprise.context.ApplicationScoped;
Expand All @@ -14,7 +14,6 @@
import software.coley.recaf.ui.control.richtext.syntax.RegexLanguages;
import software.coley.recaf.ui.control.richtext.syntax.RegexRule;
import software.coley.recaf.ui.control.richtext.syntax.RegexSyntaxHighlighter;
import software.coley.recaf.util.StringUtil;

import static software.coley.recaf.util.StringUtil.*;

Expand Down Expand Up @@ -66,10 +65,10 @@ public void configureEditorSyntax(@Nonnull Info info, @Nonnull Editor editor) {
*/
public void configureEditorSyntax(@Nonnull String fileExtension, @Nonnull Editor editor) {
String lowerExtension = fileExtension.toLowerCase();
String mappedExtension = config.getExtensionsToLangKeys().getOrDefault(lowerExtension, lowerExtension);
String languageKey = config.getExtensionsToLangKeys().getOrDefault(lowerExtension, lowerExtension);

String sheet = LanguageStylesheets.getLanguageStylesheet(mappedExtension);
RegexRule language = RegexLanguages.getLanguage(mappedExtension);
String sheet = LanguageStylesheets.getLanguageStylesheet(languageKey);
RegexRule language = RegexLanguages.getLanguage(languageKey);

ObservableList<String> stylesheets = editor.getStylesheets();
if (sheet != null && !stylesheets.contains(sheet))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package software.coley.recaf.services.text;
package software.coley.recaf.services.info;

import jakarta.annotation.Nonnull;
import jakarta.enterprise.context.ApplicationScoped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import software.coley.recaf.services.script.ScriptFile;
import software.coley.recaf.services.script.ScriptManager;
import software.coley.recaf.services.script.ScriptManagerConfig;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.services.window.WindowFactory;
import software.coley.recaf.ui.config.KeybindingConfig;
import software.coley.recaf.ui.control.ActionButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import software.coley.recaf.services.navigation.Navigable;
import software.coley.recaf.services.navigation.UpdatableNavigable;
import software.coley.recaf.services.source.AstMappingVisitor;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.ui.control.BoundLabel;
import software.coley.recaf.ui.control.richtext.Editor;
import software.coley.recaf.ui.control.richtext.bracket.BracketMatchGraphicFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import software.coley.recaf.services.decompile.DecompilerManager;
import software.coley.recaf.services.navigation.Actions;
import software.coley.recaf.services.source.AstResolveResult;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.ui.config.KeybindingConfig;
import software.coley.recaf.ui.control.richtext.Editor;
import software.coley.recaf.ui.control.richtext.search.SearchBar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import software.coley.recaf.services.navigation.FileNavigable;
import software.coley.recaf.services.navigation.Navigable;
import software.coley.recaf.services.navigation.UpdatableNavigable;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.ui.control.richtext.Editor;
import software.coley.recaf.ui.control.richtext.bracket.BracketMatchGraphicFactory;
import software.coley.recaf.ui.control.richtext.bracket.SelectedBracketTracking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import software.coley.recaf.services.phantom.PhantomGenerationException;
import software.coley.recaf.services.phantom.PhantomGenerator;
import software.coley.recaf.services.source.AstResolveResult;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.ui.config.KeybindingConfig;
import software.coley.recaf.ui.control.BoundLabel;
import software.coley.recaf.ui.control.FontIconView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import software.coley.recaf.services.navigation.FileNavigable;
import software.coley.recaf.services.navigation.Navigable;
import software.coley.recaf.services.navigation.UpdatableNavigable;
import software.coley.recaf.services.text.FileTypeAssociationService;
import software.coley.recaf.services.info.FileTypeAssociationService;
import software.coley.recaf.ui.config.KeybindingConfig;
import software.coley.recaf.ui.control.richtext.Editor;
import software.coley.recaf.ui.control.richtext.bracket.BracketMatchGraphicFactory;
Expand Down

0 comments on commit fa229f8

Please sign in to comment.