Skip to content

Commit

Permalink
Got rid of unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkhoury committed Jan 9, 2019
1 parent b7d4368 commit 3b8541c
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions src/com/nasmlanguage/NASMUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ of this software and associated documentation files (the "Software"), to deal
package com.nasmlanguage;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
Expand All @@ -40,54 +39,6 @@ of this software and associated documentation files (the "Software"), to deal

class NASMUtil {

static List<PsiElement> findPreprocessorMacrosAndDefines(Project project) {
List<PsiElement> result = new ArrayList<>();
Collection<VirtualFile> virtualFiles = FileBasedIndex.getInstance().getContainingFiles(
FileTypeIndex.NAME, NASMFileType.INSTANCE, GlobalSearchScope.allScope(project)
);
for (VirtualFile virtualFile : virtualFiles) {
NASMFile assemblyFile = (NASMFile)PsiManager.getInstance(project).findFile(virtualFile);
if (assemblyFile != null) {
Collection<NASMPreprocessor> nasmPreprocessors = PsiTreeUtil.collectElementsOfType(assemblyFile, NASMPreprocessor.class);
if (!nasmPreprocessors.isEmpty()) {
for (NASMPreprocessor nasmPreprocessor : nasmPreprocessors) {
NASMMacro macro = nasmPreprocessor.getMacro();
if (macro != null) {
result.add(macro);
continue;
}
NASMDefine define = nasmPreprocessor.getDefine();
if (define != null) {
result.add(define);
}
}
}
}
}
return result;
}

static List<NASMMacro> findPreprocessorMacros(Project project) {
List<NASMMacro> result = new ArrayList<>();
Collection<VirtualFile> virtualFiles = FileBasedIndex.getInstance().getContainingFiles(
FileTypeIndex.NAME, NASMFileType.INSTANCE, GlobalSearchScope.allScope(project)
);
for (VirtualFile virtualFile : virtualFiles) {
NASMFile assemblyFile = (NASMFile)PsiManager.getInstance(project).findFile(virtualFile);
if (assemblyFile != null) {
Collection<NASMPreprocessor> nasmPreprocessors = PsiTreeUtil.collectElementsOfType(assemblyFile, NASMPreprocessor.class);
if (!nasmPreprocessors.isEmpty()) {
for (NASMPreprocessor nasmPreprocessor : nasmPreprocessors) {
NASMMacro macro = nasmPreprocessor.getMacro();
if (macro != null)
result.add(macro);
}
}
}
}
return result;
}

static List<NASMDefine> findPreprocessorDefines(PsiFile containingFile) {
List<NASMDefine> result = new ArrayList<>();

Expand Down

0 comments on commit 3b8541c

Please sign in to comment.