Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
giraud authored Mar 19, 2018
2 parents fc0b2e7 + a85aebf commit fbf7f4a
Show file tree
Hide file tree
Showing 14 changed files with 587 additions and 547 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
(_Tags are copied from [babel](https://github.com/babel/babel/blob/master/CHANGELOG.md)_)

## 0.42

* :rocket: Add |. operator
* :rocket: goto action on file module is working
* :house: Improve completion on expressions
* :bug: Color settings no more bloked on loading spinner

## 0.41

* :house: Much improved performances for code lens
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This code might change quite a lot or break in the future.

Known limitations:
- idea project must be created at sources root directory (you can't have sources in `somewhere/app/` and project files in `somewhere/project/`)
- no reformat on save

## Features

Expand Down Expand Up @@ -50,7 +51,9 @@ Advanced features, like syntax error highlighting or type annotations require th
Bucklescript has an excellent support of Windows.

Note: To edit your `idea[64].vmoptions` you can do it from the console,
or via the menu `help > Edit Custom VM Options`.
or via the menu `help > Edit Custom VM Options`.

Note: Make sure `"namespace": false` is set in `bsconfig.json` to enable inferred types hints in editor.

### Local installation

Expand Down
1,061 changes: 534 additions & 527 deletions gen/com/reason/lang/ReasonMLLexer.java

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Available idea versions:
# https://www.jetbrains.com/intellij-repository/releases
# https://www.jetbrains.com/intellij-repository/snapshots
version=0.41
version=0.42
javaVersion=1.8
ideaVersion=2017.2.5
# IDEA 15
Expand Down
20 changes: 10 additions & 10 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>reasonml</id>
<name>ReasonML language plugin</name>
<version>0.41</version>
<version>0.42</version>
<vendor email="giraud.contact@yahoo.fr" url="https://github.com/giraud/reasonml-idea-plugin">H.Giraud</vendor>

<description><![CDATA[
Expand All @@ -14,6 +14,15 @@
<p></p>
<b>version 0.42</b>
<ul>
<li>Add |. operator</li>
<li>goto action on file module is working</li>
<li>Improve completion on expressions</li>
<li>Color settings no more bloked on loading spinner</li>
</ul>
<b>version 0.41</b>
<ul>
Expand Down Expand Up @@ -45,15 +54,6 @@
<li>Improved reason parser</li>
</ul>
<b>version 0.37</b>
<ul>
<li>Fix #30</li>
<li>Add completion when starting typing</li>
<li>Display types for val/external (completion popup)</li>
<li>Use mli file when present (pervasives)</li>
</ul>
]]>
</change-notes>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MlSyntaxHighlighter extends SyntaxHighlighterBase {
);

private static final Set<IElementType> RML_OPERATION_SIGN_TYPES = of(
RmlTypes.INSTANCE.ANDAND, RmlTypes.INSTANCE.SHORTCUT, RmlTypes.INSTANCE.ARROW, RmlTypes.INSTANCE.PIPE_FORWARD,
RmlTypes.INSTANCE.ANDAND, RmlTypes.INSTANCE.SHORTCUT, RmlTypes.INSTANCE.ARROW, RmlTypes.INSTANCE.PIPE_FORWARD, RmlTypes.INSTANCE.PIPE_FIRST,
RmlTypes.INSTANCE.EQEQEQ, RmlTypes.INSTANCE.EQEQ, RmlTypes.INSTANCE.EQ, RmlTypes.INSTANCE.NOT_EQEQ, RmlTypes.INSTANCE.NOT_EQ,
RmlTypes.INSTANCE.DIFF, RmlTypes.INSTANCE.COLON, RmlTypes.INSTANCE.QUOTE, RmlTypes.INSTANCE.CARRET, RmlTypes.INSTANCE.PLUSDOT,
RmlTypes.INSTANCE.MINUSDOT, RmlTypes.INSTANCE.SLASHDOT, RmlTypes.INSTANCE.STARDOT, RmlTypes.INSTANCE.PLUS, RmlTypes.INSTANCE.MINUS,
Expand Down Expand Up @@ -65,7 +65,7 @@ public class MlSyntaxHighlighter extends SyntaxHighlighterBase {
);

private static final Set<IElementType> OCL_OPERATION_SIGN_TYPES = of(
OclTypes.INSTANCE.ANDAND, OclTypes.INSTANCE.SHORTCUT, OclTypes.INSTANCE.ARROW, OclTypes.INSTANCE.PIPE_FORWARD,
OclTypes.INSTANCE.ANDAND, OclTypes.INSTANCE.SHORTCUT, OclTypes.INSTANCE.ARROW, OclTypes.INSTANCE.PIPE_FORWARD, OclTypes.INSTANCE.PIPE_FIRST,
OclTypes.INSTANCE.EQEQEQ, OclTypes.INSTANCE.EQEQ, OclTypes.INSTANCE.EQ, OclTypes.INSTANCE.NOT_EQEQ, OclTypes.INSTANCE.NOT_EQ,
OclTypes.INSTANCE.DIFF, OclTypes.INSTANCE.COLON, OclTypes.INSTANCE.QUOTE, OclTypes.INSTANCE.CARRET, OclTypes.INSTANCE.PLUSDOT,
OclTypes.INSTANCE.MINUSDOT, OclTypes.INSTANCE.SLASHDOT, OclTypes.INSTANCE.STARDOT, OclTypes.INSTANCE.PLUS, OclTypes.INSTANCE.MINUS,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/reason/ide/search/ModuleIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.jetbrains.annotations.NotNull;

public class ModuleIndex extends StringStubIndexExtension<PsiModule> {
private static final int VERSION = 5;
private static final int VERSION = 6;

@Override
public int getVersion() {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/reason/lang/MlTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public abstract class MlTypes {
public IElementType VARIANT_NAME;
public IElementType PIPE;
public IElementType PIPE_FORWARD;
public IElementType PIPE_FIRST;
public IElementType PLUS;
public IElementType PERCENT;
public IElementType PLUSDOT;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/reason/lang/ReasonML.flex
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ ESCAPE_CHAR= {ESCAPE_BACKSLASH} | {ESCAPE_SINGLE_QUOTE} | {ESCAPE_LF} | {ESCAPE_
"->" { return types.RIGHT_ARROW; }
"<-" { return types.LEFT_ARROW; }
"|>" { return types.PIPE_FORWARD; }
"|." { return types.PIPE_FIRST; }
"</" { return types.TAG_LT_SLASH; }
"/>" { return types.TAG_AUTO_CLOSE; }
"[|" { return types.LARRAY; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public boolean isComponent() {
public String getAlias() {
ModuleStub stub = getGreenStub();
if (stub != null) {
// return stub.isAlias();
return stub.getAlias();
}

PsiElement eq = findChildByType(m_types.EQ);
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/com/reason/lang/core/stub/ModuleStub.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ public class ModuleStub extends NamedStubBase<PsiModule> {
private final String m_qname;
private final boolean m_isFileModule;
private final boolean m_isComponent;
private final String m_alias;

public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, String name, String qname, boolean isFileModule, boolean isComponent) {
public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, String name, String qname, String alias, boolean isFileModule, boolean isComponent) {
super(parent, elementType, name);
m_qname = qname;
m_isFileModule = isFileModule;
m_isComponent = isComponent;
m_alias = alias;
}

public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, String qname, boolean isFileModule, boolean isComponent) {
public ModuleStub(StubElement parent, @NotNull IStubElementType elementType, StringRef name, String qname, String alias, boolean isFileModule, boolean isComponent) {
super(parent, elementType, name);
m_qname = qname;
m_isFileModule = isFileModule;
m_isComponent = isComponent;
m_alias = alias;
}

public String getQualifiedName() {
Expand All @@ -35,4 +38,8 @@ public boolean isFileModule() {
}

public boolean isComponent() { return m_isComponent; }

public String getAlias() {
return m_alias;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ public PsiModuleImpl createPsi(@NotNull final ModuleStub stub) {

@NotNull
public ModuleStub createStub(@NotNull final PsiModule psi, final StubElement parentStub) {
return new ModuleStub(parentStub, this, psi.getName(), psi.getQualifiedName(), psi instanceof PsiFileModuleImpl, psi.isComponent());
return new ModuleStub(parentStub, this, psi.getName(), psi.getQualifiedName(), psi.getAlias(), psi instanceof PsiFileModuleImpl, psi.isComponent());
}

public void serialize(@NotNull final ModuleStub stub, @NotNull final StubOutputStream dataStream) throws IOException {
dataStream.writeName(stub.getName());
dataStream.writeUTFFast(stub.getQualifiedName());
dataStream.writeBoolean(stub.isFileModule());
dataStream.writeBoolean(stub.isComponent());

String alias = stub.getAlias();
dataStream.writeBoolean(alias != null);
if (alias != null) {
dataStream.writeUTFFast(stub.getAlias());
}
}

@NotNull
Expand All @@ -46,7 +52,13 @@ public ModuleStub deserialize(@NotNull final StubInputStream dataStream, final S
boolean isFileModule = dataStream.readBoolean();
boolean isComponent = dataStream.readBoolean();

return new ModuleStub(parentStub, this, moduleName, qname, isFileModule, isComponent);
String alias = null;
boolean isAlias = dataStream.readBoolean();
if (isAlias) {
alias = dataStream.readUTFFast();
}

return new ModuleStub(parentStub, this, moduleName, qname, alias, isFileModule, isComponent);
}

public void indexStub(@NotNull final ModuleStub stub, @NotNull final IndexSink sink) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/reason/lang/ocaml/OclTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ private OclTypes() {
VARIANT_NAME = new OclTokenType("VARIANT_NAME");
PIPE = new OclTokenType("PIPE");
PIPE_FORWARD = new OclTokenType("PIPE_FORWARD");
PIPE_FIRST = new OclTokenType("PIPE_FIRST");
PLUS = new OclTokenType("PLUS");
PERCENT = new OclTokenType("PERCENT");
PLUSDOT = new OclTokenType("PLUSDOT");
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/reason/lang/reason/RmlTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ private RmlTypes() {
VARIANT_NAME = new RmlTokenType("VARIANT_NAME");
PIPE = new RmlTokenType("PIPE");
PIPE_FORWARD = new RmlTokenType("PIPE_FORWARD");
PIPE_FIRST = new RmlTokenType("PIPE_FIRST");
PLUS = new RmlTokenType("PLUS");
PERCENT = new RmlTokenType("PERCENT");
PLUSDOT = new RmlTokenType("PLUSDOT");
Expand Down

0 comments on commit fbf7f4a

Please sign in to comment.