r = completion(line)
| Parameter | Description |
|---|---|
| line | a string: command line prefix to complete. |
| Parameter | Description |
|---|---|
| r | a structure with completion prefix and candidate lists. |
completion exposes the same completion engine used by the console, GUI terminal, and text editor.
The returned structure contains prefix, showpopup, files, builtin, macros, variables, fields, properties, and methods.
Classdef objects and class names are completed through their public properties and methods, including class constants and static methods.
clear classes
d = [tempdir(), 'nelson_help_completion_classdef/'];
mkdir(d);
filewrite([d, '/NelsonHelpCompletionPoint.m'], ["classdef NelsonHelpCompletionPoint"; " properties"; " X = 0"; " end"; " properties (Constant)"; " Dimension = 2"; " end"; " methods"; " function r = value(obj)"; " r = obj.X;"; " end"; " end"; " methods (Static)"; " function obj = origin()"; " obj = NelsonHelpCompletionPoint();"; " end"; " end"; "end"]);
addpath(d);
p = NelsonHelpCompletionPoint();
objectCompletion = completion('p.')
classCompletion = completion('NelsonHelpCompletionPoint.')
| Version | Description |
|---|---|
| 2.0.0 | completion engine exposed for tests and scripts |