-
Couldn't load subscription status.
- Fork 25
Added tab completion functionality for collections #337
base: master
Are you sure you want to change the base?
Conversation
frontend/src/mws/Shell.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining what this regex is matching? if it is matches "string" or "comment" why do we return?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes its matching either string or comment. I will modify this to be more clear by removing the regex altogether.
You're right it shouldn't be returning, it should be calling the callback with no autocompletions in it and then returning. Good catch. The intent of the returning is that there are no autocompletion results to present if we are in a comment or string
|
This looks pretty exciting, but I don't fully understand it. I'd like to get on a call to walk through it when you have time. |
…y caching the results of ajax call
show-hint.jsadd-on.Assume that the collections
foo,bar, andfoobarexist.After hitting tab,
db.will autocomplete to show all of the above optionsdb.fwill autocomplete to showfooandfoobardb.foobwill autocomplete automatically tofoobarFurthermore,
if
x=dbhas been executed previously,x.will also autocomplete to show all of the available optionsBut if
y = {}has been executed,y.will not autocomplete because it does not evaluate to an object equal to the globaldbobject.Finally, if we set:
a = {}a.b = dbThen the autocompletion logic will recognize that
a.bevaluates todband therefore will autocompletea.b.to all of the available options.For now, this context-awareness only works for properties in dot-notation, but I plan on implementing it for bracket notation as well (which is really just a special type of property access). Evaluating functions is more problematic, however, because there is no way to safely know which function evaluations will modify state and which ones won't.