Github user zjffdu commented on the issue:
https://github.com/apache/zeppelin/pull/2474
Thanks @Leemoonsoo for catching that. This is due to I miss cursor for code
completion. Just pushed another commit to fix that and add more unit test for
it.
```
// there's no completion for 'a.' because it is not recognized by
compiler for now.
String st = "a='hello'\na.";
completions = interpreter.completion(st, st.length(),
getInterpreterContext());
assertEquals(0, completions.size());
// define a first
st = "a='hello'";
result = interpreter.interpret(st, getInterpreterContext());
assertEquals(InterpreterResult.Code.SUCCESS, result.code());
// now we can get the completion for `a.`
st = "a.";
completions = interpreter.completion(st, st.length(),
getInterpreterContext());
// it is differnet for python2 and python3 and may even different for
different minor version
// so only verify it is larger than 20
assertTrue(completions.size() > 20);
st = "a.ca";
completions = interpreter.completion(st, st.length(),
getInterpreterContext());
// a.capitalize
// a.casefold
assertEquals(2, completions.size());
// cursor is in the middle of code
st = "a.ca\b='hello";
completions = interpreter.completion(st, 4, getInterpreterContext());
// a.capitalize
// a.casefold
assertEquals(2, completions.size());
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---