Why is tab completion broken for my struct?
조회 수: 9 (최근 30일)
이전 댓글 표시
Hi,
I wrote a class with a struct as one of the properties. For that particular struct, tab completion does not work, i.e. when I press tab after writing "obj.struct." it says "No Completions Found.". Completion works for other structs in other properties of the same object.
Now, I guess that this is due to some issue in my code, which prevents the tab completion algorithm from assembling a list of field names. Does anyone know what code issues might cause such a problem with tab completion (in general)? The code does not produce any errors, and typing "obj.struct" displays a list of fieldnames and values as usual. Just tab completion does not work.
I can't provide simple code to replicate the problem since the code that generates the problematic struct is quite complex. I'm just wondering if someone has a general idea of which issues cause failures in tab completion of struct fields.
Thanks, Matthias
댓글 수: 0
답변 (1개)
Shruti Sapre
2015년 7월 29일
Hi Matthias,
Here are a few general reasons that might cause tab completion to not work on a structure in a class:
1. The structure could be a private member of the class. This will not allow it to show up on hitting the tab key.
2. The "TC.xml" file might have been corrupted. This could be caused by installing third-party toolboxes (those not made by Mathworks) into MATLAB. Restoring the “TC.xml” could help fix the problem. You can contact Mathworks Technical Support for resolving this issue.
3. Because tab completion uses static analysis, it doesn’t try to guess the data type for a variable, so properties and fields won’t be completed unless that variable is also defined in the workspace. For similar reasons, variables created through eval, assignin, load, etc. won’t be added to the list of completions.
4. In the Editor, MATLAB does not complete field names of structure arrays defined only within the active file.
5. In case the structure is complex and cannot be analyzed for some reason, it might help to check the structure outside the class and see if tab completion works
Hope this helps!
-Shruti
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!