Skip to content

Commit

Permalink
cleanup redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
YannCebron committed Oct 9, 2024
1 parent c9595dc commit c248402
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/org/intellij/grammar/BnfASTFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
final class BnfASTFactory extends ASTFactory {

Check warning on line 17 in src/org/intellij/grammar/BnfASTFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Class is closed to inheritance

Class 'BnfASTFactory' declared `final`

@Override
public @Nullable CompositeElement createComposite(@NotNull IElementType type) {
public CompositeElement createComposite(@NotNull IElementType type) {
return BnfTypes.Factory.createElement(type);
}
}
20 changes: 0 additions & 20 deletions src/org/intellij/grammar/BnfDocumentationProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
*/
final class BnfDocumentationProvider implements DocumentationProvider {

Check warning on line 33 in src/org/intellij/grammar/BnfDocumentationProvider.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Class is closed to inheritance

Class 'BnfDocumentationProvider' declared `final`

@Override
public @Nullable String getQuickNavigateInfo(PsiElement element, PsiElement originalElement) {
return null;
}

@Override
public @Nullable List<String> getUrlFor(PsiElement element, PsiElement originalElement) {
return null;
}

@Override
public @Nullable String generateDoc(PsiElement element, PsiElement originalElement) {
if (element instanceof BnfRule) {
Expand Down Expand Up @@ -89,16 +79,6 @@ else if (element instanceof BnfAttr) {
return null;
}

@Override
public @Nullable PsiElement getDocumentationElementForLookupItem(PsiManager psiManager, Object obj5ect, PsiElement element) {
return null;
}

@Override
public @Nullable PsiElement getDocumentationElementForLink(PsiManager psiManager, String link, PsiElement context) {
return null;
}

private static void dumpContents(StringBuilder docBuilder, BnfRule rule, BnfFile file) {
Map<PsiElement, RuleGraphHelper.Cardinality> map = RuleGraphHelper.getCached(file).getFor(rule);
Collection<BnfRule> sortedPublicRules = ParserGeneratorUtil.getSortedPublicRules(map.keySet());
Expand Down
12 changes: 2 additions & 10 deletions src/org/intellij/grammar/livePreview/LivePreviewFileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private LivePreviewFileType() {
return "BNF_LP";
}

@SuppressWarnings("DialogTitleCapitalization")
@Override
public @NotNull String getDescription() {
return GrammarKitBundle.message("language.name.bnf.live.preview");
Expand All @@ -40,17 +41,8 @@ private LivePreviewFileType() {
}

@Override
public @Nullable Icon getIcon() {
public Icon getIcon() {
return BnfIcons.FILE;
}

@Override
public boolean isReadOnly() {
return false;
}

@Override
public @Nullable String getCharset(@NotNull VirtualFile file, byte @NotNull [] content) {
return null;
}
}
2 changes: 1 addition & 1 deletion src/org/intellij/jflex/parser/JFlexASTFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
final class JFlexASTFactory extends ASTFactory {

Check warning on line 17 in src/org/intellij/jflex/parser/JFlexASTFactory.java

View workflow job for this annotation

GitHub Actions / Qodana Community for JVM

Class is closed to inheritance

Class 'JFlexASTFactory' declared `final`

@Override
public @Nullable CompositeElement createComposite(@NotNull IElementType type) {
public CompositeElement createComposite(@NotNull IElementType type) {
return JFlexTypes.Factory.createElement(type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ public FileType getFileType() {
return FILE_TYPE;
}

@Override
public void accept(@NotNull PsiElementVisitor visitor) {
visitor.visitFile(this);
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ private void doTest() {
myFixture.checkHighlighting(true, false, false);
}

@Override
protected boolean isWriteActionRequired() {
return false;
}

private static void toggleGrammarKitSrc(Module module, String testDataPath) {
String absolutePath = new File("").getAbsolutePath();
JavaPsiFacade facade = JavaPsiFacade.getInstance(module.getProject());
Expand Down

0 comments on commit c248402

Please sign in to comment.