Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Johnson2019-03-25 12:47:40 -0400
committerAndrew Johnson2019-07-16 11:12:47 -0400
commit8002fb3529a3c0d1a3e9d0ade325320526ec7202 (patch)
tree0bb3149c81829f38fb82c6a871d59ad172f7f007
parent0c4e58b8cfe2f5f6fbc455ce3a6dcce1e6133b22 (diff)
downloadorg.eclipse.mat-8002fb3529a3c0d1a3e9d0ade325320526ec7202.tar.gz
org.eclipse.mat-8002fb3529a3c0d1a3e9d0ade325320526ec7202.tar.xz
org.eclipse.mat-8002fb3529a3c0d1a3e9d0ade325320526ec7202.zip
545754: OQL syntax highlighting sometimes doesn't highlight keywords
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545754 Allow carriage return as well as line feed as separators. Change-Id: I12295e024e8195ffcd50a3a9108066cd11820f30
-rw-r--r--plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/AttributeExtractor.java4
-rw-r--r--plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/OQLScanner.java9
2 files changed, 7 insertions, 6 deletions
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/AttributeExtractor.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/AttributeExtractor.java
index 8deeb467..e2b66486 100644
--- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/AttributeExtractor.java
+++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/AttributeExtractor.java
@@ -43,9 +43,9 @@ public class AttributeExtractor implements ContextExtractor
readChar = doc.getChar(pos);
pos--;
}
- while (pos >= 0 && readChar != ' ' && readChar != '@' && readChar != '.' && readChar != '\n');
+ while (pos >= 0 && readChar != ' ' && readChar != '@' && readChar != '.' && readChar != '\n' && readChar != '\r');
- if (readChar == ' ' || readChar == '\n' || readChar == '.')
+ if (readChar == ' ' || readChar == '\n' || readChar == '\r' ||readChar == '.')
pos++;
return doc.get(pos + 1, currentPosition - 1 - pos);
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/OQLScanner.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/OQLScanner.java
index 765af020..0903804b 100644
--- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/OQLScanner.java
+++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/snapshot/panes/oql/contentAssist/OQLScanner.java
@@ -41,7 +41,7 @@ public class OQLScanner extends RuleBasedScanner
public boolean isWordPart(char arg0)
{
- return arg0 != ' ' && arg0 != '\n';
+ return arg0 != ' ' && arg0 != '\n' && arg0 != '\r';
}
public boolean isWordStart(char arg0)
@@ -69,7 +69,7 @@ public class OQLScanner extends RuleBasedScanner
public boolean isWordPart(char arg0)
{
- return arg0 != ' ' && arg0 != '\n' && arg0 != ')' && arg0 != '!' && arg0 != '=';
+ return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != ')' && arg0 != '!' && arg0 != '=';
}
public boolean isWordStart(char arg0)
@@ -88,7 +88,7 @@ public class OQLScanner extends RuleBasedScanner
public boolean isWordPart(char arg0)
{
- return arg0 != ' ' && arg0 != '\n' && arg0 != '(';
+ return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != '(';
}
public boolean isWordStart(char arg0)
@@ -111,7 +111,7 @@ public class OQLScanner extends RuleBasedScanner
public boolean isWordPart(char arg0)
{
- return arg0 != ' ' && arg0 != '\n' && arg0 != '(';
+ return arg0 != ' ' && arg0 != '\n' && arg0 != '\r' && arg0 != '(';
}
public boolean isWordStart(char arg0)
@@ -126,6 +126,7 @@ public class OQLScanner extends RuleBasedScanner
wr4.addWord("outbounds", tKeyWord); //$NON-NLS-1$
wr4.addWord("inbounds", tKeyWord); //$NON-NLS-1$
wr4.addWord("classof", tKeyWord); //$NON-NLS-1$
+ wr4.addWord("eval", tKeyWord); //$NON-NLS-1$
r[3] = wr4;

Back to the top