Calysto / matlab_kernel

Jupyter Kernel for Matlab
Other
469 stars 76 forks source link

Auto completion doesn't work for table type. #148

Closed YutaKudo closed 3 years ago

YutaKudo commented 3 years ago

Problem

Auto completion doesn't work properly with table data. Same problem as this issue. #52

Proposal Solution

Just add table option into kernel.py line 178.

FROM

if "." in name:
    prefix, _ = name.rsplit(".", 1)
    if self._matlab.eval("isstruct({})".format(prefix)):
    compls = ["{}.{}".format(prefix, compl) for compl in compls]

return compls

TO

if "." in name:
    prefix, _ = name.rsplit(".", 1)
    if self._matlab.eval("isstruct({})".format(prefix)) | self._matlab.eval("istable({})".format(prefix)):
    compls = ["{}.{}".format(prefix, compl) for compl in compls]

return compls

I'll make the new pull request for this right now. If someone knew a more elegant solution, please let me know.