Skip to content

Commit

Permalink
https://issues.jboss.org/browse/JBIDE-7991 problem with tabs and code…
Browse files Browse the repository at this point in the history
… completion fix
  • Loading branch information
Dmitry Geraskov committed May 30, 2011
1 parent 352b721 commit 3205619
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public void newline() {
public int getColumn() {
return super.getColumn()-1;
}


};
lexer.setTabSize(1);
}

public int getTokenLength() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 3205619

Please sign in to comment.