Skip to content

Commit

Permalink
Renaming classes
Browse files Browse the repository at this point in the history
  • Loading branch information
giraud committed Sep 21, 2018
1 parent 2e8dd80 commit e4b521a
Show file tree
Hide file tree
Showing 48 changed files with 833 additions and 835 deletions.
6 changes: 3 additions & 3 deletions gen/com/reason/lang/ReasonMLLexer.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/main/java/com/reason/ide/folding/FoldingBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import com.reason.lang.core.psi.PsiModule;
import com.reason.lang.core.psi.PsiType;
import com.reason.lang.core.psi.PsiTypeConstrName;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.psi.type.ORTypesUtil;
import com.reason.lang.core.type.ORTypes;
import com.reason.lang.core.type.ORTypesUtil;
import com.reason.lang.ocaml.OclTypes;
import com.reason.lang.reason.RmlLanguage;
import com.reason.lang.reason.RmlTypes;
Expand All @@ -29,7 +29,7 @@ public class FoldingBuilder extends FoldingBuilderEx {
@Override
public FoldingDescriptor[] buildFoldRegions(@NotNull PsiElement root, @NotNull Document document, boolean quick) {
List<FoldingDescriptor> descriptors = new ArrayList<>();
MlTypes types = root.getLanguage() == RmlLanguage.INSTANCE ? RmlTypes.INSTANCE : OclTypes.INSTANCE;
ORTypes types = root.getLanguage() == RmlLanguage.INSTANCE ? RmlTypes.INSTANCE : OclTypes.INSTANCE;

PsiTreeUtil.processElements(root, element -> {
if (element instanceof PsiLet) {
Expand Down Expand Up @@ -63,7 +63,7 @@ private void foldLet(List<FoldingDescriptor> descriptors, PsiLet letExpression)
private void foldType(List<FoldingDescriptor> descriptors, PsiType typeExpression) {
PsiElement constrName = PsiTreeUtil.findChildOfType(typeExpression, PsiTypeConstrName.class);
if (constrName != null) {
MlTypes types = ORTypesUtil.getInstance(typeExpression.getLanguage());
ORTypes types = ORTypesUtil.getInstance(typeExpression.getLanguage());
PsiElement eqElement = PsiUtil.nextSiblingWithTokenType(constrName, types.EQ);
if (eqElement != null) {
TextRange eqRange = eqElement.getTextRange();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/reason/ide/go/MlModuleContributor.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.intellij.util.ArrayUtil;
import com.reason.ide.files.FileBase;
import com.reason.ide.search.IndexKeys;
import com.reason.lang.core.MlFileType;
import com.reason.lang.core.ORFileType;
import com.reason.lang.core.PsiFinder;
import com.reason.lang.core.psi.PsiModule;
import org.jetbrains.annotations.NotNull;
Expand All @@ -33,7 +33,7 @@ public NavigationItem[] getItemsByName(String name, String pattern, Project proj
items.add(new MlModuleNavigationItem(fileModule, fileModule.asModuleName()));
}

Collection<PsiModule> modules = PsiFinder.getInstance().findModules(project, name, scope, MlFileType.interfaceOrImplementation);
Collection<PsiModule> modules = PsiFinder.getInstance().findModules(project, name, scope, ORFileType.interfaceOrImplementation);
for (PsiModule element : modules) {
items.add(new MlModuleNavigationItem(element, element.getName()));
}
Expand All @@ -46,7 +46,7 @@ public NavigationItem[] getItemsByName(String name, String pattern, Project proj
public String[] getNames(Project project, boolean includeNonProjectItems) {
ArrayList<String> modules = new ArrayList<>();

Collection<String> fileModules = PsiFinder.getInstance().findFileModules(project, MlFileType.implementationOnly).stream().map(FileBase::asModuleName).collect(Collectors.toList());
Collection<String> fileModules = PsiFinder.getInstance().findFileModules(project, ORFileType.implementationOnly).stream().map(FileBase::asModuleName).collect(Collectors.toList());
Collection<String> allModuleNames = StubIndex.getInstance().getAllKeys(IndexKeys.MODULES, project);

modules.addAll(fileModules);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/reason/ide/highlight/ORSyntaxAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
import com.reason.lang.core.psi.PsiInterpolation;
import com.reason.lang.core.psi.PsiType;
import com.reason.lang.core.psi.PsiUpperSymbol;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;
import org.jetbrains.annotations.NotNull;

import static com.intellij.openapi.editor.markup.TextAttributes.ERASE_MARKER;

public abstract class ORSyntaxAnnotator implements Annotator {

private final MlTypes m_types;
private final ORTypes m_types;

ORSyntaxAnnotator(MlTypes types) {
ORSyntaxAnnotator(ORTypes types) {
m_types = types;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.intellij.openapi.editor.colors.TextAttributesKey;
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
import com.intellij.psi.tree.IElementType;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;
import com.reason.lang.ocaml.OclLexer;
import com.reason.lang.ocaml.OclTypes;
import com.reason.lang.reason.RmlLexer;
Expand Down Expand Up @@ -125,9 +125,9 @@ public class ORSyntaxHighlighter extends SyntaxHighlighterBase {
private static final TextAttributesKey[] BAD_CHAR_KEYS = new TextAttributesKey[]{BAD_CHAR_};
private static final TextAttributesKey[] EMPTY_KEYS = new TextAttributesKey[0];

private final MlTypes m_types;
private final ORTypes m_types;

public ORSyntaxHighlighter(MlTypes types) {
public ORSyntaxHighlighter(ORTypes types) {
m_types = types;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import com.intellij.util.ProcessingContext;
import com.reason.ide.insight.provider.*;
import com.reason.lang.ModulePathFinder;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;
import org.jetbrains.annotations.NotNull;

abstract class CompletionContributor extends com.intellij.codeInsight.completion.CompletionContributor {

CompletionContributor(@NotNull MlTypes types, @NotNull ModulePathFinder modulePathFinder, @NotNull CompletionPatterns patterns) {
CompletionContributor(@NotNull ORTypes types, @NotNull ModulePathFinder modulePathFinder, @NotNull CompletionPatterns patterns) {
//extend(CompletionType.BASIC, com.intellij.patterns.PlatformPatterns.psiElement(), new DebugCompletionProvider());

extend(CompletionType.BASIC, patterns.open(), new ModuleCompletionProvider(types));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.List;
import java.util.stream.Collectors;

import static com.reason.lang.core.MlFileType.interfaceOrImplementation;
import static com.reason.lang.core.ORFileType.interfaceOrImplementation;

public class DotExpressionCompletionProvider extends CompletionProvider<CompletionParameters> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.Collection;
import java.util.List;

import static com.reason.lang.core.MlFileType.interfaceOrImplementation;
import static com.reason.lang.core.ORFileType.interfaceOrImplementation;

public class FreeExpressionCompletionProvider extends CompletionProvider<CompletionParameters> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.stream.Collectors;

import static com.intellij.util.PsiIconUtil.getProvidersIcon;
import static com.reason.lang.core.MlFileType.interfaceOrImplementation;
import static com.reason.lang.core.ORFileType.interfaceOrImplementation;

public class JsxNameCompletionProvider extends CompletionProvider<CompletionParameters> {
private final Debug m_debug;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
import com.reason.lang.core.PsiFinder;
import com.reason.lang.core.psi.PsiModule;
import com.reason.lang.core.psi.PsiUpperSymbol;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;
import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import static com.reason.lang.core.MlFileType.implementationOnly;
import static com.reason.lang.core.MlFileType.interfaceOrImplementation;
import static com.reason.lang.core.ORFileType.implementationOnly;
import static com.reason.lang.core.ORFileType.interfaceOrImplementation;

public class ModuleCompletionProvider extends CompletionProvider<CompletionParameters> {
private final MlTypes m_types;
private final ORTypes m_types;

public ModuleCompletionProvider(MlTypes types) {
public ModuleCompletionProvider(ORTypes types) {
m_types = types;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.util.Collection;

import static com.reason.lang.core.MlFileType.interfaceOrImplementation;
import static com.reason.lang.core.ORFileType.interfaceOrImplementation;

public class ObjectCompletionProvider extends CompletionProvider<CompletionParameters> {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/reason/lang/BaseModulePathFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import com.intellij.psi.util.PsiTreeUtil;
import com.reason.lang.core.PsiFinder;
import com.reason.lang.core.psi.PsiNamedElement;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public abstract class BaseModulePathFinder implements ModulePathFinder {

@NotNull
protected String extractPathName(@NotNull PsiElement element, @NotNull MlTypes types) {
protected String extractPathName(@NotNull PsiElement element, @NotNull ORTypes types) {
String path = "";

PsiElement prevLeaf = PsiTreeUtil.prevVisibleLeaf(element);
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/reason/lang/CommonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiParser;
import com.intellij.psi.tree.IElementType;
import com.reason.lang.core.psi.type.MlTokenElementType;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTokenElementType;
import com.reason.lang.core.type.ORTypes;
import org.jetbrains.annotations.NotNull;

import static com.intellij.lang.parser.GeneratedParserUtilBase.*;
import static com.reason.lang.ParserScopeEnum.*;

public abstract class CommonParser implements PsiParser, LightPsiParser {

protected MlTypes m_types;
protected ORTypes m_types;

protected CommonParser(MlTypes types) {
protected CommonParser(ORTypes types) {
m_types = types;
}

Expand Down Expand Up @@ -82,18 +82,18 @@ protected ParserScope markComplete(PsiBuilder builder, ParserScopeEnum resolutio
return markComplete(builder, resolution, resolution, compositeElementType);
}

protected ParserScope markScope(PsiBuilder builder, ParserScopeEnum context, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull MlTokenElementType scopeTokenElementType) {
protected ParserScope markScope(PsiBuilder builder, ParserScopeEnum context, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull ORTokenElementType scopeTokenElementType) {
ParserScope scope = new ParserScope(context, resolution, compositeElementType, scopeTokenElementType, builder.mark());
scope.scope = true;
scope.setStart(true);
return scope;
}

protected ParserScope markScope(PsiBuilder builder, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull MlTokenElementType scopeTokenElementType) {
protected ParserScope markScope(PsiBuilder builder, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull ORTokenElementType scopeTokenElementType) {
return markScope(builder, resolution, resolution, compositeElementType, scopeTokenElementType);
}

protected ParserScope markCompleteScope(PsiBuilder builder, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull MlTokenElementType scopeTokenElement) {
protected ParserScope markCompleteScope(PsiBuilder builder, ParserScopeEnum resolution, IElementType compositeElementType, @NotNull ORTokenElementType scopeTokenElement) {
ParserScope scope1 = markScope(builder, resolution, resolution, compositeElementType, scopeTokenElement);
scope1.complete = true;
return scope1;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/reason/lang/ParserScope.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

import com.intellij.lang.PsiBuilder;
import com.intellij.psi.tree.IElementType;
import com.reason.lang.core.psi.type.MlTokenElementType;
import com.reason.lang.core.type.ORTokenElementType;

public class ParserScope {
private ParserScopeEnum m_resolution;
private IElementType m_compositeElementType;
private ParserScopeEnum m_context;
MlTokenElementType scopeTokenElementType;
ORTokenElementType scopeTokenElementType;

boolean complete = false;
boolean scope = false;
private boolean m_scopeStart = false;

private PsiBuilder.Marker m_mark;

ParserScope(ParserScopeEnum context, ParserScopeEnum resolution, IElementType compositeElementType, MlTokenElementType scopeTokenElementType, PsiBuilder.Marker mark) {
ParserScope(ParserScopeEnum context, ParserScopeEnum resolution, IElementType compositeElementType, ORTokenElementType scopeTokenElementType, PsiBuilder.Marker mark) {
m_context = context;
m_resolution = resolution;
m_compositeElementType = compositeElementType;
Expand Down Expand Up @@ -68,11 +68,11 @@ boolean isCompositeEqualTo(IElementType compositeElementType) {
return m_compositeElementType == compositeElementType;
}

boolean isScopeTokenEqualTo(MlTokenElementType tokenElementType) {
boolean isScopeTokenEqualTo(ORTokenElementType tokenElementType) {
return this.scopeTokenElementType == tokenElementType;
}

void setScopeTokenType(MlTokenElementType tokenElementType) {
void setScopeTokenType(ORTokenElementType tokenElementType) {
this.scopeTokenElementType = tokenElementType;
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/reason/lang/ParserState.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.intellij.psi.tree.IElementType;
import com.intellij.util.ArrayUtil;
import com.intellij.util.containers.Stack;
import com.reason.lang.core.psi.type.MlTokenElementType;
import com.reason.lang.core.type.ORTokenElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -79,7 +79,7 @@ public void endUntilResolution(@NotNull ParserScopeEnum resolution) {
}

@Nullable
public ParserScope endUntilScopeToken(@NotNull MlTokenElementType scopeElementType) {
public ParserScope endUntilScopeToken(@NotNull ORTokenElementType scopeElementType) {
ParserScope scope = null;

if (!m_scopes.isEmpty()) {
Expand All @@ -94,7 +94,7 @@ public ParserScope endUntilScopeToken(@NotNull MlTokenElementType scopeElementTy
}

@Nullable
public ParserScope endUntilOneOfScopeToken(@NotNull MlTokenElementType... scopeElementTypes) {
public ParserScope endUntilOneOfScopeToken(@NotNull ORTokenElementType... scopeElementTypes) {
ParserScope scope = null;

if (!m_scopes.isEmpty()) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public boolean isCurrentCompositeElementType(IElementType compositeElementType)
return currentScope.isCompositeEqualTo(compositeElementType);
}

public boolean isScopeTokenElementType(MlTokenElementType scopeTokenElementType) {
public boolean isScopeTokenElementType(ORTokenElementType scopeTokenElementType) {
return currentScope.isScopeTokenEqualTo(scopeTokenElementType);
}

Expand All @@ -188,7 +188,7 @@ public boolean isInScopeExpression() {
return currentScope.scope;
}

public void setTokenElementType(MlTokenElementType tokenType) {
public void setTokenElementType(ORTokenElementType tokenType) {
currentScope.setScopeTokenType(tokenType);
}

Expand All @@ -198,7 +198,7 @@ public ParserState updateCurrentCompositeElementType(@NotNull IElementType compo
return this;
}

public boolean isCurrentTokenType(MlTokenElementType tokenElementType) {
public boolean isCurrentTokenType(ORTokenElementType tokenElementType) {
return currentScope.isScopeTokenEqualTo(tokenElementType);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/reason/lang/PsiElementFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import com.intellij.psi.tree.IElementType;
import com.reason.lang.core.psi.*;
import com.reason.lang.core.psi.impl.*;
import com.reason.lang.core.psi.type.MlTypes;
import com.reason.lang.core.type.ORTypes;

public class PsiElementFactory {
private PsiElementFactory() {
}

public static PsiElement createElement(MlTypes types, ASTNode node) {
public static PsiElement createElement(ORTypes types, ASTNode node) {
IElementType type = node.getElementType();

if (type == types.EXTERNAL_STMT) {
Expand Down
Loading

0 comments on commit e4b521a

Please sign in to comment.