@tsomaiatech/moxite 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -2
- package/idea-plugin/.gradle/8.13/checksums/checksums.lock +0 -0
- package/idea-plugin/.gradle/8.13/checksums/md5-checksums.bin +0 -0
- package/idea-plugin/.gradle/8.13/checksums/sha1-checksums.bin +0 -0
- package/idea-plugin/.gradle/8.13/executionHistory/executionHistory.bin +0 -0
- package/idea-plugin/.gradle/8.13/executionHistory/executionHistory.lock +0 -0
- package/idea-plugin/.gradle/8.13/fileChanges/last-build.bin +0 -0
- package/idea-plugin/.gradle/8.13/fileHashes/fileHashes.bin +0 -0
- package/idea-plugin/.gradle/8.13/fileHashes/fileHashes.lock +0 -0
- package/idea-plugin/.gradle/8.13/gc.properties +0 -0
- package/idea-plugin/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/idea-plugin/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/idea-plugin/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/idea-plugin/.gradle/file-system.probe +0 -0
- package/idea-plugin/.gradle/vcs-1/gc.properties +0 -0
- package/idea-plugin/build.gradle.kts +0 -60
- package/idea-plugin/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/idea-plugin/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/idea-plugin/gradle.properties +0 -14
- package/idea-plugin/gradlew +0 -251
- package/idea-plugin/gradlew.bat +0 -94
- package/idea-plugin/settings.gradle.kts +0 -1
- package/idea-plugin/src/main/flex/Moxite.flex +0 -101
- package/idea-plugin/src/main/grammar/Moxite.bnf +0 -79
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteFileType.java +0 -39
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteIcons.java +0 -9
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteLanguage.java +0 -11
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteParserDefinition.java +0 -77
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteSyntaxHighlighter.java +0 -82
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteSyntaxHighlighterFactory.java +0 -16
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/lexer/MoxiteLexerAdapter.java +0 -9
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/parser/MoxiteParserUtil.java +0 -6
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/psi/MoxiteElementType.java +0 -12
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/psi/MoxiteFile.java +0 -25
- package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/psi/MoxiteTokenType.java +0 -17
- package/idea-plugin/src/main/resources/META-INF/plugin.xml +0 -32
- package/src/__tests__/template-engine.test.ts +0 -437
- package/src/template-engine.ts +0 -480
- package/src/template-manager.ts +0 -75
- package/tsconfig.json +0 -21
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea;
|
|
2
|
-
|
|
3
|
-
import com.intellij.openapi.fileTypes.LanguageFileType;
|
|
4
|
-
import org.jetbrains.annotations.NotNull;
|
|
5
|
-
import org.jetbrains.annotations.Nullable;
|
|
6
|
-
|
|
7
|
-
import javax.swing.*;
|
|
8
|
-
|
|
9
|
-
public class MoxiteFileType extends LanguageFileType {
|
|
10
|
-
public static final MoxiteFileType INSTANCE = new MoxiteFileType();
|
|
11
|
-
|
|
12
|
-
private MoxiteFileType() {
|
|
13
|
-
super(MoxiteLanguage.INSTANCE);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@NotNull
|
|
17
|
-
@Override
|
|
18
|
-
public String getName() {
|
|
19
|
-
return "Moxite Template";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@NotNull
|
|
23
|
-
@Override
|
|
24
|
-
public String getDescription() {
|
|
25
|
-
return "Moxite template logic format";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@NotNull
|
|
29
|
-
@Override
|
|
30
|
-
public String getDefaultExtension() {
|
|
31
|
-
return "mx";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
@Nullable
|
|
35
|
-
@Override
|
|
36
|
-
public Icon getIcon() {
|
|
37
|
-
return MoxiteIcons.FILE;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea;
|
|
2
|
-
|
|
3
|
-
import com.intellij.lang.ASTNode;
|
|
4
|
-
import com.intellij.lang.ParserDefinition;
|
|
5
|
-
import com.intellij.lang.PsiParser;
|
|
6
|
-
import com.intellij.lexer.Lexer;
|
|
7
|
-
import com.intellij.openapi.project.Project;
|
|
8
|
-
import com.intellij.psi.FileViewProvider;
|
|
9
|
-
import com.intellij.psi.PsiElement;
|
|
10
|
-
import com.intellij.psi.PsiFile;
|
|
11
|
-
import com.intellij.psi.TokenType;
|
|
12
|
-
import com.intellij.psi.tree.IFileElementType;
|
|
13
|
-
import com.intellij.psi.tree.TokenSet;
|
|
14
|
-
import org.jetbrains.annotations.NotNull;
|
|
15
|
-
import tech.tsomaia.moxite.idea.lexer.MoxiteLexerAdapter;
|
|
16
|
-
import tech.tsomaia.moxite.idea.parser.MoxiteParser;
|
|
17
|
-
import tech.tsomaia.moxite.idea.psi.MoxiteFile;
|
|
18
|
-
import tech.tsomaia.moxite.idea.psi.MoxiteTypes;
|
|
19
|
-
|
|
20
|
-
public class MoxiteParserDefinition implements ParserDefinition {
|
|
21
|
-
|
|
22
|
-
public static final IFileElementType FILE = new IFileElementType(MoxiteLanguage.INSTANCE);
|
|
23
|
-
|
|
24
|
-
@NotNull
|
|
25
|
-
@Override
|
|
26
|
-
public Lexer createLexer(Project project) {
|
|
27
|
-
return new MoxiteLexerAdapter();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@NotNull
|
|
31
|
-
@Override
|
|
32
|
-
public TokenSet getWhitespaceTokens() {
|
|
33
|
-
return TokenSet.create(TokenType.WHITE_SPACE);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@NotNull
|
|
37
|
-
@Override
|
|
38
|
-
public TokenSet getCommentTokens() {
|
|
39
|
-
return TokenSet.EMPTY; // no comments in this language yet
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@NotNull
|
|
43
|
-
@Override
|
|
44
|
-
public TokenSet getStringLiteralElements() {
|
|
45
|
-
return TokenSet.create(MoxiteTypes.STRING);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@NotNull
|
|
49
|
-
@Override
|
|
50
|
-
public PsiParser createParser(Project project) {
|
|
51
|
-
return new MoxiteParser();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@NotNull
|
|
55
|
-
@Override
|
|
56
|
-
public IFileElementType getFileNodeType() {
|
|
57
|
-
return FILE;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@NotNull
|
|
61
|
-
@Override
|
|
62
|
-
public PsiFile createFile(@NotNull FileViewProvider viewProvider) {
|
|
63
|
-
return new MoxiteFile(viewProvider);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
@NotNull
|
|
67
|
-
@Override
|
|
68
|
-
public SpaceRequirements spaceExistenceTypeBetweenTokens(ASTNode left, ASTNode right) {
|
|
69
|
-
return SpaceRequirements.MAY;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
@NotNull
|
|
73
|
-
@Override
|
|
74
|
-
public PsiElement createElement(ASTNode node) {
|
|
75
|
-
return tech.tsomaia.moxite.idea.psi.MoxiteTypes.Factory.createElement(node);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea;
|
|
2
|
-
|
|
3
|
-
import com.intellij.lexer.Lexer;
|
|
4
|
-
import com.intellij.openapi.editor.DefaultLanguageHighlighterColors;
|
|
5
|
-
import com.intellij.openapi.editor.colors.TextAttributesKey;
|
|
6
|
-
import com.intellij.openapi.fileTypes.SyntaxHighlighterBase;
|
|
7
|
-
import com.intellij.psi.tree.IElementType;
|
|
8
|
-
import org.jetbrains.annotations.NotNull;
|
|
9
|
-
import tech.tsomaia.moxite.idea.lexer.MoxiteLexerAdapter;
|
|
10
|
-
import tech.tsomaia.moxite.idea.psi.MoxiteTypes;
|
|
11
|
-
|
|
12
|
-
import static com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey;
|
|
13
|
-
|
|
14
|
-
public class MoxiteSyntaxHighlighter extends SyntaxHighlighterBase {
|
|
15
|
-
|
|
16
|
-
public static final TextAttributesKey KEYWORD =
|
|
17
|
-
createTextAttributesKey("RELAY_KEYWORD", DefaultLanguageHighlighterColors.KEYWORD);
|
|
18
|
-
public static final TextAttributesKey STRING =
|
|
19
|
-
createTextAttributesKey("RELAY_STRING", DefaultLanguageHighlighterColors.STRING);
|
|
20
|
-
public static final TextAttributesKey NUMBER =
|
|
21
|
-
createTextAttributesKey("RELAY_NUMBER", DefaultLanguageHighlighterColors.NUMBER);
|
|
22
|
-
public static final TextAttributesKey IDENTIFIER =
|
|
23
|
-
createTextAttributesKey("RELAY_IDENTIFIER", DefaultLanguageHighlighterColors.IDENTIFIER);
|
|
24
|
-
public static final TextAttributesKey BRACES =
|
|
25
|
-
createTextAttributesKey("RELAY_BRACES", DefaultLanguageHighlighterColors.BRACES);
|
|
26
|
-
public static final TextAttributesKey OPERATOR =
|
|
27
|
-
createTextAttributesKey("RELAY_OPERATOR", DefaultLanguageHighlighterColors.OPERATION_SIGN);
|
|
28
|
-
|
|
29
|
-
private static final TextAttributesKey[] KEYWORD_KEYS = new TextAttributesKey[]{KEYWORD};
|
|
30
|
-
private static final TextAttributesKey[] STRING_KEYS = new TextAttributesKey[]{STRING};
|
|
31
|
-
private static final TextAttributesKey[] NUMBER_KEYS = new TextAttributesKey[]{NUMBER};
|
|
32
|
-
private static final TextAttributesKey[] IDENTIFIER_KEYS = new TextAttributesKey[]{IDENTIFIER};
|
|
33
|
-
private static final TextAttributesKey[] BRACES_KEYS = new TextAttributesKey[]{BRACES};
|
|
34
|
-
private static final TextAttributesKey[] OPERATOR_KEYS = new TextAttributesKey[]{OPERATOR};
|
|
35
|
-
private static final TextAttributesKey[] EMPTY_KEYS = new TextAttributesKey[0];
|
|
36
|
-
|
|
37
|
-
@NotNull
|
|
38
|
-
@Override
|
|
39
|
-
public Lexer getHighlightingLexer() {
|
|
40
|
-
return new MoxiteLexerAdapter();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
@NotNull
|
|
44
|
-
@Override
|
|
45
|
-
public TextAttributesKey[] getTokenHighlights(IElementType tokenType) {
|
|
46
|
-
if (tokenType.equals(MoxiteTypes.TAG_IF) ||
|
|
47
|
-
tokenType.equals(MoxiteTypes.TAG_ELSE_IF) ||
|
|
48
|
-
tokenType.equals(MoxiteTypes.TAG_ELSE) ||
|
|
49
|
-
tokenType.equals(MoxiteTypes.TAG_ENDIF) ||
|
|
50
|
-
tokenType.equals(MoxiteTypes.TAG_FOR) ||
|
|
51
|
-
tokenType.equals(MoxiteTypes.TAG_ENDFOR) ||
|
|
52
|
-
tokenType.equals(MoxiteTypes.TAG_CONST)) {
|
|
53
|
-
return KEYWORD_KEYS;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (tokenType.equals(MoxiteTypes.INTERP_START) ||
|
|
57
|
-
tokenType.equals(MoxiteTypes.INTERP_END)) {
|
|
58
|
-
return BRACES_KEYS;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (tokenType.equals(MoxiteTypes.STRING)) {
|
|
62
|
-
return STRING_KEYS;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (tokenType.equals(MoxiteTypes.NUMBER)) {
|
|
66
|
-
return NUMBER_KEYS;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (tokenType.equals(MoxiteTypes.IDENTIFIER)) {
|
|
70
|
-
return IDENTIFIER_KEYS;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (tokenType.equals(MoxiteTypes.EQUALITY_OP) ||
|
|
74
|
-
tokenType.equals(MoxiteTypes.COMPARE_OP) ||
|
|
75
|
-
tokenType.equals(MoxiteTypes.EQ) ||
|
|
76
|
-
tokenType.equals(MoxiteTypes.PIPE)) {
|
|
77
|
-
return OPERATOR_KEYS;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return EMPTY_KEYS;
|
|
81
|
-
}
|
|
82
|
-
}
|
package/idea-plugin/src/main/java/tech/tsomaia/moxite/idea/MoxiteSyntaxHighlighterFactory.java
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea;
|
|
2
|
-
|
|
3
|
-
import com.intellij.openapi.fileTypes.SyntaxHighlighter;
|
|
4
|
-
import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
|
|
5
|
-
import com.intellij.openapi.project.Project;
|
|
6
|
-
import com.intellij.openapi.vfs.VirtualFile;
|
|
7
|
-
import org.jetbrains.annotations.NotNull;
|
|
8
|
-
import org.jetbrains.annotations.Nullable;
|
|
9
|
-
|
|
10
|
-
public class MoxiteSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
|
|
11
|
-
@NotNull
|
|
12
|
-
@Override
|
|
13
|
-
public SyntaxHighlighter getSyntaxHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile) {
|
|
14
|
-
return new MoxiteSyntaxHighlighter();
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea.psi;
|
|
2
|
-
|
|
3
|
-
import com.intellij.psi.tree.IElementType;
|
|
4
|
-
import org.jetbrains.annotations.NonNls;
|
|
5
|
-
import org.jetbrains.annotations.NotNull;
|
|
6
|
-
import tech.tsomaia.moxite.idea.MoxiteLanguage;
|
|
7
|
-
|
|
8
|
-
public class MoxiteElementType extends IElementType {
|
|
9
|
-
public MoxiteElementType(@NotNull @NonNls String debugName) {
|
|
10
|
-
super(debugName, MoxiteLanguage.INSTANCE);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea.psi;
|
|
2
|
-
|
|
3
|
-
import com.intellij.extapi.psi.PsiFileBase;
|
|
4
|
-
import com.intellij.openapi.fileTypes.FileType;
|
|
5
|
-
import com.intellij.psi.FileViewProvider;
|
|
6
|
-
import org.jetbrains.annotations.NotNull;
|
|
7
|
-
import tech.tsomaia.moxite.idea.MoxiteFileType;
|
|
8
|
-
import tech.tsomaia.moxite.idea.MoxiteLanguage;
|
|
9
|
-
|
|
10
|
-
public class MoxiteFile extends PsiFileBase {
|
|
11
|
-
public MoxiteFile(@NotNull FileViewProvider viewProvider) {
|
|
12
|
-
super(viewProvider, MoxiteLanguage.INSTANCE);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@NotNull
|
|
16
|
-
@Override
|
|
17
|
-
public FileType getFileType() {
|
|
18
|
-
return MoxiteFileType.INSTANCE;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@Override
|
|
22
|
-
public String toString() {
|
|
23
|
-
return "Moxite File";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
package tech.tsomaia.moxite.idea.psi;
|
|
2
|
-
|
|
3
|
-
import com.intellij.psi.tree.IElementType;
|
|
4
|
-
import org.jetbrains.annotations.NonNls;
|
|
5
|
-
import org.jetbrains.annotations.NotNull;
|
|
6
|
-
import tech.tsomaia.moxite.idea.MoxiteLanguage;
|
|
7
|
-
|
|
8
|
-
public class MoxiteTokenType extends IElementType {
|
|
9
|
-
public MoxiteTokenType(@NotNull @NonNls String debugName) {
|
|
10
|
-
super(debugName, MoxiteLanguage.INSTANCE);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Override
|
|
14
|
-
public String toString() {
|
|
15
|
-
return "MoxiteTokenType." + super.toString();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<idea-plugin>
|
|
2
|
-
<id>tech.tsomaia.moxite.idea</id>
|
|
3
|
-
<name>Moxite Template Support</name>
|
|
4
|
-
<vendor email="admin@tsomaia.tech" url="https://tsomaia.tech">Tornike Tsomaia</vendor>
|
|
5
|
-
|
|
6
|
-
<description><![CDATA[
|
|
7
|
-
Provides language support for the Moxite Template Engine.
|
|
8
|
-
Includes full syntax highlighting, lexing, and semantic parsing for .mx files.
|
|
9
|
-
]]></description>
|
|
10
|
-
|
|
11
|
-
<!-- please see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html
|
|
12
|
-
on how to target different products -->
|
|
13
|
-
<depends>com.intellij.modules.platform</depends>
|
|
14
|
-
|
|
15
|
-
<extensions defaultExtensionNs="com.intellij">
|
|
16
|
-
<fileType
|
|
17
|
-
name="Moxite Template"
|
|
18
|
-
implementationClass="tech.tsomaia.moxite.idea.MoxiteFileType"
|
|
19
|
-
fieldName="INSTANCE"
|
|
20
|
-
language="Moxite"
|
|
21
|
-
extensions="mx"
|
|
22
|
-
/>
|
|
23
|
-
<lang.parserDefinition
|
|
24
|
-
language="Moxite"
|
|
25
|
-
implementationClass="tech.tsomaia.moxite.idea.MoxiteParserDefinition"
|
|
26
|
-
/>
|
|
27
|
-
<lang.syntaxHighlighterFactory
|
|
28
|
-
language="Moxite"
|
|
29
|
-
implementationClass="tech.tsomaia.moxite.idea.MoxiteSyntaxHighlighterFactory"
|
|
30
|
-
/>
|
|
31
|
-
</extensions>
|
|
32
|
-
</idea-plugin>
|