tab autocompete feature with imported packages

3 views (last 30 days)
Is there a way to make the tab auto-complete popup menu include in its search the functions/classes in an imported Package/namespace?
for instance, i have the following directory structure
C:\Mfiles (exists on matlab path)
C:\Mfiles\+Units ( a package of classdef files)
C:\Mfiles\+Units\AngleUnits.m ( class file within Units package)
If i type the following within the command env or in the editor
import Units.*
bob= AngleUn
and then press \tab, it does not find AngleUnits.m in the popup menu. Is there a way to make the autocomplete search the Units namespace for matching filenames as well as the matlab path?
thanks
  3 Comments
Tomas Thalmann
Tomas Thalmann on 8 Sep 2015
In 2015 I have still the same problem as Brain with MATLAB R2015a... Any news on that?
Ryan Mott
Ryan Mott on 3 Aug 2019
It appears this feature has not been added yet as of R2018b.
For example, suppose package 'pack' is on the MATLAB path and class 'Obj' is in 'pack'. After opening a script file and typing
pack.Ob
and then tab, the editor auto-completes the name 'Obj'.
However, after instead typing
import pack.Obj
Ob
and then tab, the auto-complete popup says "No completions found," even though MATLAB can find Obj at run time if the name is completed.
I would not call tab complete's failure to search imported packages a bug. But I regularly lose time typing due to this feature's absence. I hope MathWorks adds it.

Sign in to comment.

Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!