From b274ce57fe5357390fd792981294124704896323 Mon Sep 17 00:00:00 2001 From: Ryan Appel Date: Wed, 11 Mar 2020 09:08:08 -0500 Subject: [PATCH] adding Functions to FunctionDefinitions.json. Updated REXXContenAssistProcessor to not cause UI issues on accept. Trying to make color preferences dynamic. Reset most preferences into the Default TextEditor Preferences. --- ToDo.txt | 3 +- .../RexxContentAssistProcessor$1.class | Bin 3916 -> 3997 bytes .../RexxContentAssistProcessor.class | Bin 7830 -> 7969 bytes .../RexxFunctionProposalData.class | Bin 7946 -> 8273 bytes .../rexxeditor/editors/ColorManager.class | Bin 3382 -> 3086 bytes .../rexxeditor/editors/RexxEditor.class | Bin 3794 -> 3183 bytes .../configuration/FunctionDefinitions.json | 708 +++++++++++++++++- resources/configuration/tbl.html | 129 ++++ .../RexxContentAssistProcessor.java | 43 +- .../RexxFunctionProposalData.java | 3 + .../rexxeditor/editors/ColorManager.java | 10 +- .../rexxeditor/editors/RexxEditor.java | 107 ++- .../preferences/RexxPreferencePage.java | 2 +- 13 files changed, 916 insertions(+), 89 deletions(-) create mode 100644 resources/configuration/tbl.html diff --git a/ToDo.txt b/ToDo.txt index cb22fec..dd88ac7 100644 --- a/ToDo.txt +++ b/ToDo.txt @@ -29,4 +29,5 @@ 12.) implement formatter with preferences. 13.) figure out how to implement a resource finder and locator for other rexxes that are called. 14.) add support for USS. - 15.) Fix bad implementations. \ No newline at end of file + 15.) Fix bad implementations. + 16.) Fix tokenization to go off of current value of color property. (dynamc updating) \ No newline at end of file diff --git a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor$1.class index e17a7f39bc63e3d44c929eba4dc9a487073a4289..4305190bf14bf6450178b2b20e8b8d149fa95d47 100644 GIT binary patch delta 111 zcmV-#0FeL89-SYss|o?mldK9X22y2bX>V?mz6u$WKnW6)AOj2`OmA{$FJ)tFX>fC8 zFLQTvFK2RLaA;{`b1zA4VP|DKDU-ngF|!s6WdZ?9lY9+}4Nm|C08juA08s!j08^6` R4qE|OlW-130a25;4wWdfB60u# delta 72 zcmV-O0Js00AIu)Gs|o>qldK9X4OC@#bXI9)cV%)rNhy=T0Wq^@3uOWUK$Fc4iw#5o e1pq|=4**60F#t%DWe!^bO_RY6Mgc~X2oIHC%@tt) diff --git a/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class b/bin/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.class index 41f8059e05d3fecc522424b13687ef6f5ecc17a5..aa2e472ae3f1a7e77bc4921dad4415ad3df57534 100644 GIT binary patch delta 2786 zcma)730PFu75>k>nRkabZ-!xDfQO2ps4N14h&n`M6Gd56Trx3j9AUsw9B}3#n%0b_ zHeJ#s@z!+9W;ff!SdHx$MA4PM-y^kOC*P2Ngx2T%OYloGw(NN?@Kmrp#PcjroMM{;=8A*B1|)1f{s7 z&5~H4qxRZcdpO!}Zq+asi*%%6F~L#X)>g8?g*q$|xJACG%u?#HRA$=?(;Cq%&_pPc z=WIE0qdmK+1sWlJC>DvD-Dap~`?^@DC#<0rD+HDkyxT&%LX`udXn$q5$wK`)+OU$~ zG6&ZW4TWRPp}1_w$}JISCuF9Cht0@9Wn(NB+S4A1n;KTZt)UBR1XdGTq}SWx(6JWX z@)i4>DeJLOU<1K@U9}@Lq~lfuWvyfSludY@!0rF>-W@h|ydHPRAxD`S(y;|S^01>m zEsTDFK0=PHQghhFRz##-T|Om@?K%c<2SJSw#>{Z94}_?WK@7=0wbB_zOh+81d`NAX zwu__K)P8f&bppEyHL_8!DRtsb_OUL!V`v~`hBt&_kNAO0g40{QF zdCr|BHV7mLi&?cqR=9lbyR2-C;BFmn!U5Ug>dJNE9)h+uynFYu-iSFE)9_ZjUEpof z<({qFi+9KxcSGU32);ZL9)-9kCd4lH4`gHH~Iv0-NxWFd~p6fNYIz`6`JSoqK8G6)`i3ubLb+W-$ zce2#Ei{yRY2AP|2Kt7yyzvjYvd|yX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|hdqK=<<6c?<7DoK+SLEzr*^{2ff$?3=9nB42>JPOgSbm<8WeR+x(KFotc$^fr+630Ou?UumAu6 delta 293 zcmXAjO-lk{6osF69GSsd7!he%VQ$KdSxgZGLXcot4T2!p$3pVW3YlP#TJ>c`yEgt3 zG0Y00Rg3;p(Ums$a-Vz7x%Vm7n}~e>zI^~IJai(w122e&9gwS z3$5##!kKH2*qPXT*`lS0o>tGRPD6H1sTrL3^>)_IDXZJEA4AtSD264ui%D4e(n61m zo%AzfnOD{fK5@OpFJ^?qh2#uY&3D{NpF-U1Q+%Q9b;K89QtB+W)Vw5ZFv=$56iBf} znr$5EE*^=&mH%5z<(Zao04}+bSHdEzu!|w~Bzx>jaEd4g!c4NF976rzTHIQarnnPi GaQ_Dm%Q)Tu diff --git a/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class b/bin/org/imperfectmommy/rexxeditor/editors/RexxEditor.class index 06243af88ccc78bb285eb26c93748cec49a2ee6e..a2e1414037f60f188229a67e50bbbf6315f790a5 100644 GIT binary patch delta 969 zcmY*XT~8B16g}H+XSeML75PvJ_>m}Ou?nSHs+1}sD#|yCprQpUA{8Oh_}D~Dd^MRT zAAHm&A0W|^Xky|EBtGg7(LbQ^%yt7co9x`VGxwZ(&Yd4kzxIc||NZR`Ux>xsmLAPO`8|mCTmC?FROYuV&{K z2eZo)+1Y$f{j@ViM(qp6#080S=vMtfN4*LZjH~KTpj%wSpoQxyBkJT3h7E|^N+Fwn zroNdC;pq^`M+>)5WwCb{w;*LZgE~$bwrhc2F zwjU29vY1svft1>|*6aipCFb!+joB|%YdF~;h#!Pz2~&KYDt%m|>Up@OxWUMWDF5}$ z1GO+w2b;SFel0kFR`<-UfP*&fY#hc3#E55T?>yWY;ut(_bUvb~gi~BPwh-2fQ9`G) ziIgVuSCBQKXrUQZI7Gf9IEbSzn=IpaY-imfqn=6nN|H1aCU-rq98Ig6t8>~malV4I zjikGTH7o&+Q)3j8EVWcZWknLZ)gBpf(2I*i_h@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jB3*k#y6_gP zCTu6eDzJH=T3h!D)whf4(hlC9OZj%OxfIiO@NOL+r2H(pVLpOS@F{TwK68UV{}(LLI8Oio diff --git a/resources/configuration/FunctionDefinitions.json b/resources/configuration/FunctionDefinitions.json index ba6c5eb..868d3ef 100644 --- a/resources/configuration/FunctionDefinitions.json +++ b/resources/configuration/FunctionDefinitions.json @@ -198,7 +198,7 @@ "pattern": "BITAND(String1,String2)", "returnValue": { "type": "String", - "description": "Returns the String that is a result of binary ANDing String1 and String2 together. The AND starts at the far left and continues until the shorter of the two strings is exausted the length of the returned string is that of the longest passed in String." + "description": "Returns the String that is a result of binary ANDing String1 and String2 together. The AND starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." }, "variables": [ { @@ -228,7 +228,7 @@ "pattern": "BITAND(String1,String2,Pad)", "returnValue": { "type": "String", - "description": "Returns the String that is a result of binary ANDing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The AND starts at the far left and continues until the shorter of the two strings is exausted the length of the returned string is that of the longest passed in String." + "description": "Returns the String that is a result of binary ANDing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The AND starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." }, "variables": [ { @@ -261,6 +261,707 @@ ], "additionalInfo": "" }, + { + "pattern": "BITOR(String1)", + "returnValue": { + "type": "String", + "description": "Returns the String passed into the function unmodified." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 6 + ], + "variableDescription": "The String to return from the function." + } + ], + "examples": [ + "BITOR('73'x) == '73'x" + ], + "additionalInfo": "" + }, + { + "pattern": "BITOR(String1,String2)", + "returnValue": { + "type": "String", + "description": "Returns the String that is a result of binary ORing String1 and String2 together. The OR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 6 + ], + "variableDescription": "The String to OR with String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 14 + ], + "variableDescription": "The String to OR with String1." + } + ], + "examples": [ + "BITOR('15'x,'24'x) == '35'x", + "BITOR('15'x,'2456'x) == '3556'x" + ], + "additionalInfo": "" + }, + { + "pattern": "BITOR(String1,String2,Pad)", + "returnValue": { + "type": "String", + "description": "Returns the String that is a result of binary ORing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The OR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 6 + ], + "variableDescription": "The String to OR with String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 14 + ], + "variableDescription": "The String to OR with String1." + }, + { + "type": "String", + "defaultValue": "Pad", + "offsets": [ + 22 + ], + "variableDescription": "The Padding to be applied to the shorter string before the OR is perfromed." + } + ], + "examples": [ + "BITOR('15'x,'2456'x,'F0'x) == '35F6'x", + "BITOR('1111'x,,'4D'x) == '5D5D'x" + ], + "additionalInfo": "" + }, + { + "pattern": "BITXOR(String1)", + "returnValue": { + "type": "String", + "description": "Returns the String passed into the function unmodified." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 7 + ], + "variableDescription": "The String to return from the function." + } + ], + "examples": [ + "BITXOR('12'x) == '12'x" + ], + "additionalInfo": "" + }, + { + "pattern": "BITXOR(String1,String2)", + "returnValue": { + "type": "String", + "description": "Returns the String that is a result of binary XORing String1 and String2 together. The XOR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 7 + ], + "variableDescription": "The String to XOR with String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 15 + ], + "variableDescription": "The String to XOR with String1." + } + ], + "examples": [ + "BITXOR('12'x,'22'x) == '30'x", + "BITXOR('1211'x,'22'x) == '3011'x", + "BITXOR('1111'x,'444444'x) == '555544'x" + ], + "additionalInfo": "" + }, + { + "pattern": "BITXOR(String1,String2,Pad)", + "returnValue": { + "type": "String", + "description": "Returns the String that is a result of binary XORing String1 and String2 together with PAD applied to the shorter string until it equals the length of the longer String. The XOR starts at the far left and continues until the shorter of the two strings is exausted. The length of the returned string is that of the longest passed in String." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 7 + ], + "variableDescription": "The String to XOR with String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 15 + ], + "variableDescription": "The String to XOR with String1." + }, + { + "type": "String", + "defaultValue": "Pad", + "offsets": [ + 23 + ], + "variableDescription": "The Padding to be aplied to the shorter string before the XOR is perfromed." + } + ], + "examples": [ + "BITXOR('1111'x,'444444'x,'40'x) == '555504'x", + "BITXOR('1111'x,,'4D'x) == '5C5C'x" + ], + "additionalInfo": "" + }, + { + "pattern": "B2X(binary-string)", + "returnValue": { + "type": "String", + "description": "The hexadecimal value that the passed in binary String represents." + }, + "variables": [ + { + "type": "String", + "defaultValue": "binary-string", + "offsets": [ + 4 + ], + "variableDescription": "A String representation of a binary value (only ones and zeros and spaces)." + } + ], + "examples": [ + "B2X('11000011') == 'C3'", + "B2X('1 1111 0000') == '1F0'" + ], + "additionalInfo": "" + }, + { + "pattern": "CENTER(String,Length)", + "returnValue": { + "type": "String", + "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with spaces. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTRE." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 7 + ], + "variableDescription": "The String to center in Length." + }, + { + "type": "String", + "defaultValue": "Length", + "offsets": [ + 14 + ], + "variableDescription": "The Length to center String into." + } + ], + "examples": [ + "CENTER('ABC',7) == ' ABC '", + "CENTER('ABC',8) == ' ABC '", + "CENTER('The blue sky',8) == 'e blue s'", + "CENTER('The blue sky',7) == 'e blue '" + ], + "additionalInfo": "" + }, + { + "pattern": "CENTER(String,Length,Pad)", + "returnValue": { + "type": "String", + "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with Pad. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTRE." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 7 + ], + "variableDescription": "The String to center in Length." + }, + { + "type": "String", + "defaultValue": "Length", + "offsets": [ + 14 + ], + "variableDescription": "The Length to center String into." + }, + { + "type": "Character", + "defaultValue": "Pad", + "offsets": [ + 21 + ], + "variableDescription": "The Pad character to add around String." + + } + ], + "examples": [ + "CENTER('ABC',8,'-') == '--ABC---'" + ], + "additionalInfo": "" + }, + { + "pattern": "CENTRE(String,Length)", + "returnValue": { + "type": "String", + "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with spaces. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTER." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 7 + ], + "variableDescription": "The String to center in Length." + }, + { + "type": "String", + "defaultValue": "Length", + "offsets": [ + 14 + ], + "variableDescription": "The Length to center String into." + } + ], + "examples": [ + "CENTRE('ABC',7) == ' ABC '", + "CENTRE('ABC',8) == ' ABC '" + ], + "additionalInfo": "" + }, + { + "pattern": "CENTRE(String,Length,Pad)", + "returnValue": { + "type": "String", + "description": "A Centered String in the spcified Length amount of space. Padded equally on both sides with Pad. If Length is less than the length of String then String is truncated from both sides to the length Length. Additionally, if an odd number of characters are truncated or added, the Right hand end loses or gains one more character than the left hand end. May also be specified as CENTER." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 7 + ], + "variableDescription": "The String to center in Length." + }, + { + "type": "String", + "defaultValue": "Length", + "offsets": [ + 14 + ], + "variableDescription": "The Length to center String into." + }, + { + "type": "Character", + "defaultValue": "Pad", + "offsets": [ + 21 + ], + "variableDescription": "The Pad character to add around String." + + } + ], + "examples": [ + "CENTRE('ABC',8,'-') == '--ABC---'" + ], + "additionalInfo": "" + }, + { + "pattern": "CHARIN()", + "returnValue": { + "type": "", + "description": "" + }, + "variables": [ + { + "type": "", + "defaultValue": "", + "offsets": [ + 0 + ], + "variableDescription": "" + } + ], + "examples": [ + "" + ], + "additionalInfo": "" + }, + { + "pattern": "CHAROUT()", + "returnValue": { + "type": "", + "description": "" + }, + "variables": [ + { + "type": "", + "defaultValue": "", + "offsets": [ + 0 + ], + "variableDescription": "" + } + ], + "examples": [ + "" + ], + "additionalInfo": "" + }, + { + "pattern": "CHARS()", + "returnValue": { + "type": "", + "description": "" + }, + "variables": [ + { + "type": "", + "defaultValue": "", + "offsets": [ + 0 + ], + "variableDescription": "" + } + ], + "examples": [ + "" + ], + "additionalInfo": "" + }, + { + "pattern": "COMPARE(String1,String2)", + "returnValue": { + "type": "Integer", + "description": "The Character Position in which String1 and String2 differ (0 meaning that they are the same String). If one string is shorter than the other then it is padded with a spaces until their lengths are equal." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 8 + ], + "variableDescription": "The string to compare to String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 16 + ], + "variableDescription": "The string to compare to String1." + } + ], + "examples": [ + "COMPARE('abc','abc') == 0", + "COMPARE('abc','ak') == 2", + "COMPARE('ab ','ab') == 0" + ], + "additionalInfo": "" + }, + { + "pattern": "COMPARE(String1,String2,Pad)", + "returnValue": { + "type": "Integer", + "description": "The Character Position in which String1 and String2 differ (0 meaning that they are the same String). If one string is shorter than the other then it is padded with the Pad char until their lengths are equal." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String1", + "offsets": [ + 8 + ], + "variableDescription": "The string to compare to String2." + }, + { + "type": "String", + "defaultValue": "String2", + "offsets": [ + 16 + ], + "variableDescription": "The string to compare to String1." + }, + { + "type": "Character", + "defaultValue": "Pad", + "offsets": [ + 24 + ], + "variableDescription": "The Pad Char to add the shorter string until it matches the other strings length." + } + ], + "examples": [ + "COMPARE('ab-- ','ab','-') == 5" + ], + "additionalInfo": "" + }, + { + "pattern": "CONDITION()", + "returnValue": { + "type": "String", + "description": "The name of the trapped condition." + }, + "examples": [ + "CONDITION() == 'CALL' /* PERHAPS */" + ], + "additionalInfo": "" + }, + { + "pattern": "CONDITION(Option)", + "returnValue": { + "type": "String.", + "description": "The information associated with the current trapped condition. Condition name, Description, Instruction, or State." + + }, + "variables": [ + { + "type": "Character", + "defaultValue": "Option", + "offsets": [ + 10 + ], + "variableDescription": "
C-Condition name. Returns the name of the current trapped condition.
D-Description. Returns any descriptive string associated with the current trapped condition.
I-Instruction. returns the keyword for the instruction executed when the current condition was trapped.
S-State. Returns the state of the current trapped condition.
" + } + ], + "examples": [ + "CONDITION('C') == 'FAILURE' /* perhaps */", + "CONDITION('I') == 'CALL' /* perhaps */", + "CONDITION('D') == 'FailureTest' /* perhaps */", + "CONDITION('S') == 'OFF' /* perhaps */" + ], + "additionalInfo": "" + }, + { + "pattern": "COPIES(String,N)", + "returnValue": { + "type": "String", + "description": "N directly concatenated copies of String." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 7 + ], + "variableDescription": "The String to produce multiple copies of." + }, + { + "type": "Integer", + "defaultValue": "N", + "offsets": [ + 14 + ], + "variableDescription": "The number of copies of String to produce, must be positive or 0." + } + ], + "examples": [ + "COPIES('abc',3) == 'abcabcabc'", + "COPIES('abc',0) == ''" + ], + "additionalInfo": "" + }, + { + "pattern": "C2D(String)", + "returnValue": { + "type": "Integer", + "description": "The decimal value of the binary representation (encoding) of string. If the result cannot be expressed as a whole number, an error results - that is, the result must not have more digits than the current setting of NUMERIC DIGITS." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 4 + ], + "variableDescription": "The String to be converted. This may be the null strig, in which case '0' is returned. This is assumed to be an unsigned value." + } + ], + "examples": [ + "C2D('09'x) == 9", + "C2D('8l'x) == 129", + "C2D('a') == 129 /* EBCDIC Encoding */", + "C2D('FF8l'x) == 65409", + "C2D ('') == 0" + ], + "additionalInfo": "Character to Decimal." + }, + { + "pattern": "C2D(String,N)", + "returnValue": { + "type": "Integer", + "description": "The decimal value of the binary representation (encoding) of string. If the result cannot be expressed as a whole number, an error results - that is, the result must not have more digits than the current setting of NUMERIC DIGITS." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 4 + ], + "variableDescription": "The String to be converted. This may be the null strig, in which case '0' is returned. This is assumed to be an signed value of length N." + }, + { + "type": "Integer", + "defaultValue": "N", + "offsets": [ + 11 + ], + "variableDescription": "The number of characters (starting from the right and moving left) in which to consider the conversion of String. if N is longer than the length of String Then '00'x is prepended to the string before conversion." + } + ], + "examples": [ + "C2D('81'x,l) == -127", + "C2D('81'x,2) == 129", + "C2D('FF81'x,2) == -127", + "C2D('FF81'x,l) == -127", + "C2D('FF7F'x,l) == 127", + "C2D('F081'x,2) == -3967", + "C2D('F081'x,l) == -127", + "C2D('0031'x,0) == 0" + ], + "additionalInfo": "Character to Decimal." + }, + { + "pattern": "C2X(String)", + "returnValue": { + "type": "String", + "description": "The hexedecimal representation (unpacked value) of a character String. All values A-F will be upper case and contain no blanks." + + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 4 + ], + "variableDescription": "The string to be unpacked. This may be of any length, and if it is the null string then a null string is returned." + } + ], + "examples": [ + "C2X('72s') == 'F7F2A2' /* EBCDIC */", + "C2X('0123'x) == '0123'" + ], + "additionalInfo": "Character to Hexadecimal." + }, + { + "pattern": "DATATYPE(String)", + "returnValue": { + "type": "String", + "description": "The value 'NUM' or 'CHAR' depending on whether the String can be added to '0' without error." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 10 + ], + "variableDescription": "The String to test the Datatype of." + } + ], + "examples": [ + "DATATYPE(' 12 ') == 'NUM'", + "DATATYPE('') == 'CHAR'", + "DATATYPE('123*') == 'CHAR'" + ], + "additionalInfo": "Type of String." + }, + { + "pattern": "DATATYPE(String,Type)", + "returnValue": { + "type": "Boolean", + "description": "Whether or not String is of the type Type. If String is null and Type is not 'x' then 0 (False) is returned." + }, + "variables": [ + { + "type": "String", + "defaultValue": "String", + "offsets": [ + 10 + ], + "variableDescription": "The String to test the Datatype of." + }, + { + "type": "Char", + "defaultValue": "Type", + "offsets": [ + 16 + ], + "variableDescription": "
A - (Alphanumeric) Returns 1 if String only contains characters from the ranges 'a-z', 'A-Z', and '0-9'.
B - (Binary) Returns 1 if String only contains the characters '0' and/or '1'.
L - (lower case) Returns 1 if String only contains characters from the range 'a-z'.
M - (Mixed Case) Returns 1 if String only contains characters from the ranges 'a-z' and 'A-Z'.
N - (Number) Returns 1 if DATATYPE(String) would return 'NUM'.
S - (Symbol) Returns 1 if String only contains characters that are valid in REXX symbols. Note that lower case alphabetics are permitted.
U - (UPPER CASE) Returns 1 if String only contains characters from the range 'A-Z'.
W - (Whole Number) Returns 1 if String is a REXX whole number under the current setting of NUMERIC DIGITS.
X - (heXadecimal) Returns 1 if String only contains characters from the ranges 'a-f', 'A-F', '0-9', and blank (so long as blanks only appear between pairs of hexadecimal characters, as usual.) Also returns 2 if String is a null string, which is a valid hexadecimal string.
" + } + ], + "examples": [ + "DATATYPE('l2.3','N') == 1", + "DATATYPE('12.3','W') == 0", + "DATATYPE('Fred','M') == 1", + "DATATYPE('','M') == 0", + "DATATYPE('Minx','L') == 0", + "DATATYPE('3d?','s') == 1", + "DATATYPE('BCd3','X') == 1", + "DATATYPE('BC d3','X') == 1" + ], + "additionalInfo": "Type of String." + }, + { + "pattern": "FUNCTION_NAME()", + "returnValue": { + "type": "", + "description": "" + }, + "variables": [ + { + "type": "", + "defaultValue": "", + "offsets": [ + 0 + ], + "variableDescription": "" + } + ], + "examples": [ + "" + ], + "additionalInfo": "" + }, + //TODO: C2D, C2X, DATATYPE, DATE, DELSTR, DELWORD, DIGITS< D2C, D2X, ERRORTEXT, FORM, FORMAT, FORMAT (v2), FUZZ, INSERT, LASTPOS, LEFT< LENGTH, LINEIN, Lineout, LINES, MAX, MIN, OVERLAY { "pattern": "POS(Needle,Haystack)", "returnValue": { @@ -331,6 +1032,7 @@ ], "additionalInfo": "Position of starting at." }, + //TODO: QUEUED, RANDOM, REVERSE, RIGHT, SIGN< SOURCELINE, SPACE< STREAM< STRIP, SUBSTR, SUBWORD, SYMBOL, TIME, TRACE, TRANSLATE, TRUNC, VALUE, VERIFY, WORD< WORDINDEX< WORDLENGTH, WORDPOS, WORDS, XRANGE, X2B, X3C, X2D { "pattern": "FUNCTION_NAME()", "returnValue": { @@ -352,4 +1054,4 @@ ], "additionalInfo": "" } -] \ No newline at end of file +] diff --git a/resources/configuration/tbl.html b/resources/configuration/tbl.html new file mode 100644 index 0000000..605f606 --- /dev/null +++ b/resources/configuration/tbl.html @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ A + + - + + (Alphanumeric) + + Returns 1 if String only contains characters from the ranges 'a-z', 'A-Z', and '0-9'. +
+ B + + - + + (Binary) + + Returns 1 if String only contains the characters '0' and/or '1'. +
+ L + + - + + (lower case) + + Returns 1 if String only contains characters from the range 'a-z'. +
+ M + + - + + (Mixed Case) + + Returns 1 if String only contains characters from the ranges 'a-z' and 'A-Z'. +
+ N + + - + + (Number) + + Returns 1 if DATATYPE(String) would return 'NUM'. +
+ S + + - + + (Symbol) + + Returns 1 if String only contains characters that are valid in REXX symbols. Note that lower case alphabetics are permitted. + +
+ U + + - + + (UPPER CASE) + + Returns 1 if String only contains characters from the range 'A-Z'. +
+ W + + - + + (Whole Number) + + Returns 1 if String is a REXX whole number under the current setting of NUMERIC DIGITS. +
+ X + + - + + (heXadecimal) + + Returns 1 if String only contains characters from the ranges "a-f', "A-F", "0-9", and blank (so long as blanks only appear between pairs of hexadecimal characters, as usual.) Also returns 1 if String is a null string, which is a valid hexadecimal string. +
\ No newline at end of file diff --git a/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java b/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java index 3d85159..47efb7c 100644 --- a/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java +++ b/src/org/imperfectmommy/rexxeditor/contentassist/RexxContentAssistProcessor.java @@ -40,32 +40,43 @@ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int IDocument document = viewer.getDocument(); FindReplaceDocumentAdapter adapter = new FindReplaceDocumentAdapter(document); String foundString = ""; + IRegion region2 = null; try { - IRegion region2 = adapter.find(offset - 1,"\\s", false, false, false, true); - foundString = document.get(region2.getOffset() + 1, offset - region2.getOffset() - 1); + region2 = adapter.find(offset - 1,"\\s", false, false, false, true); + region2 = new Region(region2.getOffset() + 1, region2.getLength()); + foundString = document.get(region2.getOffset(), offset - region2.getOffset()); } catch (BadLocationException e1) { e1.printStackTrace(); } - final String finalFoundString = foundString; + final String finalFoundString = foundString.toUpperCase(); List proposals = new ArrayList<>(); - String[] functionNames= RexxFunctionProposalData.getFunctionMap().keySet().stream().filter(k -> k.contains(finalFoundString)).sorted().toArray(String[]::new); + String[] functionNames= RexxFunctionProposalData.getFunctionMap().keySet().stream().filter(k -> k.startsWith(finalFoundString)).sorted().toArray(String[]::new); + TemplateContextType type = new TemplateContextType("TemplateVariableContext"); + type.addResolver(new TemplateVariableResolver()); + Image image = null; + try { + Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor"); + URL fUrl = bundle.getEntry("icons/function.gif"); + image = new Image(null, fUrl.openConnection().getInputStream()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } for (String functionName: functionNames) { - proposals.add(buildCompletionProposalFromKey(functionName, viewer, offset)); + proposals.add(buildCompletionProposalFromKey(functionName, region2, type, image)); } return proposals.toArray(ICompletionProposal[]::new); } - private RexxCompletionProposal buildCompletionProposalFromKey(String string, ITextViewer viewer, int offset) { + private RexxCompletionProposal buildCompletionProposalFromKey(String string, IRegion region, TemplateContextType type, Image image) { RexxFunctionProposalData data = RexxFunctionProposalData.getFunctionMap().get(string); Template template = data.getTemplate(); - TemplateContextType type = new TemplateContextType(); - type.addResolver(new TemplateVariableResolver()); TemplateContext context = new TemplateContext(type) { @Override public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException { - TemplateVariable[] templateVariables = new TemplateVariable[0]; + TemplateVariable[] templateVariables = new TemplateVariable[0]; if (data.getVariables() != null) { templateVariables = Arrays.stream(data.getVariables()).map(var -> var.getVariable()).toArray(TemplateVariable[]::new); } @@ -77,16 +88,6 @@ public boolean canEvaluate(Template template) { return true; } }; - IRegion region = new Region(offset - 1 , 1); - Image image = null; - try { - Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor"); - URL fUrl = bundle.getEntry("icons/function.gif"); - image = new Image(null, fUrl.openConnection().getInputStream()); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } return new RexxCompletionProposal(template, context, region, image, 0); } @@ -98,12 +99,12 @@ public IContextInformation[] computeContextInformation(ITextViewer viewer, int o @Override public char[] getCompletionProposalAutoActivationCharacters() { - return "ADP".toCharArray(); + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); } @Override public char[] getContextInformationAutoActivationCharacters() { - return "ADP".toCharArray(); + return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); } @Override diff --git a/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java b/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java index 0f7a7f7..7bce974 100644 --- a/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java +++ b/src/org/imperfectmommy/rexxeditor/contentassist/RexxFunctionProposalData.java @@ -10,6 +10,8 @@ import org.eclipse.jface.text.templates.Template; import org.osgi.framework.Bundle; +import com.fasterxml.jackson.annotation.JsonFormat.Feature; +import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.ObjectMapper; public class RexxFunctionProposalData { @@ -79,6 +81,7 @@ public static Map getFunctionMap() { if (functionMap.isEmpty()) { try { ObjectMapper mapper = new ObjectMapper(); + mapper.enable(JsonParser.Feature.ALLOW_COMMENTS); Bundle bundle = org.eclipse.core.runtime.Platform.getBundle("RexxEditor"); URL fUrl = bundle.getEntry("resources/configuration/FunctionDefinitions.json"); RexxFunctionProposalData[] data = mapper.readValue(fUrl.openConnection().getInputStream(), RexxFunctionProposalData[].class); diff --git a/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java b/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java index 520d44e..a414dbb 100644 --- a/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java +++ b/src/org/imperfectmommy/rexxeditor/editors/ColorManager.java @@ -67,13 +67,5 @@ public boolean affectsTextPresentation(PropertyChangeEvent event) { return (token != null); } - public void handlePreferenceStoreChanged(PropertyChangeEvent event) { - String prefKey = event.getProperty(); - Color color = (Color) fColorTable.get(prefKey); - if (color != null) { - String colorName = preferenceStore.getString(prefKey); - color = new Color(Display.getCurrent(), StringConverter - .asRGB(colorName)); - } - } + } diff --git a/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java b/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java index 397ef50..0e9bd19 100644 --- a/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java +++ b/src/org/imperfectmommy/rexxeditor/editors/RexxEditor.java @@ -3,9 +3,6 @@ import java.util.ArrayList; import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.text.source.AnnotationRulerColumn; -import org.eclipse.jface.text.source.CompositeRuler; -import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.editors.text.TextEditor; @@ -13,67 +10,69 @@ import org.imperfectmommy.rexxeditor.Activator; import org.imperfectmommy.rexxeditor.contentoutliner.RexxContentElement; import org.imperfectmommy.rexxeditor.contentoutliner.RexxContentOutlinePage; +import org.imperfectmommy.rexxeditor.preferences.RexxPreferencePage; public class RexxEditor extends TextEditor { - private RexxContentOutlinePage fOutlinePage; - private ColorManager colorManager; + private RexxContentOutlinePage fOutlinePage; + private ColorManager colorManager; - public RexxEditor() { - super(); - Activator plugin = Activator.getActivator(); - colorManager = new ColorManager(plugin.getPreferenceStore()); - setSourceViewerConfiguration(new RexxConfiguration(colorManager, this)); - setPreferenceStore(plugin.getPreferenceStore()); - } + public RexxEditor() { + super(); + Activator plugin = Activator.getActivator(); + this.colorManager = new ColorManager(plugin.getPreferenceStore()); + this.setSourceViewerConfiguration(new RexxConfiguration(this.colorManager, this)); + // setPreferenceStore(plugin.getPreferenceStore()); + } - public void dispose() { - colorManager.dispose(); - if (fOutlinePage != null) - fOutlinePage.setInput(null); - super.dispose(); - } - - protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { - colorManager.handlePreferenceStoreChanged(event); - super.handlePreferenceStoreChanged(event); - } - - @SuppressWarnings("unchecked") @Override - public T getAdapter(Class adapter) { - if (IContentOutlinePage.class.equals(adapter)) { - if (fOutlinePage == null) { - fOutlinePage = new RexxContentOutlinePage(getDocumentProvider(), this); - if (getEditorInput() != null) - fOutlinePage.setInput(getEditorInput()); - } - return (T) fOutlinePage; - } - return super.getAdapter(adapter); - } + public void dispose() { + this.colorManager.dispose(); + if (this.fOutlinePage != null) { + this.fOutlinePage.setInput(null); + } + super.dispose(); + } + @Override + public void doSetInput(IEditorInput input) throws CoreException { + super.doSetInput(input); + if (this.fOutlinePage != null) { + this.fOutlinePage.setInput(input); + } + } - public void update(ArrayList updateList) { + @SuppressWarnings("unchecked") + @Override + public T getAdapter(Class adapter) { + if (IContentOutlinePage.class.equals(adapter)) { + if (this.fOutlinePage == null) { + this.fOutlinePage = new RexxContentOutlinePage(this.getDocumentProvider(), this); + if (this.getEditorInput() != null) { + this.fOutlinePage.setInput(this.getEditorInput()); + } + } + return (T) this.fOutlinePage; + } + return super.getAdapter(adapter); + } - if (fOutlinePage != null) { - fOutlinePage.update(updateList); - } - } + @Override + protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { + super.handlePreferenceStoreChanged(event); + } - public void doSetInput(IEditorInput input) throws CoreException { - super.doSetInput(input); + public void update(ArrayList updateList) { + if (this.fOutlinePage != null) { + this.fOutlinePage.update(updateList); + } + } - if (fOutlinePage != null) - fOutlinePage.setInput(input); - } - - protected IVerticalRuler createVerticalRuler() { - CompositeRuler ruler = new CompositeRuler(); - ruler.addDecorator(0, new AnnotationRulerColumn(VERTICAL_RULER_WIDTH)); - ruler.addDecorator(1, createLineNumberRulerColumn()); - return ruler; - } - + /* + * protected IVerticalRuler createVerticalRuler() { CompositeRuler ruler = new + * CompositeRuler(); ruler.addDecorator(0, new + * AnnotationRulerColumn(VERTICAL_RULER_WIDTH)); ruler.addDecorator(1, + * createLineNumberRulerColumn()); return ruler; } + */ } \ No newline at end of file diff --git a/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java b/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java index 8fb1ba9..38a8095 100644 --- a/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java +++ b/src/org/imperfectmommy/rexxeditor/preferences/RexxPreferencePage.java @@ -92,5 +92,5 @@ public void init(IWorkbench workbench) { } - + }