Permalink
Browse files

https://issues.jboss.org/browse/JBIDE-7991 problem with tabs and code…

… completion fix
  • Loading branch information...
1 parent 352b721 commit 3205619805d19e8d22805e809f13e3885e011b41 Dmitry Geraskov committed May 25, 2011
@@ -27,9 +27,8 @@ public void newline() {
public int getColumn() {
return super.getColumn()-1;
}
-
-
};
+ lexer.setTabSize(1);
}
public int getTokenLength() {
@@ -310,6 +310,31 @@ public void testFromNonWhitespace() {
assertTrue(completionProposals.length > 0);
}
+
+ public void testFromWithTabs() {
+ Collector c = new Collector();
+
+ IHQLCodeAssist hqlEval = new HQLCodeAssist(sf);
+
+ String query = null;
+ int caretPosition = -1;
+ HQLCompletionProposal[] completionProposals = null;
+
+ c.clear();
+ final String codeCompletionPlaceMarker = " from ";
+ query = "select\t \tt1." + codeCompletionPlaceMarker + "Product t1";
+ caretPosition = query.indexOf(codeCompletionPlaceMarker);
+ hqlEval.codeComplete(query, caretPosition, c);
+ completionProposals = c.getCompletionProposals();
+ assertTrue(completionProposals.length == 0);
+
+ c.clear();
+ query = query.replace('\t', ' ');
+ hqlEval.codeComplete(query, caretPosition, c);
+ completionProposals = c.getCompletionProposals();
+ assertTrue(completionProposals.length > 0);
+ }
+
public void testBasicFromPartialEntityName() {
Collector c = new Collector();

0 comments on commit 3205619

Please sign in to comment.