From 24120884d3014e46512309d233967f5fbb2ab277 Mon Sep 17 00:00:00 2001 From: "Walied K. Yassen" Date: Fri, 6 Oct 2023 14:27:53 +0300 Subject: [PATCH] Remove oplang and use lang for commands --- CHANGELOG.md | 1 + .../plugin/oplang/lexer/_RsOpLexer.java | 608 ------------------ .../plugin/oplang/parser/RsOpParser.java | 340 ---------- .../plugin/oplang/psi/RsOpAttribute.java | 31 - .../plugin/oplang/psi/RsOpAttributeList.java | 15 - .../plugin/oplang/psi/RsOpAttributeValue.java | 16 - .../plugin/oplang/psi/RsOpCommand.java | 24 - .../plugin/oplang/psi/RsOpCommandHeader.java | 24 - .../plugin/oplang/psi/RsOpElementTypes.java | 74 --- .../plugin/oplang/psi/RsOpIntegerValue.java | 13 - .../plugin/oplang/psi/RsOpNameLiteral.java | 18 - .../plugin/oplang/psi/RsOpParameter.java | 21 - .../plugin/oplang/psi/RsOpParameterList.java | 21 - .../plugin/oplang/psi/RsOpReturnList.java | 21 - .../plugin/oplang/psi/RsOpTypeName.java | 15 - .../plugin/oplang/psi/RsOpVisitor.java | 58 -- .../oplang/psi/impl/RsOpAttributeImpl.java | 72 --- .../psi/impl/RsOpAttributeListImpl.java | 47 -- .../psi/impl/RsOpAttributeValueImpl.java | 42 -- .../psi/impl/RsOpCommandHeaderImpl.java | 65 -- .../oplang/psi/impl/RsOpCommandImpl.java | 65 -- .../oplang/psi/impl/RsOpIntegerValueImpl.java | 36 -- .../oplang/psi/impl/RsOpNameLiteralImpl.java | 53 -- .../oplang/psi/impl/RsOpParameterImpl.java | 59 -- .../psi/impl/RsOpParameterListImpl.java | 59 -- .../oplang/psi/impl/RsOpReturnListImpl.java | 59 -- .../oplang/psi/impl/RsOpTypeNameImpl.java | 47 -- src/main/grammars/Opcode.bnf | 63 -- src/main/grammars/Opcode.flex | 68 -- .../plugin/ide/RsGotoClassContributor.kt | 6 +- .../RsInlayParameterHintsProvider.kt | 9 +- .../plugin/ide/doc/RsDocumentationProvider.kt | 30 - .../ide/highlight/RsHighlightingAnnotator.kt | 8 +- ...RuneScriptMissingScriptSymbolInspection.kt | 7 +- .../RuneScriptUnresolvedCommandInspection.kt | 2 +- .../plugin/ide/sdk/RsSdkSetupValidator.kt | 3 +- .../plugin/lang/parser/RsParserDefinition.kt | 19 +- .../plugin/lang/psi/RsPsiExtensions.kt | 7 +- .../psi/refs/RsCommandExpressionReference.kt | 6 +- .../psi/refs/RsDynamicExpressionReference.kt | 6 +- .../plugin/lang/psi/refs/RsGosubReference.kt | 4 +- .../lang/psi/type/inference/CommandHandler.kt | 27 +- .../type/inference/RsTypeInferenceVisitor.kt | 43 +- .../lang/psi/type/trigger/RsTriggerType.kt | 1 + .../lang/stubs/index/RsCommandScriptIndex.kt | 18 + ...otoScriptIndex.kt => RsProcScriptIndex.kt} | 4 +- .../lang/stubs/types/RsScriptStubType.kt | 6 +- .../plugin/oplang/filetypes/RsOpFileType.kt | 18 - .../plugin/oplang/lexer/RsOpLexer.kt | 6 - .../plugin/oplang/psi/RsOpElementType.kt | 7 - .../runescript/plugin/oplang/psi/RsOpFile.kt | 23 - .../plugin/oplang/psi/RsOpStubType.kt | 15 - .../plugin/oplang/psi/index/RsCommandIndex.kt | 16 - .../oplang/psi/stub/RsOpAttributeListStub.kt | 9 - .../oplang/psi/stub/RsOpCommandHeaderStub.kt | 9 - .../plugin/oplang/psi/stub/RsOpCommandStub.kt | 9 - .../oplang/psi/stub/RsOpNameLiteralStub.kt | 9 - .../oplang/psi/stub/RsOpParameterListStub.kt | 9 - .../oplang/psi/stub/RsOpParameterStub.kt | 9 - .../oplang/psi/stub/RsOpReturnListStub.kt | 9 - .../psi/stub/RsOpStubElementTypeFactory.kt | 22 - .../oplang/psi/stub/RsOpTypeNameStub.kt | 9 - .../stub/type/RsOpAttributeListStubType.kt | 32 - .../stub/type/RsOpCommandHeaderStubType.kt | 32 - .../psi/stub/type/RsOpCommandStubType.kt | 37 -- .../oplang/psi/stub/type/RsOpFileStubType.kt | 39 -- .../psi/stub/type/RsOpNameLiteralStubType.kt | 33 - .../stub/type/RsOpParameterListStubType.kt | 32 - .../psi/stub/type/RsOpParameterStubType.kt | 33 - .../psi/stub/type/RsOpReturnListStubType.kt | 32 - .../psi/stub/type/RsOpTypeNameStubType.kt | 33 - src/main/resources/META-INF/op-lang.xml | 9 - src/main/resources/META-INF/plugin.xml | 4 +- .../resources/messages/RsBundle.properties | 1 + 74 files changed, 101 insertions(+), 2636 deletions(-) delete mode 100644 src/main/gen/io/runescript/plugin/oplang/lexer/_RsOpLexer.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/parser/RsOpParser.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttribute.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeList.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeValue.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommand.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommandHeader.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpElementTypes.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpIntegerValue.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpNameLiteral.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameter.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameterList.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpReturnList.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpTypeName.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/RsOpVisitor.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeListImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeValueImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandHeaderImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpIntegerValueImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpNameLiteralImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterListImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpReturnListImpl.java delete mode 100644 src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpTypeNameImpl.java delete mode 100644 src/main/grammars/Opcode.bnf delete mode 100644 src/main/grammars/Opcode.flex create mode 100644 src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsCommandScriptIndex.kt rename src/main/kotlin/io/runescript/plugin/lang/stubs/index/{RsGotoScriptIndex.kt => RsProcScriptIndex.kt} (79%) delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/filetypes/RsOpFileType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/lexer/RsOpLexer.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpElementType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpFile.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/index/RsCommandIndex.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpAttributeListStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandHeaderStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpNameLiteralStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterListStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpReturnListStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpStubElementTypeFactory.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpTypeNameStub.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpAttributeListStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandHeaderStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpFileStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpNameLiteralStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterListStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpReturnListStubType.kt delete mode 100644 src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpTypeNameStubType.kt delete mode 100644 src/main/resources/META-INF/op-lang.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index 718ea5f..2553f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] ### Changed - Inspections that require symbols will no longer run on files outside the project. +- Update the file extension for commands from ".op" to ".cs2". ## [1.3.0] - 2023-08-30 diff --git a/src/main/gen/io/runescript/plugin/oplang/lexer/_RsOpLexer.java b/src/main/gen/io/runescript/plugin/oplang/lexer/_RsOpLexer.java deleted file mode 100644 index 13c2ae7..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/lexer/_RsOpLexer.java +++ /dev/null @@ -1,608 +0,0 @@ -// Generated by JFlex 1.9.1 http://jflex.de/ (tweaked for IntelliJ platform) -// source: Opcode.flex - -package io.runescript.plugin.oplang.lexer; - -import com.intellij.lexer.FlexLexer; -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import io.runescript.plugin.lang.lexer.RsLexerInfo; - -import java.util.List; - -import static io.runescript.plugin.lang.psi.RsTokenTypes.*; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; - -class _RsOpLexer implements FlexLexer { - - /** This character denotes the end of file */ - public static final int YYEOF = -1; - - /** initial size of the lookahead buffer */ - private static final int ZZ_BUFFERSIZE = 16384; - - /** lexical states */ - public static final int YYINITIAL = 0; - - /** - * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l - * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l - * at the beginning of a line - * l is of the form l = 2*k, k a non negative integer - */ - private static final int ZZ_LEXSTATE[] = { - 0, 0 - }; - - /** - * Top-level table for translating characters to character classes - */ - private static final int [] ZZ_CMAP_TOP = zzUnpackcmap_top(); - - private static final String ZZ_CMAP_TOP_PACKED_0 = - "\1\0\u10ff\u0100"; - - private static int [] zzUnpackcmap_top() { - int [] result = new int[4352]; - int offset = 0; - offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackcmap_top(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Second-level tables for translating characters to character classes - */ - private static final int [] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks(); - - private static final String ZZ_CMAP_BLOCKS_PACKED_0 = - "\11\0\1\1\1\2\2\0\1\3\22\0\1\1\2\0"+ - "\1\4\1\5\3\0\1\6\1\7\1\10\1\11\1\12"+ - "\1\0\1\11\1\13\1\14\11\15\7\0\6\16\21\11"+ - "\1\17\2\11\1\20\1\0\1\21\1\0\1\11\1\0"+ - "\6\16\21\11\1\17\2\11\u0185\0"; - - private static int [] zzUnpackcmap_blocks() { - int [] result = new int[512]; - int offset = 0; - offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackcmap_blocks(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** - * Translates DFA states to action switch labels. - */ - private static final int [] ZZ_ACTION = zzUnpackAction(); - - private static final String ZZ_ACTION_PACKED_0 = - "\1\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7"+ - "\1\10\1\1\2\11\1\12\1\13\2\0\1\7\2\0"+ - "\2\14\1\11\1\0\1\15"; - - private static int [] zzUnpackAction() { - int [] result = new int[24]; - int offset = 0; - offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAction(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /** - * Translates a state to a row index in the transition table - */ - private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); - - private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\22\0\22\0\22\0\22\0\22\0\22\0\44"+ - "\0\22\0\66\0\110\0\132\0\22\0\22\0\154\0\176"+ - "\0\220\0\242\0\264\0\22\0\306\0\220\0\330\0\22"; - - private static int [] zzUnpackRowMap() { - int [] result = new int[24]; - int offset = 0; - offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackRowMap(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length() - 1; - while (i < l) { - int high = packed.charAt(i++) << 16; - result[j++] = high | packed.charAt(i++); - } - return j; - } - - /** - * The transition table of the DFA - */ - private static final int [] ZZ_TRANS = zzUnpacktrans(); - - private static final String ZZ_TRANS_PACKED_0 = - "\1\2\3\3\1\4\1\5\1\6\1\7\1\2\1\10"+ - "\1\11\1\12\1\13\1\14\2\10\1\15\1\16\33\0"+ - "\1\10\2\0\4\10\12\0\1\17\2\0\1\20\17\0"+ - "\1\10\2\0\2\14\1\10\1\21\13\0\1\10\2\0"+ - "\2\14\2\10\2\0\10\22\1\23\11\22\2\20\1\24"+ - "\1\25\16\20\11\0\1\10\2\0\3\26\1\10\2\0"+ - "\10\22\1\27\11\22\10\0\1\23\2\0\1\30\10\0"+ - "\1\24\17\0\10\22\1\27\2\22\1\30\6\22"; - - private static int [] zzUnpacktrans() { - int [] result = new int[234]; - int offset = 0; - offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result); - return result; - } - - private static int zzUnpacktrans(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - value--; - do result[j++] = value; while (--count > 0); - } - return j; - } - - - /* error codes */ - private static final int ZZ_UNKNOWN_ERROR = 0; - private static final int ZZ_NO_MATCH = 1; - private static final int ZZ_PUSHBACK_2BIG = 2; - - /* error messages for the codes above */ - private static final String[] ZZ_ERROR_MSG = { - "Unknown internal scanner error", - "Error: could not match input", - "Error: pushback value was too large" - }; - - /** - * ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState} - */ - private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); - - private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\1\0\6\11\1\1\1\11\3\1\2\11\2\0\1\1"+ - "\2\0\1\11\2\1\1\0\1\11"; - - private static int [] zzUnpackAttribute() { - int [] result = new int[24]; - int offset = 0; - offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); - return result; - } - - private static int zzUnpackAttribute(String packed, int offset, int [] result) { - int i = 0; /* index in packed string */ - int j = offset; /* index in unpacked array */ - int l = packed.length(); - while (i < l) { - int count = packed.charAt(i++); - int value = packed.charAt(i++); - do result[j++] = value; while (--count > 0); - } - return j; - } - - /** the input device */ - private java.io.Reader zzReader; - - /** the current state of the DFA */ - private int zzState; - - /** the current lexical state */ - private int zzLexicalState = YYINITIAL; - - /** this buffer contains the current text to be matched and is - the source of the yytext() string */ - private CharSequence zzBuffer = ""; - - /** the textposition at the last accepting state */ - private int zzMarkedPos; - - /** the current text position in the buffer */ - private int zzCurrentPos; - - /** startRead marks the beginning of the yytext() string in the buffer */ - private int zzStartRead; - - /** endRead marks the last character in the buffer, that has been read - from input */ - private int zzEndRead; - - /** zzAtEOF == true <=> the scanner is at the EOF */ - private boolean zzAtEOF; - - /** Number of newlines encountered up to the start of the matched text. */ - @SuppressWarnings("unused") - private int yyline; - - /** Number of characters from the last newline up to the start of the matched text. */ - @SuppressWarnings("unused") - protected int yycolumn; - - /** Number of characters up to the start of the matched text. */ - @SuppressWarnings("unused") - private long yychar; - - /** Whether the scanner is currently at the beginning of a line. */ - @SuppressWarnings("unused") - private boolean zzAtBOL = true; - - /** Whether the user-EOF-code has already been executed. */ - @SuppressWarnings("unused") - private boolean zzEOFDone; - - /* user code: */ -private RsLexerInfo lexerInfo; - -public List getTypeNames() { - return lexerInfo.getTypeNames(); -} - - - /** - * Creates a new scanner - * - * @param in the java.io.Reader to read input from. - */ - _RsOpLexer(java.io.Reader in, RsLexerInfo lexerInfo) { - this.lexerInfo = lexerInfo; - this.zzReader = in; - } - - - /** Returns the maximum size of the scanner buffer, which limits the size of tokens. */ - private int zzMaxBufferLen() { - return Integer.MAX_VALUE; - } - - /** Whether the scanner buffer can grow to accommodate a larger token. */ - private boolean zzCanGrow() { - return true; - } - - /** - * Translates raw input code points to DFA table row - */ - private static int zzCMap(int input) { - int offset = input & 255; - return offset == input ? ZZ_CMAP_BLOCKS[offset] : ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset]; - } - - public final int getTokenStart() { - return zzStartRead; - } - - public final int getTokenEnd() { - return getTokenStart() + yylength(); - } - - public void reset(CharSequence buffer, int start, int end, int initialState) { - zzBuffer = buffer; - zzCurrentPos = zzMarkedPos = zzStartRead = start; - zzAtEOF = false; - zzAtBOL = true; - zzEndRead = end; - yybegin(initialState); - } - - /** - * Refills the input buffer. - * - * @return {@code false}, iff there was new input. - * - * @exception java.io.IOException if any I/O-Error occurs - */ - private boolean zzRefill() throws java.io.IOException { - return true; - } - - - /** - * Returns the current lexical state. - */ - public final int yystate() { - return zzLexicalState; - } - - - /** - * Enters a new lexical state - * - * @param newState the new lexical state - */ - public final void yybegin(int newState) { - zzLexicalState = newState; - } - - - /** - * Returns the text matched by the current regular expression. - */ - public final CharSequence yytext() { - return zzBuffer.subSequence(zzStartRead, zzMarkedPos); - } - - - /** - * Returns the character at position {@code pos} from the - * matched text. - * - * It is equivalent to yytext().charAt(pos), but faster - * - * @param pos the position of the character to fetch. - * A value from 0 to yylength()-1. - * - * @return the character at position pos - */ - public final char yycharat(int pos) { - return zzBuffer.charAt(zzStartRead+pos); - } - - - /** - * Returns the length of the matched text region. - */ - public final int yylength() { - return zzMarkedPos-zzStartRead; - } - - - /** - * Reports an error that occurred while scanning. - * - * In a wellformed scanner (no or only correct usage of - * yypushback(int) and a match-all fallback rule) this method - * will only be called with things that "Can't Possibly Happen". - * If this method is called, something is seriously wrong - * (e.g. a JFlex bug producing a faulty scanner etc.). - * - * Usual syntax/scanner level error handling should be done - * in error fallback rules. - * - * @param errorCode the code of the errormessage to display - */ - private void zzScanError(int errorCode) { - String message; - try { - message = ZZ_ERROR_MSG[errorCode]; - } - catch (ArrayIndexOutOfBoundsException e) { - message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; - } - - throw new Error(message); - } - - - /** - * Pushes the specified amount of characters back into the input stream. - * - * They will be read again by then next call of the scanning method - * - * @param number the number of characters to be read again. - * This number must not be greater than yylength()! - */ - public void yypushback(int number) { - if ( number > yylength() ) - zzScanError(ZZ_PUSHBACK_2BIG); - - zzMarkedPos -= number; - } - - - /** - * Resumes scanning until the next regular expression is matched, - * the end of input is encountered or an I/O-Error occurs. - * - * @return the next token - * @exception java.io.IOException if any I/O-Error occurs - */ - public IElementType advance() throws java.io.IOException - { - int zzInput; - int zzAction; - - // cached fields: - int zzCurrentPosL; - int zzMarkedPosL; - int zzEndReadL = zzEndRead; - CharSequence zzBufferL = zzBuffer; - - int [] zzTransL = ZZ_TRANS; - int [] zzRowMapL = ZZ_ROWMAP; - int [] zzAttrL = ZZ_ATTRIBUTE; - - while (true) { - zzMarkedPosL = zzMarkedPos; - - zzAction = -1; - - zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL; - - zzState = ZZ_LEXSTATE[zzLexicalState]; - - // set up zzAction for empty match case: - int zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - } - - - zzForAction: { - while (true) { - - if (zzCurrentPosL < zzEndReadL) { - zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL); - zzCurrentPosL += Character.charCount(zzInput); - } - else if (zzAtEOF) { - zzInput = YYEOF; - break zzForAction; - } - else { - // store back cached positions - zzCurrentPos = zzCurrentPosL; - zzMarkedPos = zzMarkedPosL; - boolean eof = zzRefill(); - // get translated positions and possibly new buffer - zzCurrentPosL = zzCurrentPos; - zzMarkedPosL = zzMarkedPos; - zzBufferL = zzBuffer; - zzEndReadL = zzEndRead; - if (eof) { - zzInput = YYEOF; - break zzForAction; - } - else { - zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL); - zzCurrentPosL += Character.charCount(zzInput); - } - } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMap(zzInput) ]; - if (zzNext == -1) break zzForAction; - zzState = zzNext; - - zzAttributes = zzAttrL[zzState]; - if ( (zzAttributes & 1) == 1 ) { - zzAction = zzState; - zzMarkedPosL = zzCurrentPosL; - if ( (zzAttributes & 8) == 8 ) break zzForAction; - } - - } - } - - // store back cached position - zzMarkedPos = zzMarkedPosL; - - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - return null; - } - else { - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 1: - { return TokenType.BAD_CHARACTER; - } - // fall through - case 14: break; - case 2: - { return TokenType.WHITE_SPACE; - } - // fall through - case 15: break; - case 3: - { return HASH; - } - // fall through - case 16: break; - case 4: - { return DOLLAR; - } - // fall through - case 17: break; - case 5: - { return LPAREN; - } - // fall through - case 18: break; - case 6: - { return RPAREN; - } - // fall through - case 19: break; - case 7: - { CharSequence lexeme = yytext(); - for (String typeName: getTypeNames()) { - if (typeName.contentEquals(lexeme)) { - return TYPE_LITERAL; - } - } - return IDENTIFIER; - } - // fall through - case 20: break; - case 8: - { return COMMA; - } - // fall through - case 21: break; - case 9: - { return INTEGER; - } - // fall through - case 22: break; - case 10: - { return LBRACKET; - } - // fall through - case 23: break; - case 11: - { return RBRACKET; - } - // fall through - case 24: break; - case 12: - { return SINGLE_LINE_COMMENT; - } - // fall through - case 25: break; - case 13: - { return MULTI_LINE_COMMENT; - } - // fall through - case 26: break; - default: - zzScanError(ZZ_NO_MATCH); - } - } - } - } - - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/parser/RsOpParser.java b/src/main/gen/io/runescript/plugin/oplang/parser/RsOpParser.java deleted file mode 100644 index 4d45419..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/parser/RsOpParser.java +++ /dev/null @@ -1,340 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.parser; - -import com.intellij.lang.PsiBuilder; -import com.intellij.lang.PsiBuilder.Marker; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import static com.intellij.lang.parser.GeneratedParserUtilBase.*; -import com.intellij.psi.tree.IElementType; -import com.intellij.lang.ASTNode; -import com.intellij.psi.tree.TokenSet; -import com.intellij.lang.PsiParser; -import com.intellij.lang.LightPsiParser; - -@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"}) -public class RsOpParser implements PsiParser, LightPsiParser { - - public ASTNode parse(IElementType t, PsiBuilder b) { - parseLight(t, b); - return b.getTreeBuilt(); - } - - public void parseLight(IElementType t, PsiBuilder b) { - boolean r; - b = adapt_builder_(t, b, this, null); - Marker m = enter_section_(b, 0, _COLLAPSE_, null); - r = parse_root_(t, b); - exit_section_(b, 0, m, t, r, true, TRUE_CONDITION); - } - - protected boolean parse_root_(IElementType t, PsiBuilder b) { - return parse_root_(t, b, 0); - } - - static boolean parse_root_(IElementType t, PsiBuilder b, int l) { - return File(b, l + 1); - } - - /* ********************************************************** */ - // '#' '[' NameLiteral ('(' (AttributeValue (',' AttributeValue)*)? ')')? ']' - public static boolean Attribute(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute")) return false; - if (!nextTokenIs(b, HASH)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HASH, LBRACKET); - r = r && NameLiteral(b, l + 1); - r = r && Attribute_3(b, l + 1); - r = r && consumeToken(b, RBRACKET); - exit_section_(b, m, ATTRIBUTE, r); - return r; - } - - // ('(' (AttributeValue (',' AttributeValue)*)? ')')? - private static boolean Attribute_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3")) return false; - Attribute_3_0(b, l + 1); - return true; - } - - // '(' (AttributeValue (',' AttributeValue)*)? ')' - private static boolean Attribute_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, LPAREN); - r = r && Attribute_3_0_1(b, l + 1); - r = r && consumeToken(b, RPAREN); - exit_section_(b, m, null, r); - return r; - } - - // (AttributeValue (',' AttributeValue)*)? - private static boolean Attribute_3_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3_0_1")) return false; - Attribute_3_0_1_0(b, l + 1); - return true; - } - - // AttributeValue (',' AttributeValue)* - private static boolean Attribute_3_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = AttributeValue(b, l + 1); - r = r && Attribute_3_0_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (',' AttributeValue)* - private static boolean Attribute_3_0_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3_0_1_0_1")) return false; - while (true) { - int c = current_position_(b); - if (!Attribute_3_0_1_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "Attribute_3_0_1_0_1", c)) break; - } - return true; - } - - // ',' AttributeValue - private static boolean Attribute_3_0_1_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Attribute_3_0_1_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, COMMA); - r = r && AttributeValue(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // Attribute* - public static boolean AttributeList(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "AttributeList")) return false; - Marker m = enter_section_(b, l, _NONE_, ATTRIBUTE_LIST, ""); - while (true) { - int c = current_position_(b); - if (!Attribute(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "AttributeList", c)) break; - } - exit_section_(b, l, m, true, false, null); - return true; - } - - /* ********************************************************** */ - // NameLiteral | IntegerValue - public static boolean AttributeValue(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "AttributeValue")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, ATTRIBUTE_VALUE, ""); - r = NameLiteral(b, l + 1); - if (!r) r = IntegerValue(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // AttributeList CommandHeader ParameterList ReturnList - public static boolean Command(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Command")) return false; - if (!nextTokenIs(b, "", HASH, LBRACKET)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, COMMAND, ""); - r = AttributeList(b, l + 1); - r = r && CommandHeader(b, l + 1); - r = r && ParameterList(b, l + 1); - r = r && ReturnList(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // '[' NameLiteral ',' NameLiteral ']' - public static boolean CommandHeader(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "CommandHeader")) return false; - if (!nextTokenIs(b, LBRACKET)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, LBRACKET); - r = r && NameLiteral(b, l + 1); - r = r && consumeToken(b, COMMA); - r = r && NameLiteral(b, l + 1); - r = r && consumeToken(b, RBRACKET); - exit_section_(b, m, COMMAND_HEADER, r); - return r; - } - - /* ********************************************************** */ - // Command* - static boolean File(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "File")) return false; - while (true) { - int c = current_position_(b); - if (!Command(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "File", c)) break; - } - return true; - } - - /* ********************************************************** */ - // INTEGER - public static boolean IntegerValue(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "IntegerValue")) return false; - if (!nextTokenIs(b, INTEGER)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, INTEGER); - exit_section_(b, m, INTEGER_VALUE, r); - return r; - } - - /* ********************************************************** */ - // IDENTIFIER | TYPE_LITERAL - public static boolean NameLiteral(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "NameLiteral")) return false; - if (!nextTokenIs(b, "", IDENTIFIER, TYPE_LITERAL)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, NAME_LITERAL, ""); - r = consumeToken(b, IDENTIFIER); - if (!r) r = consumeToken(b, TYPE_LITERAL); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // TypeName '$' NameLiteral - public static boolean Parameter(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "Parameter")) return false; - if (!nextTokenIs(b, TYPE_LITERAL)) return false; - boolean r; - Marker m = enter_section_(b); - r = TypeName(b, l + 1); - r = r && consumeToken(b, DOLLAR); - r = r && NameLiteral(b, l + 1); - exit_section_(b, m, PARAMETER, r); - return r; - } - - /* ********************************************************** */ - // '(' (Parameter (',' Parameter)*)? ')' - public static boolean ParameterList(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ParameterList")) return false; - if (!nextTokenIs(b, LPAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, LPAREN); - r = r && ParameterList_1(b, l + 1); - r = r && consumeToken(b, RPAREN); - exit_section_(b, m, PARAMETER_LIST, r); - return r; - } - - // (Parameter (',' Parameter)*)? - private static boolean ParameterList_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ParameterList_1")) return false; - ParameterList_1_0(b, l + 1); - return true; - } - - // Parameter (',' Parameter)* - private static boolean ParameterList_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ParameterList_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = Parameter(b, l + 1); - r = r && ParameterList_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (',' Parameter)* - private static boolean ParameterList_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ParameterList_1_0_1")) return false; - while (true) { - int c = current_position_(b); - if (!ParameterList_1_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "ParameterList_1_0_1", c)) break; - } - return true; - } - - // ',' Parameter - private static boolean ParameterList_1_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ParameterList_1_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, COMMA); - r = r && Parameter(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // '(' (TypeName (',' TypeName)*)? ')' - public static boolean ReturnList(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ReturnList")) return false; - if (!nextTokenIs(b, LPAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, LPAREN); - r = r && ReturnList_1(b, l + 1); - r = r && consumeToken(b, RPAREN); - exit_section_(b, m, RETURN_LIST, r); - return r; - } - - // (TypeName (',' TypeName)*)? - private static boolean ReturnList_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ReturnList_1")) return false; - ReturnList_1_0(b, l + 1); - return true; - } - - // TypeName (',' TypeName)* - private static boolean ReturnList_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ReturnList_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = TypeName(b, l + 1); - r = r && ReturnList_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (',' TypeName)* - private static boolean ReturnList_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ReturnList_1_0_1")) return false; - while (true) { - int c = current_position_(b); - if (!ReturnList_1_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "ReturnList_1_0_1", c)) break; - } - return true; - } - - // ',' TypeName - private static boolean ReturnList_1_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ReturnList_1_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, COMMA); - r = r && TypeName(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // TYPE_LITERAL - public static boolean TypeName(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "TypeName")) return false; - if (!nextTokenIs(b, TYPE_LITERAL)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, TYPE_LITERAL); - exit_section_(b, m, TYPE_NAME, r); - return r; - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttribute.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttribute.java deleted file mode 100644 index 6bf9152..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttribute.java +++ /dev/null @@ -1,31 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface RsOpAttribute extends PsiElement { - - @NotNull - List getAttributeValueList(); - - @NotNull - RsOpNameLiteral getNameLiteral(); - - @NotNull - PsiElement getHash(); - - @NotNull - PsiElement getLbracket(); - - @Nullable - PsiElement getLparen(); - - @NotNull - PsiElement getRbracket(); - - @Nullable - PsiElement getRparen(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeList.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeList.java deleted file mode 100644 index 82e9da5..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeList.java +++ /dev/null @@ -1,15 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpAttributeListStub; - -public interface RsOpAttributeList extends PsiElement, StubBasedPsiElement { - - @NotNull - List getAttributeList(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeValue.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeValue.java deleted file mode 100644 index 6cee78b..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpAttributeValue.java +++ /dev/null @@ -1,16 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface RsOpAttributeValue extends PsiElement { - - @Nullable - RsOpIntegerValue getIntegerValue(); - - @Nullable - RsOpNameLiteral getNameLiteral(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommand.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommand.java deleted file mode 100644 index 2017d47..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommand.java +++ /dev/null @@ -1,24 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpCommandStub; - -public interface RsOpCommand extends PsiElement, StubBasedPsiElement { - - @NotNull - RsOpAttributeList getAttributeList(); - - @NotNull - RsOpCommandHeader getCommandHeader(); - - @NotNull - RsOpParameterList getParameterList(); - - @NotNull - RsOpReturnList getReturnList(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommandHeader.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommandHeader.java deleted file mode 100644 index fcd4673..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpCommandHeader.java +++ /dev/null @@ -1,24 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpCommandHeaderStub; - -public interface RsOpCommandHeader extends PsiElement, StubBasedPsiElement { - - @NotNull - List getNameLiteralList(); - - @NotNull - PsiElement getComma(); - - @NotNull - PsiElement getLbracket(); - - @NotNull - PsiElement getRbracket(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpElementTypes.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpElementTypes.java deleted file mode 100644 index 32ed1a7..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpElementTypes.java +++ /dev/null @@ -1,74 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.PsiElement; -import com.intellij.lang.ASTNode; -import io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory; -import io.runescript.plugin.oplang.psi.impl.*; - -public interface RsOpElementTypes { - - IElementType ATTRIBUTE = new RsOpElementType("ATTRIBUTE"); - IElementType ATTRIBUTE_LIST = RsOpStubElementTypeFactory.create("ATTRIBUTE_LIST"); - IElementType ATTRIBUTE_VALUE = new RsOpElementType("ATTRIBUTE_VALUE"); - IElementType COMMAND = RsOpStubElementTypeFactory.create("COMMAND"); - IElementType COMMAND_HEADER = RsOpStubElementTypeFactory.create("COMMAND_HEADER"); - IElementType INTEGER_VALUE = new RsOpElementType("INTEGER_VALUE"); - IElementType NAME_LITERAL = RsOpStubElementTypeFactory.create("NAME_LITERAL"); - IElementType PARAMETER = RsOpStubElementTypeFactory.create("PARAMETER"); - IElementType PARAMETER_LIST = RsOpStubElementTypeFactory.create("PARAMETER_LIST"); - IElementType RETURN_LIST = RsOpStubElementTypeFactory.create("RETURN_LIST"); - IElementType TYPE_NAME = RsOpStubElementTypeFactory.create("TYPE_NAME"); - - IElementType COMMA = new RsOpElementType(","); - IElementType DOLLAR = new RsOpElementType("$"); - IElementType HASH = new RsOpElementType("#"); - IElementType IDENTIFIER = new RsOpElementType("IDENTIFIER"); - IElementType INTEGER = new RsOpElementType("INTEGER"); - IElementType LBRACKET = new RsOpElementType("["); - IElementType LPAREN = new RsOpElementType("("); - IElementType RBRACKET = new RsOpElementType("]"); - IElementType RPAREN = new RsOpElementType(")"); - IElementType TYPE_LITERAL = new RsOpElementType("TYPE_LITERAL"); - - class Factory { - public static PsiElement createElement(ASTNode node) { - IElementType type = node.getElementType(); - if (type == ATTRIBUTE) { - return new RsOpAttributeImpl(node); - } - else if (type == ATTRIBUTE_LIST) { - return new RsOpAttributeListImpl(node); - } - else if (type == ATTRIBUTE_VALUE) { - return new RsOpAttributeValueImpl(node); - } - else if (type == COMMAND) { - return new RsOpCommandImpl(node); - } - else if (type == COMMAND_HEADER) { - return new RsOpCommandHeaderImpl(node); - } - else if (type == INTEGER_VALUE) { - return new RsOpIntegerValueImpl(node); - } - else if (type == NAME_LITERAL) { - return new RsOpNameLiteralImpl(node); - } - else if (type == PARAMETER) { - return new RsOpParameterImpl(node); - } - else if (type == PARAMETER_LIST) { - return new RsOpParameterListImpl(node); - } - else if (type == RETURN_LIST) { - return new RsOpReturnListImpl(node); - } - else if (type == TYPE_NAME) { - return new RsOpTypeNameImpl(node); - } - throw new AssertionError("Unknown element type: " + type); - } - } -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpIntegerValue.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpIntegerValue.java deleted file mode 100644 index 4fb26b5..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpIntegerValue.java +++ /dev/null @@ -1,13 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface RsOpIntegerValue extends PsiElement { - - @NotNull - PsiElement getInteger(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpNameLiteral.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpNameLiteral.java deleted file mode 100644 index 14501c7..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpNameLiteral.java +++ /dev/null @@ -1,18 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpNameLiteralStub; - -public interface RsOpNameLiteral extends PsiElement, StubBasedPsiElement { - - @Nullable - PsiElement getIdentifier(); - - @Nullable - PsiElement getTypeLiteral(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameter.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameter.java deleted file mode 100644 index 19b1924..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameter.java +++ /dev/null @@ -1,21 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpParameterStub; - -public interface RsOpParameter extends PsiElement, StubBasedPsiElement { - - @NotNull - RsOpNameLiteral getNameLiteral(); - - @NotNull - RsOpTypeName getTypeName(); - - @NotNull - PsiElement getDollar(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameterList.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameterList.java deleted file mode 100644 index 8d9522f..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpParameterList.java +++ /dev/null @@ -1,21 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpParameterListStub; - -public interface RsOpParameterList extends PsiElement, StubBasedPsiElement { - - @NotNull - List getParameterList(); - - @NotNull - PsiElement getLparen(); - - @NotNull - PsiElement getRparen(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpReturnList.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpReturnList.java deleted file mode 100644 index 42202c2..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpReturnList.java +++ /dev/null @@ -1,21 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpReturnListStub; - -public interface RsOpReturnList extends PsiElement, StubBasedPsiElement { - - @NotNull - List getTypeNameList(); - - @NotNull - PsiElement getLparen(); - - @NotNull - PsiElement getRparen(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpTypeName.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpTypeName.java deleted file mode 100644 index 5b90593..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpTypeName.java +++ /dev/null @@ -1,15 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.psi.StubBasedPsiElement; -import io.runescript.plugin.oplang.psi.stub.RsOpTypeNameStub; - -public interface RsOpTypeName extends PsiElement, StubBasedPsiElement { - - @NotNull - PsiElement getTypeLiteral(); - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpVisitor.java b/src/main/gen/io/runescript/plugin/oplang/psi/RsOpVisitor.java deleted file mode 100644 index 4331c2a..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/RsOpVisitor.java +++ /dev/null @@ -1,58 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi; - -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.PsiElement; - -public class RsOpVisitor extends PsiElementVisitor { - - public void visitAttribute(@NotNull RsOpAttribute o) { - visitPsiElement(o); - } - - public void visitAttributeList(@NotNull RsOpAttributeList o) { - visitPsiElement(o); - } - - public void visitAttributeValue(@NotNull RsOpAttributeValue o) { - visitPsiElement(o); - } - - public void visitCommand(@NotNull RsOpCommand o) { - visitPsiElement(o); - } - - public void visitCommandHeader(@NotNull RsOpCommandHeader o) { - visitPsiElement(o); - } - - public void visitIntegerValue(@NotNull RsOpIntegerValue o) { - visitPsiElement(o); - } - - public void visitNameLiteral(@NotNull RsOpNameLiteral o) { - visitPsiElement(o); - } - - public void visitParameter(@NotNull RsOpParameter o) { - visitPsiElement(o); - } - - public void visitParameterList(@NotNull RsOpParameterList o) { - visitPsiElement(o); - } - - public void visitReturnList(@NotNull RsOpReturnList o) { - visitPsiElement(o); - } - - public void visitTypeName(@NotNull RsOpTypeName o) { - visitPsiElement(o); - } - - public void visitPsiElement(@NotNull PsiElement o) { - visitElement(o); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeImpl.java deleted file mode 100644 index d8f1c18..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.ASTWrapperPsiElement; -import io.runescript.plugin.oplang.psi.*; - -public class RsOpAttributeImpl extends ASTWrapperPsiElement implements RsOpAttribute { - - public RsOpAttributeImpl(@NotNull ASTNode node) { - super(node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitAttribute(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getAttributeValueList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, RsOpAttributeValue.class); - } - - @Override - @NotNull - public RsOpNameLiteral getNameLiteral() { - return notNullChild(PsiTreeUtil.getChildOfType(this, RsOpNameLiteral.class)); - } - - @Override - @NotNull - public PsiElement getHash() { - return notNullChild(findChildByType(HASH)); - } - - @Override - @NotNull - public PsiElement getLbracket() { - return notNullChild(findChildByType(LBRACKET)); - } - - @Override - @Nullable - public PsiElement getLparen() { - return findChildByType(LPAREN); - } - - @Override - @NotNull - public PsiElement getRbracket() { - return notNullChild(findChildByType(RBRACKET)); - } - - @Override - @Nullable - public PsiElement getRparen() { - return findChildByType(RPAREN); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeListImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeListImpl.java deleted file mode 100644 index 6064f4e..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeListImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpAttributeListStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpAttributeListImpl extends StubBasedPsiElementBase implements RsOpAttributeList { - - public RsOpAttributeListImpl(@NotNull RsOpAttributeListStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpAttributeListImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpAttributeListImpl(RsOpAttributeListStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitAttributeList(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getAttributeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, RsOpAttribute.class); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeValueImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeValueImpl.java deleted file mode 100644 index 1a86d6d..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpAttributeValueImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.ASTWrapperPsiElement; -import io.runescript.plugin.oplang.psi.*; - -public class RsOpAttributeValueImpl extends ASTWrapperPsiElement implements RsOpAttributeValue { - - public RsOpAttributeValueImpl(@NotNull ASTNode node) { - super(node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitAttributeValue(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public RsOpIntegerValue getIntegerValue() { - return PsiTreeUtil.getChildOfType(this, RsOpIntegerValue.class); - } - - @Override - @Nullable - public RsOpNameLiteral getNameLiteral() { - return PsiTreeUtil.getChildOfType(this, RsOpNameLiteral.class); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandHeaderImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandHeaderImpl.java deleted file mode 100644 index 3c85c09..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandHeaderImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpCommandHeaderStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpCommandHeaderImpl extends StubBasedPsiElementBase implements RsOpCommandHeader { - - public RsOpCommandHeaderImpl(@NotNull RsOpCommandHeaderStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpCommandHeaderImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpCommandHeaderImpl(RsOpCommandHeaderStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitCommandHeader(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getNameLiteralList() { - return PsiTreeUtil.getStubChildrenOfTypeAsList(this, RsOpNameLiteral.class); - } - - @Override - @NotNull - public PsiElement getComma() { - return notNullChild(findChildByType(COMMA)); - } - - @Override - @NotNull - public PsiElement getLbracket() { - return notNullChild(findChildByType(LBRACKET)); - } - - @Override - @NotNull - public PsiElement getRbracket() { - return notNullChild(findChildByType(RBRACKET)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandImpl.java deleted file mode 100644 index 308dadc..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpCommandImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpCommandStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpCommandImpl extends StubBasedPsiElementBase implements RsOpCommand { - - public RsOpCommandImpl(@NotNull RsOpCommandStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpCommandImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpCommandImpl(RsOpCommandStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitCommand(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public RsOpAttributeList getAttributeList() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpAttributeList.class)); - } - - @Override - @NotNull - public RsOpCommandHeader getCommandHeader() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpCommandHeader.class)); - } - - @Override - @NotNull - public RsOpParameterList getParameterList() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpParameterList.class)); - } - - @Override - @NotNull - public RsOpReturnList getReturnList() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpReturnList.class)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpIntegerValueImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpIntegerValueImpl.java deleted file mode 100644 index f8169cf..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpIntegerValueImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.ASTWrapperPsiElement; -import io.runescript.plugin.oplang.psi.*; - -public class RsOpIntegerValueImpl extends ASTWrapperPsiElement implements RsOpIntegerValue { - - public RsOpIntegerValueImpl(@NotNull ASTNode node) { - super(node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitIntegerValue(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public PsiElement getInteger() { - return notNullChild(findChildByType(INTEGER)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpNameLiteralImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpNameLiteralImpl.java deleted file mode 100644 index 0ca0611..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpNameLiteralImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpNameLiteralStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpNameLiteralImpl extends StubBasedPsiElementBase implements RsOpNameLiteral { - - public RsOpNameLiteralImpl(@NotNull RsOpNameLiteralStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpNameLiteralImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpNameLiteralImpl(RsOpNameLiteralStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitNameLiteral(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public PsiElement getIdentifier() { - return findChildByType(IDENTIFIER); - } - - @Override - @Nullable - public PsiElement getTypeLiteral() { - return findChildByType(TYPE_LITERAL); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterImpl.java deleted file mode 100644 index 3df98fc..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpParameterStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpParameterImpl extends StubBasedPsiElementBase implements RsOpParameter { - - public RsOpParameterImpl(@NotNull RsOpParameterStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpParameterImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpParameterImpl(RsOpParameterStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitParameter(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public RsOpNameLiteral getNameLiteral() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpNameLiteral.class)); - } - - @Override - @NotNull - public RsOpTypeName getTypeName() { - return notNullChild(PsiTreeUtil.getStubChildOfType(this, RsOpTypeName.class)); - } - - @Override - @NotNull - public PsiElement getDollar() { - return notNullChild(findChildByType(DOLLAR)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterListImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterListImpl.java deleted file mode 100644 index c6f52c4..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpParameterListImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpParameterListStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpParameterListImpl extends StubBasedPsiElementBase implements RsOpParameterList { - - public RsOpParameterListImpl(@NotNull RsOpParameterListStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpParameterListImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpParameterListImpl(RsOpParameterListStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitParameterList(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getParameterList() { - return PsiTreeUtil.getStubChildrenOfTypeAsList(this, RsOpParameter.class); - } - - @Override - @NotNull - public PsiElement getLparen() { - return notNullChild(findChildByType(LPAREN)); - } - - @Override - @NotNull - public PsiElement getRparen() { - return notNullChild(findChildByType(RPAREN)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpReturnListImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpReturnListImpl.java deleted file mode 100644 index 366c92b..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpReturnListImpl.java +++ /dev/null @@ -1,59 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpReturnListStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpReturnListImpl extends StubBasedPsiElementBase implements RsOpReturnList { - - public RsOpReturnListImpl(@NotNull RsOpReturnListStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpReturnListImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpReturnListImpl(RsOpReturnListStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitReturnList(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getTypeNameList() { - return PsiTreeUtil.getStubChildrenOfTypeAsList(this, RsOpTypeName.class); - } - - @Override - @NotNull - public PsiElement getLparen() { - return notNullChild(findChildByType(LPAREN)); - } - - @Override - @NotNull - public PsiElement getRparen() { - return notNullChild(findChildByType(RPAREN)); - } - -} diff --git a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpTypeNameImpl.java b/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpTypeNameImpl.java deleted file mode 100644 index cf8f3ca..0000000 --- a/src/main/gen/io/runescript/plugin/oplang/psi/impl/RsOpTypeNameImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -// This class is automatically generated. Do not edit. -package io.runescript.plugin.oplang.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -import com.intellij.extapi.psi.StubBasedPsiElementBase; -import io.runescript.plugin.oplang.psi.stub.RsOpTypeNameStub; -import io.runescript.plugin.oplang.psi.*; -import com.intellij.psi.stubs.IStubElementType; -import com.intellij.psi.tree.IElementType; - -public class RsOpTypeNameImpl extends StubBasedPsiElementBase implements RsOpTypeName { - - public RsOpTypeNameImpl(@NotNull RsOpTypeNameStub stub, @NotNull IStubElementType type) { - super(stub, type); - } - - public RsOpTypeNameImpl(@NotNull ASTNode node) { - super(node); - } - - public RsOpTypeNameImpl(RsOpTypeNameStub stub, IElementType type, ASTNode node) { - super(stub, type, node); - } - - public void accept(@NotNull RsOpVisitor visitor) { - visitor.visitTypeName(this); - } - - @Override - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof RsOpVisitor) accept((RsOpVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public PsiElement getTypeLiteral() { - return notNullChild(findChildByType(TYPE_LITERAL)); - } - -} diff --git a/src/main/grammars/Opcode.bnf b/src/main/grammars/Opcode.bnf deleted file mode 100644 index d7c79e5..0000000 --- a/src/main/grammars/Opcode.bnf +++ /dev/null @@ -1,63 +0,0 @@ -{ - parserClass="io.runescript.plugin.oplang.parser.RsOpParser" - - extends="com.intellij.extapi.psi.ASTWrapperPsiElement" - - psiClassPrefix="RsOp" - psiImplClassSuffix="Impl" - psiPackage="io.runescript.plugin.oplang.psi" - psiImplPackage="io.runescript.plugin.oplang.psi.impl" - elementTypeHolderClass="io.runescript.plugin.oplang.psi.RsOpElementTypes" - elementTypeClass="io.runescript.plugin.oplang.psi.RsOpElementType" - tokenTypeClass="io.runescript.plugin.oplang.psi.RsOpElementType" - generateTokenAccessors=true - classHeader="// This class is automatically generated. Do not edit." - tokens=[ - LBRACKET='[' - RBRACKET=']' - LPAREN='(' - RPAREN=')' - COMMA=',' - HASH='#' - DOLLAR='$' - ] -} - -File ::= Command* - -Command ::= AttributeList CommandHeader ParameterList ReturnList { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpCommandStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} - -AttributeList ::= Attribute* { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpAttributeListStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -Attribute ::= '#' '[' NameLiteral ('(' (AttributeValue (',' AttributeValue)*)? ')')? ']' -AttributeValue ::= NameLiteral | IntegerValue -IntegerValue ::= INTEGER -CommandHeader ::= '[' NameLiteral ',' NameLiteral ']' { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpCommandHeaderStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -ParameterList ::= '(' (Parameter (',' Parameter)*)? ')' { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpParameterListStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -Parameter ::= TypeName '$' NameLiteral { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpParameterStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -ReturnList ::= '(' (TypeName (',' TypeName)*)? ')' { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpReturnListStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -TypeName ::= TYPE_LITERAL { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpTypeNameStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} -NameLiteral ::= IDENTIFIER | TYPE_LITERAL { - stubClass="io.runescript.plugin.oplang.psi.stub.RsOpNameLiteralStub" - elementTypeFactory = "io.runescript.plugin.oplang.psi.stub.RsOpStubElementTypeFactory.create" -} \ No newline at end of file diff --git a/src/main/grammars/Opcode.flex b/src/main/grammars/Opcode.flex deleted file mode 100644 index b76ed36..0000000 --- a/src/main/grammars/Opcode.flex +++ /dev/null @@ -1,68 +0,0 @@ -package io.runescript.plugin.oplang.lexer; - -import com.intellij.lexer.FlexLexer; -import com.intellij.psi.TokenType; -import com.intellij.psi.tree.IElementType; -import io.runescript.plugin.lang.lexer.RsLexerInfo; - -import java.util.List; - -import static io.runescript.plugin.lang.psi.RsTokenTypes.*; -import static io.runescript.plugin.oplang.psi.RsOpElementTypes.*; -%% - -%{ -private RsLexerInfo lexerInfo; - -public List getTypeNames() { - return lexerInfo.getTypeNames(); -} -%} - -%ctorarg RsLexerInfo lexerInfo -%init{ -this.lexerInfo = lexerInfo; -%init} - -%class _RsOpLexer -%implements FlexLexer -%unicode -%function advance -%type IElementType -SINGLE_LINE_COMMENT = "//"([^\r\n]*)(\r|\n|\r\n) -MULTI_LINE_COMMENT = "/*" [^*] ~"*/" | "/*" "*"+ "/" -IDENTIFIER_PART = [a-zA-Z0-9_+\.] -IDENTIFIER = ({IDENTIFIER_PART})+ -DECIMAL_DIGIT = [0-9] -HEX_DIGIT = [0-9a-fA-F] -HEX_INTEGER = 0[xX]({HEX_DIGIT})+ -DECIMAL_INTEGER = ({DECIMAL_DIGIT})+ -INTEGER = ({DECIMAL_INTEGER})|({HEX_INTEGER}) - -%% - { -{MULTI_LINE_COMMENT} { return MULTI_LINE_COMMENT; } -{SINGLE_LINE_COMMENT} { return SINGLE_LINE_COMMENT; } -{INTEGER} { return INTEGER; } -{IDENTIFIER} { - CharSequence lexeme = yytext(); - for (String typeName: getTypeNames()) { - if (typeName.contentEquals(lexeme)) { - return TYPE_LITERAL; - } - } - return IDENTIFIER; -} - -// Separators -"[" { return LBRACKET; } -"]" { return RBRACKET; } -"(" { return LPAREN; } -")" { return RPAREN; } -"," { return COMMA; } -"#" { return HASH; } -"$" { return DOLLAR; } -// Ignored -[\ \t\r\n] { return TokenType.WHITE_SPACE; } -[^] { return TokenType.BAD_CHARACTER; } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/ide/RsGotoClassContributor.kt b/src/main/kotlin/io/runescript/plugin/ide/RsGotoClassContributor.kt index a42a32c..8fbf470 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/RsGotoClassContributor.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/RsGotoClassContributor.kt @@ -11,12 +11,12 @@ import com.intellij.util.indexing.IdFilter import io.runescript.plugin.lang.RuneScript import io.runescript.plugin.lang.psi.RsScript import io.runescript.plugin.lang.psi.qualifiedName -import io.runescript.plugin.lang.stubs.index.RsGotoScriptIndex +import io.runescript.plugin.lang.stubs.index.RsProcScriptIndex class RsGotoClassContributor : ChooseByNameContributorEx, GotoClassContributor { override fun processNames(processor: Processor, scope: GlobalSearchScope, filter: IdFilter?) { StubIndex.getInstance().processAllKeys( - RsGotoScriptIndex.KEY, + RsProcScriptIndex.KEY, processor, scope, null @@ -26,7 +26,7 @@ class RsGotoClassContributor : ChooseByNameContributorEx, GotoClassContributor { override fun processElementsWithName(name: String, processor: Processor, parameters: FindSymbolParameters) { val originScope = parameters.searchScope StubIndex.getInstance().processElements( - RsGotoScriptIndex.KEY, + RsProcScriptIndex.KEY, name, parameters.project, originScope, diff --git a/src/main/kotlin/io/runescript/plugin/ide/codeInsight/RsInlayParameterHintsProvider.kt b/src/main/kotlin/io/runescript/plugin/ide/codeInsight/RsInlayParameterHintsProvider.kt index d395b48..7ac899b 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/codeInsight/RsInlayParameterHintsProvider.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/codeInsight/RsInlayParameterHintsProvider.kt @@ -5,7 +5,6 @@ import com.intellij.codeInsight.hints.InlayParameterHintsProvider import com.intellij.psi.PsiElement import com.intellij.refactoring.suggested.startOffset import io.runescript.plugin.lang.psi.* -import io.runescript.plugin.oplang.psi.RsOpCommand @Suppress("UnstableApiUsage") class RsInlayParameterHintsProvider : InlayParameterHintsProvider { @@ -77,18 +76,12 @@ class RsInlayParameterHintsProvider : InlayParameterHintsProvider { private fun getParametersList(element: PsiElement): List? { return when (element) { - is RsGosubExpression -> { + is RsGosubExpression, is RsCommandExpression -> { val reference = element.reference?.resolve() ?: return null reference as RsScript reference.parameterList?.parameterList?.map { it.localVariableExpression.name!! } } - is RsCommandExpression -> { - val reference = element.reference?.resolve() ?: return null - reference as RsOpCommand - reference.parameterList.parameterList.map { it.nameLiteral.text } - } - else -> return null } } diff --git a/src/main/kotlin/io/runescript/plugin/ide/doc/RsDocumentationProvider.kt b/src/main/kotlin/io/runescript/plugin/ide/doc/RsDocumentationProvider.kt index 6787c8c..4720cf9 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/doc/RsDocumentationProvider.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/doc/RsDocumentationProvider.kt @@ -4,7 +4,6 @@ import com.intellij.lang.documentation.AbstractDocumentationProvider import com.intellij.psi.PsiElement import io.runescript.plugin.ide.highlight.RsSyntaxHighlighterColors import io.runescript.plugin.lang.psi.* -import io.runescript.plugin.oplang.psi.RsOpCommand class RsDocumentationProvider : AbstractDocumentationProvider() { @@ -67,35 +66,6 @@ class RsDocumentationProvider : AbstractDocumentationProvider() { return builder.build() } - is RsOpCommand -> { - val builder = createDocumentationGenerator() - builder.appendHighlighted(element.commandHeader.text, RsSyntaxHighlighterColors.SCRIPT_DECLARATION) - builder.appendLParen() - var appendComma = false - element.parameterList.parameterList.forEach { - if (appendComma) { - builder.appendComma(", ") - } else { - appendComma = true - } - builder.appendKeyword(it.typeName.text) - builder.appendHighlighted(" $${it.nameLiteral.text}", RsSyntaxHighlighterColors.LOCAL_VARIABLE) - } - builder.appendRParen() - appendComma = false - builder.appendLParen() - element.returnList.typeNameList.forEach { - if (appendComma) { - builder.appendComma(", ") - } else { - appendComma = true - } - builder.appendKeyword(it.text) - } - builder.appendRParen() - return builder.build() - } - else -> return null } } diff --git a/src/main/kotlin/io/runescript/plugin/ide/highlight/RsHighlightingAnnotator.kt b/src/main/kotlin/io/runescript/plugin/ide/highlight/RsHighlightingAnnotator.kt index fdc7b34..e6c1ffb 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/highlight/RsHighlightingAnnotator.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/highlight/RsHighlightingAnnotator.kt @@ -9,7 +9,6 @@ import com.intellij.psi.PsiElement import com.intellij.refactoring.suggested.endOffset import com.intellij.refactoring.suggested.startOffset import io.runescript.plugin.lang.psi.* -import io.runescript.plugin.oplang.psi.RsOpCommand import io.runescript.plugin.symbollang.psi.RsSymSymbol class RsHighlightingAnnotator : Annotator { @@ -58,7 +57,12 @@ class RsHighlightingAnnotator : Annotator { val reference = o.reference?.resolve() ?: return when (reference) { is RsLocalVariableExpression -> o.highlight(holder, RsSyntaxHighlighterColors.LOCAL_VARIABLE) - is RsOpCommand -> o.highlight(holder, RsSyntaxHighlighterColors.COMMAND_CALL) + is RsScript -> { + if (reference.triggerName == "command") { + o.highlight(holder, RsSyntaxHighlighterColors.COMMAND_CALL) + } + } + is RsSymSymbol -> o.highlight(holder, RsSyntaxHighlighterColors.CONFIG_REFERENCE) } } diff --git a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptMissingScriptSymbolInspection.kt b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptMissingScriptSymbolInspection.kt index 9b45ea2..b5d1cb8 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptMissingScriptSymbolInspection.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptMissingScriptSymbolInspection.kt @@ -8,10 +8,7 @@ import com.intellij.psi.PsiElementVisitor import com.intellij.refactoring.suggested.endOffset import com.intellij.refactoring.suggested.startOffset import io.runescript.plugin.ide.RsBundle -import io.runescript.plugin.lang.psi.RsScript -import io.runescript.plugin.lang.psi.RsVisitor -import io.runescript.plugin.lang.psi.isSourceFile -import io.runescript.plugin.lang.psi.qualifiedName +import io.runescript.plugin.lang.psi.* import io.runescript.plugin.lang.psi.type.RsPrimitiveType import io.runescript.plugin.symbollang.psi.index.RsSymbolIndex @@ -21,7 +18,7 @@ class RuneScriptMissingScriptSymbolInspection : LocalInspectionTool() { return object : RsVisitor() { override fun visitScript(o: RsScript) { - if (!o.isSourceFile()) return + if (!o.isSourceFile() || o.triggerName == "command") return val name = o.qualifiedName val length = o.rbracket.endOffset - o.lbracket.startOffset val range = TextRange.from(o.lbracket.startOffsetInParent, length) diff --git a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptUnresolvedCommandInspection.kt b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptUnresolvedCommandInspection.kt index 1e3526c..fcb625e 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptUnresolvedCommandInspection.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/inspections/RuneScriptUnresolvedCommandInspection.kt @@ -25,4 +25,4 @@ class RuneScriptUnresolvedCommandInspection : LocalInspectionTool() { } } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/io/runescript/plugin/ide/sdk/RsSdkSetupValidator.kt b/src/main/kotlin/io/runescript/plugin/ide/sdk/RsSdkSetupValidator.kt index d915de2..dc04ce2 100644 --- a/src/main/kotlin/io/runescript/plugin/ide/sdk/RsSdkSetupValidator.kt +++ b/src/main/kotlin/io/runescript/plugin/ide/sdk/RsSdkSetupValidator.kt @@ -11,7 +11,6 @@ import com.intellij.ui.EditorNotificationPanel import io.runescript.plugin.ide.RsBundle import io.runescript.plugin.ide.filetypes.RsFileType import io.runescript.plugin.lang.RuneScript -import io.runescript.plugin.oplang.filetypes.RsOpFileType class RsSdkSetupValidator : ProjectSdkSetupValidator { @@ -19,7 +18,7 @@ class RsSdkSetupValidator : ProjectSdkSetupValidator { override fun isApplicableFor(project: Project, file: VirtualFile): Boolean { val fileType = file.fileType when (fileType) { - is RsFileType, RsOpFileType -> { + is RsFileType -> { val psiFile = PsiManager.getInstance(project).findFile(file) ?: return false return psiFile.language.isKindOf(RuneScript) } diff --git a/src/main/kotlin/io/runescript/plugin/lang/parser/RsParserDefinition.kt b/src/main/kotlin/io/runescript/plugin/lang/parser/RsParserDefinition.kt index 1a2525b..bb48d58 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/parser/RsParserDefinition.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/parser/RsParserDefinition.kt @@ -10,12 +10,10 @@ import com.intellij.psi.PsiElement import com.intellij.psi.PsiFile import com.intellij.psi.tree.IFileElementType import com.intellij.psi.tree.TokenSet -import io.runescript.plugin.ide.filetypes.RsFileType -import io.runescript.plugin.lang.psi.* +import io.runescript.plugin.lang.psi.RsElementTypes +import io.runescript.plugin.lang.psi.RsFile +import io.runescript.plugin.lang.psi.RsTokenTypesSets import io.runescript.plugin.lang.stubs.types.RsFileStubType -import io.runescript.plugin.oplang.filetypes.RsOpFileType -import io.runescript.plugin.oplang.psi.RsOpElementTypes -import io.runescript.plugin.oplang.psi.RsOpFile class RsParserDefinition : ParserDefinition { @@ -40,17 +38,10 @@ class RsParserDefinition : ParserDefinition { } override fun createElement(node: ASTNode?): PsiElement { - return when (node!!.elementType) { - is RsStubType<*, *>, is RsElementType -> RsElementTypes.Factory.createElement(node) - else -> RsOpElementTypes.Factory.createElement(node) - } + return RsElementTypes.Factory.createElement(node) } override fun createFile(viewProvider: FileViewProvider): PsiFile { - return when (val extension = viewProvider.virtualFile.extension) { - RsOpFileType.defaultExtension -> RsOpFile(viewProvider) - RsFileType.defaultExtension -> RsFile(viewProvider) - else -> error("Unrecognized extension: $extension") - } + return RsFile(viewProvider) } } \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/RsPsiExtensions.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/RsPsiExtensions.kt index f933b4b..a1efe32 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/RsPsiExtensions.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/RsPsiExtensions.kt @@ -4,7 +4,6 @@ import com.intellij.psi.util.CachedValueProvider import com.intellij.psi.util.CachedValuesManager import io.runescript.plugin.lang.psi.type.RsPrimitiveType import io.runescript.plugin.lang.psi.type.RsType -import io.runescript.plugin.oplang.psi.RsOpCommand fun RsStringLiteralContent.isBasicContent(): Boolean { val first = node.firstChildNode ?: return true @@ -20,11 +19,11 @@ fun RsStringLiteralContent.isHookExpression(): Boolean = CachedValuesManager.get if (commandExpr is RsCommandExpression) { val argumentIndex = argumentList.expressionList.indexOf(argument) val reference = commandExpr.reference?.resolve() - if (reference is RsOpCommand) { - val parameterList = reference.parameterList.parameterList + if (reference is RsScript) { + val parameterList = reference.parameterList?.parameterList ?: emptyList() if (argumentIndex < parameterList.size) { val hookParameter = parameterList[argumentIndex] - val isHookType = RsPrimitiveType.lookupOrNull(hookParameter.typeName.text)?.isHookType() + val isHookType = RsPrimitiveType.lookupOrNull(hookParameter.typeName!!.text)?.isHookType() return@getCachedValue CachedValueProvider.Result(isHookType ?: false, this) } } diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsCommandExpressionReference.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsCommandExpressionReference.kt index 1241346..73172b1 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsCommandExpressionReference.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsCommandExpressionReference.kt @@ -8,13 +8,13 @@ import com.intellij.psi.ResolveResult import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.stubs.StubIndex import io.runescript.plugin.lang.psi.RsCommandExpression -import io.runescript.plugin.oplang.psi.RsOpCommand -import io.runescript.plugin.oplang.psi.index.RsCommandIndex +import io.runescript.plugin.lang.psi.RsScript +import io.runescript.plugin.lang.stubs.index.RsCommandScriptIndex class RsCommandExpressionReference(element: RsCommandExpression) : PsiPolyVariantReferenceBase(element, element.nameLiteral.textRangeInParent) { override fun multiResolve(incompleteCode: Boolean): Array { - val elements = StubIndex.getElements(RsCommandIndex.KEY, element.nameLiteral.text, element.project, GlobalSearchScope.allScope(element.project), RsOpCommand::class.java) + val elements = StubIndex.getElements(RsCommandScriptIndex.KEY, element.nameLiteral.text, element.project, GlobalSearchScope.allScope(element.project), RsScript::class.java) return elements.map { PsiElementResolveResult(it) }.toTypedArray() } diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsDynamicExpressionReference.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsDynamicExpressionReference.kt index e25d0e6..3e8b987 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsDynamicExpressionReference.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsDynamicExpressionReference.kt @@ -5,14 +5,14 @@ import com.intellij.psi.* import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.stubs.StubIndex import io.runescript.plugin.lang.psi.RsDynamicExpression +import io.runescript.plugin.lang.psi.RsScript import io.runescript.plugin.lang.psi.scope.RsLocalVariableResolver import io.runescript.plugin.lang.psi.scope.RsResolveMode import io.runescript.plugin.lang.psi.scope.RsScopesUtil import io.runescript.plugin.lang.psi.type.RsPrimitiveType import io.runescript.plugin.lang.psi.type.RsType import io.runescript.plugin.lang.psi.type.type -import io.runescript.plugin.oplang.psi.RsOpCommand -import io.runescript.plugin.oplang.psi.index.RsCommandIndex +import io.runescript.plugin.lang.stubs.index.RsCommandScriptIndex import io.runescript.plugin.symbollang.psi.index.RsSymbolIndex class RsDynamicExpressionReference(element: RsDynamicExpression) : PsiPolyVariantReferenceBase(element, element.nameLiteral.textRangeInParent) { @@ -50,7 +50,7 @@ class RsDynamicExpressionReference(element: RsDynamicExpression) : PsiPolyVarian // Try to resolve the element as a command reference. val searchScope = GlobalSearchScope.allScope(project) - return StubIndex.getElements(RsCommandIndex.KEY, elementName, project, searchScope, RsOpCommand::class.java) + return StubIndex.getElements(RsCommandScriptIndex.KEY, elementName, project, searchScope, RsScript::class.java) .map { PsiElementResolveResult(it) } .toTypedArray() } diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsGosubReference.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsGosubReference.kt index ce6d311..48ecc44 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsGosubReference.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/refs/RsGosubReference.kt @@ -9,12 +9,12 @@ import com.intellij.psi.search.GlobalSearchScope import com.intellij.psi.stubs.StubIndex import io.runescript.plugin.lang.psi.RsGosubExpression import io.runescript.plugin.lang.psi.RsScript -import io.runescript.plugin.lang.stubs.index.RsGotoScriptIndex +import io.runescript.plugin.lang.stubs.index.RsProcScriptIndex class RsGosubReference(element: RsGosubExpression) : PsiPolyVariantReferenceBase(element, element.nameLiteral.textRangeInParent) { override fun multiResolve(incompleteCode: Boolean): Array { - val elements = StubIndex.getElements(RsGotoScriptIndex.KEY, element.nameLiteral.text, element.project, GlobalSearchScope.allScope(element.project), RsScript::class.java) + val elements = StubIndex.getElements(RsProcScriptIndex.KEY, element.nameLiteral.text, element.project, GlobalSearchScope.allScope(element.project), RsScript::class.java) return elements.map { PsiElementResolveResult(it) }.toTypedArray() } diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/CommandHandler.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/CommandHandler.kt index 009e697..6bcd0ce 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/CommandHandler.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/CommandHandler.kt @@ -2,27 +2,29 @@ package io.runescript.plugin.lang.psi.type.inference import io.runescript.plugin.lang.psi.RsCommandExpression import io.runescript.plugin.lang.psi.RsDynamicExpression +import io.runescript.plugin.lang.psi.RsScript import io.runescript.plugin.lang.psi.type.* -import io.runescript.plugin.oplang.psi.RsOpCommand import io.runescript.plugin.symbollang.psi.index.RsSymbolIndex sealed interface CommandHandler { - fun RsTypeInferenceVisitor.inferTypes(reference: RsOpCommand, o: RsCommandExpression) + fun RsTypeInferenceVisitor.inferTypes(reference: RsScript, o: RsCommandExpression) } data object DefaultCommandHandler : CommandHandler { - override fun RsTypeInferenceVisitor.inferTypes(reference: RsOpCommand, o: RsCommandExpression) { + override fun RsTypeInferenceVisitor.inferTypes(reference: RsScript, o: RsCommandExpression) { val parameterTypes = reference .parameterList - .parameterList - .map { RsPrimitiveType.lookup(it.typeName.text) } - .flatten() + ?.parameterList + ?.map { RsPrimitiveType.lookup(it.typeName!!.text) } + ?.flatten() + ?: emptyArray() checkArgumentList(o.argumentList, parameterTypes) val returnTypes = reference .returnList - .typeNameList - .map { RsPrimitiveType.lookupReferencable(it.text) } + ?.typeNameList + ?.map { RsPrimitiveType.lookupReferencable(it.text) } + ?: emptyList() if (returnTypes.isEmpty()) { o.type = RsUnitType @@ -35,7 +37,7 @@ data object DefaultCommandHandler : CommandHandler { } class ParamCommandHandler(private val subjectType: RsPrimitiveType) : CommandHandler { - override fun RsTypeInferenceVisitor.inferTypes(reference: RsOpCommand, o: RsCommandExpression) { + override fun RsTypeInferenceVisitor.inferTypes(reference: RsScript, o: RsCommandExpression) { val arguments = o.argumentList.expressionList var outputType: RsType? = null if (o.argumentList.expressionList.size >= 2) { @@ -74,7 +76,7 @@ class ParamCommandHandler(private val subjectType: RsPrimitiveType) : CommandHan } class DbFindCommandHandler(private val withCount: Boolean) : CommandHandler { - override fun RsTypeInferenceVisitor.inferTypes(reference: RsOpCommand, o: RsCommandExpression) { + override fun RsTypeInferenceVisitor.inferTypes(reference: RsScript, o: RsCommandExpression) { val arguments = o.argumentList.expressionList var keyType: RsType? = null if (arguments[0] is RsDynamicExpression) { @@ -116,9 +118,10 @@ class DbFindCommandHandler(private val withCount: Boolean) : CommandHandler { val DB_FIND_REFINE_WITH_COUNT = DbFindCommandHandler(true) } } + data object DbGetFieldCommandHandler : CommandHandler { override fun RsTypeInferenceVisitor.inferTypes( - reference: RsOpCommand, + reference: RsScript, o: RsCommandExpression ) { val arguments = o.argumentList.expressionList @@ -153,7 +156,7 @@ data object DbGetFieldCommandHandler : CommandHandler { data object EnumCommandHandler : CommandHandler { override fun RsTypeInferenceVisitor.inferTypes( - reference: RsOpCommand, + reference: RsScript, o: RsCommandExpression ) { val arguments = o.argumentList.expressionList diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt index 00cfca9..14da803 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/type/inference/RsTypeInferenceVisitor.kt @@ -10,7 +10,6 @@ import io.runescript.plugin.lang.psi.* import io.runescript.plugin.lang.psi.refs.RsDynamicExpressionReference import io.runescript.plugin.lang.psi.type.* import io.runescript.plugin.lang.psi.type.trigger.RsTriggerType -import io.runescript.plugin.oplang.psi.RsOpCommand import io.runescript.plugin.symbollang.psi.RsSymSymbol import io.runescript.plugin.symbollang.psi.index.RsSymbolIndex import kotlin.contracts.ExperimentalContracts @@ -64,6 +63,9 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV val expectedParametersType = expectedParameterTypes.toList().fold() checkTypeMismatch(o.scriptNameExpression, actualParametersType, expectedParametersType) } + if (o.statementList.statementList.size > 0 && triggerType == RsTriggerType.COMMAND) { + o.statementList.error(RsBundle.message("inspection.error.trigger.code.not.allowed")) + } o.statementList.accept(this) } @@ -155,16 +157,16 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV o.type = RsErrorType } else { reference as RsScript - val parameterTypes = reference + val expectedTypes = reference .parameterList ?.parameterList ?.map { findParameterType(it) } ?.flatten() ?: emptyArray() - // TODO(Walied): This is off, it doesnt' check if the argument list is not present - o.argumentList?.let { - checkArgumentList(it, parameterTypes) - } + val actual = o.argumentList?.expressionList ?: emptyList() + // TODO(Waleed): Thre is a case where arguments list length does not match the expected length + // causing an RsErrorType to be produced in actual types array preventing error reporting. + checkExpressionList(o.argumentList ?: o, actual, expectedTypes) val returnTypes = reference .returnList ?.typeNameList @@ -225,16 +227,20 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV if (reference == null) { o.type = RsErrorType } else { - reference as RsOpCommand + reference as RsScript with(reference.findCommandHandler()) { inferTypes(reference, o) } } } - private fun checkExpressionList(context: PsiElement, expressionList: List, parameterTypes: Array) { + private fun checkExpressionList( + context: PsiElement, + expressionList: List, + parameterTypes: Array + ) { var index = 0 - val actualTypes = expressionList.map{ + val actualTypes = expressionList.map { if (index < parameterTypes.size) { it.typeHint = parameterTypes[index] } @@ -437,11 +443,12 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV } when (val reference = RsDynamicExpressionReference.resolveElement(o, type).singleOrNull()?.element) { null -> o.type = RsErrorType - is RsOpCommand -> { + is RsScript -> { val returnTypes = reference .returnList - .typeNameList - .map { RsPrimitiveType.lookupReferencable(it.text) } + ?.typeNameList + ?.map { RsPrimitiveType.lookupReferencable(it.text) } + ?: emptyList() o.type = RsTupleType(returnTypes.flatten()) } @@ -495,7 +502,7 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV override fun visitStringLiteralExpression(o: RsStringLiteralExpression) { o.stringLiteralContent.typeHint = o.typeHint o.stringLiteralContent.accept(this) - o.type = o.typeHint + o.type = o.typeHint ?: RsPrimitiveType.STRING } override fun visitStringLiteralContent(o: RsStringLiteralContent) { @@ -598,7 +605,11 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV return RsArrayType(elementType) } else if (o.typeName != null) { val typeLiteral = o.typeName!!.text - return RsPrimitiveType.lookupReferencable(typeLiteral) + if (o.parentOfType()?.triggerName == "command") { + return RsPrimitiveType.lookup(typeLiteral) + } else { + return RsPrimitiveType.lookupReferencable(typeLiteral) + } } return RsErrorType } @@ -613,8 +624,8 @@ class RsTypeInferenceVisitor(private val myInferenceData: RsTypeInference) : RsV } } -private fun RsOpCommand.findCommandHandler(): CommandHandler { - return when (commandHeader.nameLiteralList[1].text) { +private fun RsScript.findCommandHandler(): CommandHandler { + return when (nameLiteralList[1].text) { "enum" -> EnumCommandHandler "struct_param" -> ParamCommandHandler.STRUCT_PARAM "lc_param" -> ParamCommandHandler.LC_PARAM diff --git a/src/main/kotlin/io/runescript/plugin/lang/psi/type/trigger/RsTriggerType.kt b/src/main/kotlin/io/runescript/plugin/lang/psi/type/trigger/RsTriggerType.kt index 5915186..116c37c 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/psi/type/trigger/RsTriggerType.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/psi/type/trigger/RsTriggerType.kt @@ -10,6 +10,7 @@ enum class RsTriggerType( val parameterTypes: Array? = null, val allowReturns: Boolean = false ) { + COMMAND("command", allowParameters = true, allowReturns = true), OPWORLDMAPELEMENT1("opworldmapelement1", subjectType = MAPELEMENT), OPWORLDMAPELEMENT2("opworldmapelement2", subjectType = MAPELEMENT), OPWORLDMAPELEMENT3("opworldmapelement3", subjectType = MAPELEMENT), diff --git a/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsCommandScriptIndex.kt b/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsCommandScriptIndex.kt new file mode 100644 index 0000000..99252aa --- /dev/null +++ b/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsCommandScriptIndex.kt @@ -0,0 +1,18 @@ +package io.runescript.plugin.lang.stubs.index + +import com.intellij.psi.stubs.StringStubIndexExtension +import com.intellij.psi.stubs.StubIndexKey +import io.runescript.plugin.lang.psi.RsScript +import io.runescript.plugin.lang.stubs.types.RsFileStubType + + +class RsCommandScriptIndex : StringStubIndexExtension() { + + override fun getVersion(): Int = RsFileStubType.stubVersion + + override fun getKey(): StubIndexKey = KEY + + companion object { + val KEY = StubIndexKey.createIndexKey("io.runescript.plugin.lang.stubs.index.RsCommandScriptIndex") + } +} diff --git a/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsGotoScriptIndex.kt b/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsProcScriptIndex.kt similarity index 79% rename from src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsGotoScriptIndex.kt rename to src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsProcScriptIndex.kt index 306211e..57220d1 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsGotoScriptIndex.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/stubs/index/RsProcScriptIndex.kt @@ -6,13 +6,13 @@ import io.runescript.plugin.lang.psi.RsScript import io.runescript.plugin.lang.stubs.types.RsFileStubType -class RsGotoScriptIndex : StringStubIndexExtension() { +class RsProcScriptIndex : StringStubIndexExtension() { override fun getVersion(): Int = RsFileStubType.stubVersion override fun getKey(): StubIndexKey = KEY companion object { - val KEY = StubIndexKey.createIndexKey("io.runescript.plugin.lang.stubs.index.RsGotoScriptIndex") + val KEY = StubIndexKey.createIndexKey("io.runescript.plugin.lang.stubs.index.RsProcScriptIndex") } } diff --git a/src/main/kotlin/io/runescript/plugin/lang/stubs/types/RsScriptStubType.kt b/src/main/kotlin/io/runescript/plugin/lang/stubs/types/RsScriptStubType.kt index b8ace91..1776061 100644 --- a/src/main/kotlin/io/runescript/plugin/lang/stubs/types/RsScriptStubType.kt +++ b/src/main/kotlin/io/runescript/plugin/lang/stubs/types/RsScriptStubType.kt @@ -12,7 +12,8 @@ import io.runescript.plugin.lang.psi.scriptName import io.runescript.plugin.lang.psi.triggerName import io.runescript.plugin.lang.stubs.RsScriptStub import io.runescript.plugin.lang.stubs.index.RsClientScriptIndex -import io.runescript.plugin.lang.stubs.index.RsGotoScriptIndex +import io.runescript.plugin.lang.stubs.index.RsCommandScriptIndex +import io.runescript.plugin.lang.stubs.index.RsProcScriptIndex object RsScriptStubType : RsStubType("SCRIPT") { @@ -35,8 +36,9 @@ object RsScriptStubType : RsStubType("SCRIPT") { override fun indexStub(stub: RsScriptStub, sink: IndexSink) { when (stub.triggerName) { - "proc" -> sink.occurrence(RsGotoScriptIndex.KEY, stub.scriptName) + "proc" -> sink.occurrence(RsProcScriptIndex.KEY, stub.scriptName) "clientscript" -> sink.occurrence(RsClientScriptIndex.KEY, stub.scriptName) + "command" -> sink.occurrence(RsCommandScriptIndex.KEY, stub.scriptName) } } } \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/filetypes/RsOpFileType.kt b/src/main/kotlin/io/runescript/plugin/oplang/filetypes/RsOpFileType.kt deleted file mode 100644 index 82db0d3..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/filetypes/RsOpFileType.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.runescript.plugin.oplang.filetypes - -import com.intellij.openapi.fileTypes.LanguageFileType -import io.runescript.plugin.ide.RsIcons -import io.runescript.plugin.lang.RuneScript - -object RsOpFileType : LanguageFileType(RuneScript) { - - override fun getDisplayName() = "RuneScript Op" - - override fun getName() = "RuneScript Op" - - override fun getDescription() = "Command source file" - - override fun getDefaultExtension() = "op" - - override fun getIcon() = RsIcons.ClientScript -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/lexer/RsOpLexer.kt b/src/main/kotlin/io/runescript/plugin/oplang/lexer/RsOpLexer.kt deleted file mode 100644 index 71eebe1..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/lexer/RsOpLexer.kt +++ /dev/null @@ -1,6 +0,0 @@ -package io.runescript.plugin.oplang.lexer - -import com.intellij.lexer.FlexAdapter -import io.runescript.plugin.lang.lexer.RsLexerInfo - -class RsOpLexer(lexerInfo: RsLexerInfo) : FlexAdapter(_RsOpLexer(null, lexerInfo)) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpElementType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpElementType.kt deleted file mode 100644 index d005657..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpElementType.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.runescript.plugin.oplang.psi - -import com.intellij.psi.tree.IElementType -import io.runescript.plugin.lang.RuneScript -import org.jetbrains.annotations.NonNls - -class RsOpElementType(debugName: @NonNls String) : IElementType(debugName, RuneScript) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpFile.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpFile.kt deleted file mode 100644 index 5085c9d..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpFile.kt +++ /dev/null @@ -1,23 +0,0 @@ -package io.runescript.plugin.oplang.psi - -import com.intellij.extapi.psi.PsiFileBase -import com.intellij.openapi.fileTypes.FileType -import com.intellij.psi.FileViewProvider -import io.runescript.plugin.lang.RuneScript -import io.runescript.plugin.oplang.filetypes.RsOpFileType -import io.runescript.plugin.oplang.psi.stub.type.RsOpFileStubType - -class RsOpFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, RuneScript) { - - init { - init(RsOpFileStubType, RsOpFileStubType) - } - - override fun getFileType(): FileType { - return RsOpFileType - } - - override fun toString(): String { - return "RuneScript Op File" - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpStubType.kt deleted file mode 100644 index 14d7123..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/RsOpStubType.kt +++ /dev/null @@ -1,15 +0,0 @@ -package io.runescript.plugin.oplang.psi - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.lang.RuneScript -import org.jetbrains.annotations.NonNls - -abstract class RsOpStubType, PsiT : PsiElement>(debugName: @NonNls String) - : IStubElementType(debugName, RuneScript) { - - override fun getExternalId(): String { - return "RuneScriptOp.${super.toString()}" - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/index/RsCommandIndex.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/index/RsCommandIndex.kt deleted file mode 100644 index 45a2b15..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/index/RsCommandIndex.kt +++ /dev/null @@ -1,16 +0,0 @@ -package io.runescript.plugin.oplang.psi.index - -import com.intellij.psi.stubs.StringStubIndexExtension -import com.intellij.psi.stubs.StubIndexKey -import io.runescript.plugin.oplang.psi.RsOpCommand -import io.runescript.plugin.oplang.psi.stub.type.RsOpFileStubType - -class RsCommandIndex : StringStubIndexExtension() { - - override fun getVersion(): Int = RsOpFileStubType.stubVersion - override fun getKey(): StubIndexKey = KEY - - companion object { - val KEY = StubIndexKey.createIndexKey("io.runescript.plugin.lang.stubs.index.RsCommandIndex") - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpAttributeListStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpAttributeListStub.kt deleted file mode 100644 index 0779bb0..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpAttributeListStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpAttributeList - -class RsOpAttributeListStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandHeaderStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandHeaderStub.kt deleted file mode 100644 index bccef42..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandHeaderStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpCommandHeader - -class RsOpCommandHeaderStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandStub.kt deleted file mode 100644 index 14c6f5c..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpCommandStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpCommand - -class RsOpCommandStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpNameLiteralStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpNameLiteralStub.kt deleted file mode 100644 index 9a6f108..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpNameLiteralStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpNameLiteral - -class RsOpNameLiteralStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>, val name: String) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterListStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterListStub.kt deleted file mode 100644 index 7f510d0..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterListStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpParameterList - -class RsOpParameterListStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterStub.kt deleted file mode 100644 index d12b66c..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpParameterStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpParameter - -class RsOpParameterStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>, val name: String) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpReturnListStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpReturnListStub.kt deleted file mode 100644 index 0132292..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpReturnListStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpReturnList - -class RsOpReturnListStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpStubElementTypeFactory.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpStubElementTypeFactory.kt deleted file mode 100644 index a61e38a..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpStubElementTypeFactory.kt +++ /dev/null @@ -1,22 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import io.runescript.plugin.oplang.psi.stub.type.* - -object RsOpStubElementTypeFactory { - - @JvmStatic - fun create(name: String): IStubElementType<*, *> { - return when (name) { - "COMMAND" -> RsOpCommandStubType - "COMMAND_HEADER" -> RsOpCommandHeaderStubType - "RETURN_LIST" -> RsOpReturnListStubType - "PARAMETER_LIST" -> RsOpParameterListStubType - "PARAMETER" -> RsOpParameterStubType - "ATTRIBUTE_LIST" -> RsOpAttributeListStubType - "NAME_LITERAL" -> RsOpNameLiteralStubType - "TYPE_NAME" -> RsOpTypeNameStubType - else -> error("Unrecognized stub type: $name") - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpTypeNameStub.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpTypeNameStub.kt deleted file mode 100644 index 061ea0f..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/RsOpTypeNameStub.kt +++ /dev/null @@ -1,9 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub - -import com.intellij.psi.stubs.IStubElementType -import com.intellij.psi.stubs.StubBase -import com.intellij.psi.stubs.StubElement -import io.runescript.plugin.oplang.psi.RsOpTypeName - -class RsOpTypeNameStub(parent: StubElement<*>?, elementType: IStubElementType<*, *>, val name: String) - : StubBase(parent, elementType) \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpAttributeListStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpAttributeListStubType.kt deleted file mode 100644 index f153f41..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpAttributeListStubType.kt +++ /dev/null @@ -1,32 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpAttributeList -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpAttributeListImpl -import io.runescript.plugin.oplang.psi.stub.RsOpAttributeListStub - -object RsOpAttributeListStubType : RsOpStubType("ATTRIBUTE_LIST") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpAttributeListStub { - return RsOpAttributeListStub(parentStub, this) - } - - override fun serialize(stub: RsOpAttributeListStub, dataStream: StubOutputStream) { - } - - override fun createStub(psi: RsOpAttributeList, parentStub: StubElement?): RsOpAttributeListStub { - return RsOpAttributeListStub(parentStub, this) - } - - override fun createPsi(stub: RsOpAttributeListStub): RsOpAttributeList { - return RsOpAttributeListImpl(stub, this) - } - - override fun indexStub(stub: RsOpAttributeListStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandHeaderStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandHeaderStubType.kt deleted file mode 100644 index 8ddff5f..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandHeaderStubType.kt +++ /dev/null @@ -1,32 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpCommandHeader -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpCommandHeaderImpl -import io.runescript.plugin.oplang.psi.stub.RsOpCommandHeaderStub - -object RsOpCommandHeaderStubType : RsOpStubType("COMMAND_HEADER") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpCommandHeaderStub { - return RsOpCommandHeaderStub(parentStub, this) - } - - override fun serialize(stub: RsOpCommandHeaderStub, dataStream: StubOutputStream) { - } - - override fun createStub(psi: RsOpCommandHeader, parentStub: StubElement?): RsOpCommandHeaderStub { - return RsOpCommandHeaderStub(parentStub, this) - } - - override fun createPsi(stub: RsOpCommandHeaderStub): RsOpCommandHeader { - return RsOpCommandHeaderImpl(stub, this) - } - - override fun indexStub(stub: RsOpCommandHeaderStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandStubType.kt deleted file mode 100644 index fb82eae..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpCommandStubType.kt +++ /dev/null @@ -1,37 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpCommand -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpCommandImpl -import io.runescript.plugin.oplang.psi.index.RsCommandIndex -import io.runescript.plugin.oplang.psi.stub.RsOpCommandStub -import io.runescript.plugin.oplang.psi.stub.RsOpNameLiteralStub - -object RsOpCommandStubType : RsOpStubType("COMMAND") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpCommandStub { - return RsOpCommandStub(parentStub, this) - } - - override fun serialize(stub: RsOpCommandStub, dataStream: StubOutputStream) { - } - - override fun createStub(psi: RsOpCommand, parentStub: StubElement?): RsOpCommandStub { - return RsOpCommandStub(parentStub, this) - } - - override fun createPsi(stub: RsOpCommandStub): RsOpCommand { - return RsOpCommandImpl(stub, this) - } - - override fun indexStub(stub: RsOpCommandStub, sink: IndexSink) { - val header = stub.findChildStubByType(RsOpCommandHeaderStubType)!! - val mum = header.childrenStubs[1] as RsOpNameLiteralStub - sink.occurrence(RsCommandIndex.KEY, mum.name) - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpFileStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpFileStubType.kt deleted file mode 100644 index 5f176c4..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpFileStubType.kt +++ /dev/null @@ -1,39 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.lang.ASTNode -import com.intellij.lang.PsiBuilderFactory -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import com.intellij.psi.tree.IStubFileElementType -import io.runescript.plugin.ide.config.RsConfig -import io.runescript.plugin.lang.RuneScript -import io.runescript.plugin.lang.lexer.RsLexerInfo -import io.runescript.plugin.lang.stubs.RsFileStub -import io.runescript.plugin.oplang.lexer.RsOpLexer -import io.runescript.plugin.oplang.parser.RsOpParser - -object RsOpFileStubType : IStubFileElementType(RuneScript) { - - override fun doParseContents(chameleon: ASTNode, psi: PsiElement): ASTNode? { - val project = psi.project - val languageForParser = getLanguageForParser(psi) - val lexer = RsOpLexer(RsLexerInfo(RsConfig.getPrimitiveTypes(project))) - val builder = PsiBuilderFactory.getInstance().createBuilder(project, chameleon, lexer, languageForParser, chameleon.chars) - val node = RsOpParser().parse(this, builder) - return node.firstChildNode - } - - override fun getStubVersion() = 0 - - override fun serialize(stub: RsFileStub, dataStream: StubOutputStream) { - - } - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsFileStub { - return RsFileStub(null) - } - - override fun getExternalId() = "RuneScriptOp.file" -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpNameLiteralStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpNameLiteralStubType.kt deleted file mode 100644 index 1ca6ce5..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpNameLiteralStubType.kt +++ /dev/null @@ -1,33 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpNameLiteral -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpNameLiteralImpl -import io.runescript.plugin.oplang.psi.stub.RsOpNameLiteralStub - -object RsOpNameLiteralStubType : RsOpStubType("NAME_LITERAL") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpNameLiteralStub { - return RsOpNameLiteralStub(parentStub, this, dataStream.readUTF()) - } - - override fun serialize(stub: RsOpNameLiteralStub, dataStream: StubOutputStream) { - dataStream.writeUTF(stub.name) - } - - override fun createStub(psi: RsOpNameLiteral, parentStub: StubElement?): RsOpNameLiteralStub { - return RsOpNameLiteralStub(parentStub, this, psi.text) - } - - override fun createPsi(stub: RsOpNameLiteralStub): RsOpNameLiteral { - return RsOpNameLiteralImpl(stub, this) - } - - override fun indexStub(stub: RsOpNameLiteralStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterListStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterListStubType.kt deleted file mode 100644 index 8bfbae4..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterListStubType.kt +++ /dev/null @@ -1,32 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpParameterList -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpParameterListImpl -import io.runescript.plugin.oplang.psi.stub.RsOpParameterListStub - -object RsOpParameterListStubType : RsOpStubType("PARAMETER_LIST") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpParameterListStub { - return RsOpParameterListStub(parentStub, this) - } - - override fun serialize(stub: RsOpParameterListStub, dataStream: StubOutputStream) { - } - - override fun createStub(psi: RsOpParameterList, parentStub: StubElement?): RsOpParameterListStub { - return RsOpParameterListStub(parentStub, this) - } - - override fun createPsi(stub: RsOpParameterListStub): RsOpParameterList { - return RsOpParameterListImpl(stub, this) - } - - override fun indexStub(stub: RsOpParameterListStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterStubType.kt deleted file mode 100644 index 1f59f1c..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpParameterStubType.kt +++ /dev/null @@ -1,33 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpParameter -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpParameterImpl -import io.runescript.plugin.oplang.psi.stub.RsOpParameterStub - -object RsOpParameterStubType : RsOpStubType("PARAMETER") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpParameterStub { - return RsOpParameterStub(parentStub, this, dataStream.readUTF()) - } - - override fun serialize(stub: RsOpParameterStub, dataStream: StubOutputStream) { - dataStream.writeUTF(stub.name) - } - - override fun createStub(psi: RsOpParameter, parentStub: StubElement?): RsOpParameterStub { - return RsOpParameterStub(parentStub, this, psi.nameLiteral.text) - } - - override fun createPsi(stub: RsOpParameterStub): RsOpParameter { - return RsOpParameterImpl(stub, this) - } - - override fun indexStub(stub: RsOpParameterStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpReturnListStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpReturnListStubType.kt deleted file mode 100644 index cb37f8b..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpReturnListStubType.kt +++ /dev/null @@ -1,32 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpReturnList -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.impl.RsOpReturnListImpl -import io.runescript.plugin.oplang.psi.stub.RsOpReturnListStub - -object RsOpReturnListStubType : RsOpStubType("RETURN_LIST") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpReturnListStub { - return RsOpReturnListStub(parentStub, this) - } - - override fun serialize(stub: RsOpReturnListStub, dataStream: StubOutputStream) { - } - - override fun createStub(psi: RsOpReturnList, parentStub: StubElement?): RsOpReturnListStub { - return RsOpReturnListStub(parentStub, this) - } - - override fun createPsi(stub: RsOpReturnListStub): RsOpReturnList { - return RsOpReturnListImpl(stub, this) - } - - override fun indexStub(stub: RsOpReturnListStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpTypeNameStubType.kt b/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpTypeNameStubType.kt deleted file mode 100644 index b33e5d9..0000000 --- a/src/main/kotlin/io/runescript/plugin/oplang/psi/stub/type/RsOpTypeNameStubType.kt +++ /dev/null @@ -1,33 +0,0 @@ -package io.runescript.plugin.oplang.psi.stub.type - -import com.intellij.psi.PsiElement -import com.intellij.psi.stubs.IndexSink -import com.intellij.psi.stubs.StubElement -import com.intellij.psi.stubs.StubInputStream -import com.intellij.psi.stubs.StubOutputStream -import io.runescript.plugin.oplang.psi.RsOpStubType -import io.runescript.plugin.oplang.psi.RsOpTypeName -import io.runescript.plugin.oplang.psi.impl.RsOpTypeNameImpl -import io.runescript.plugin.oplang.psi.stub.RsOpTypeNameStub - -object RsOpTypeNameStubType : RsOpStubType("TYPE_NAME") { - - override fun deserialize(dataStream: StubInputStream, parentStub: StubElement<*>?): RsOpTypeNameStub { - return RsOpTypeNameStub(parentStub, this, dataStream.readUTF()) - } - - override fun serialize(stub: RsOpTypeNameStub, dataStream: StubOutputStream) { - dataStream.writeUTF(stub.name) - } - - override fun createStub(psi: RsOpTypeName, parentStub: StubElement?): RsOpTypeNameStub { - return RsOpTypeNameStub(parentStub, this, psi.text) - } - - override fun createPsi(stub: RsOpTypeNameStub): RsOpTypeName { - return RsOpTypeNameImpl(stub, this) - } - - override fun indexStub(stub: RsOpTypeNameStub, sink: IndexSink) { - } -} \ No newline at end of file diff --git a/src/main/resources/META-INF/op-lang.xml b/src/main/resources/META-INF/op-lang.xml deleted file mode 100644 index 8c78206..0000000 --- a/src/main/resources/META-INF/op-lang.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 675aca9..f3bbb1b 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -6,7 +6,6 @@ com.intellij.java - - + + diff --git a/src/main/resources/messages/RsBundle.properties b/src/main/resources/messages/RsBundle.properties index 14c21b1..28f0851 100644 --- a/src/main/resources/messages/RsBundle.properties +++ b/src/main/resources/messages/RsBundle.properties @@ -57,6 +57,7 @@ inspection.error.trigger.return.list.not.allowed=Trigger type `{0}` does not all inspection.error.trigger.parameter.list.not.allowed=Trigger type `{0}` does not allow for parameter list inspection.error.trigger.subject.not.found=Unresolved subject `{0}` of type `{1}` inspection.error.script.symbol.not.found=Script symbol not found for `{0}` +inspection.error.trigger.code.not.allowed=Trigger type `command` does not allow for code statements # Intentions intention.category.expressions=RuneScript/Expressions