tab autocompete feature with imported packages

4 次查看(过去 30 天)
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 个评论
Tomas Thalmann
Tomas Thalmann 2015-9-8
In 2015 I have still the same problem as Brain with MATLAB R2015a... Any news on that?
Ryan Mott
Ryan Mott 2019-8-3
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Software Development Tools 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by