bugGNU Octave - Bugs: bug #56208, GUI Editor autocomplete list could...

 
 

bug #56208: GUI Editor autocomplete list could show variables from current workspace

Submitter:  Rik <rik5>
Submitted:  Wed 24 Apr 2019 04:23:51 PM UTC
   
 
Category:  GUI Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 14 Mar 2023 07:16:27 PM UTC, comment #5: 

When in debug mode, hovering with the mouse over a variable displays a tooltip with the value of the variable. For this, the current list of symbols is fetched by

QStringList symbol_names
        = m_octave_qobj.get_workspace_model ()->get_symbol_names ();

get_symbol_names () just returns a class variable which holds the current list of symbols. However, this list can not directly be used by scintilla for auto completion. The lists for auto completion have to be prepared for the related interface. Since this takes some time, it would be not a good idea to do this each time an auto completion list is going to be shown.

Torsten Lilge <ttl>
Group Member
Tue 14 Mar 2023 12:00:38 PM UTC, comment #4: 

and currently the gui editor does a pretty good job of picking up all words (even in comments I think) as autocomplete options.  I didn't know if I was misunderstanding the intent of the original request.

Nicholas Jankowski <nrjank>
Group Member
Tue 14 Mar 2023 03:56:27 AM UTC, comment #3: 

If I'm editing a script, then I could understand completion of variables in the top-level workspace in the interpreter, but even then, there is no reason to know that the script will be executed in that context.

If I'm editing a function, then code inside the function doesn't share the scope of any other workspace, so I don't see the reason for completion picking up variables from the top-level workspace in the interpreter.

For functions, would it be good enough to consider all words in the current editor tab that aren't in comments as possible completions in addition to known function names?  That doesn't require a query of the interpreter state.

John W. Eaton <jwe>
Group administrator
Tue 14 Mar 2023 03:43:31 AM UTC, comment #2: 

Rik, can you clarify - for this bug, you don't want autocomplete to work in the interpreter, you want the autocomplete suggestion in the GUI Editor to respond to variables currently defined in the workspace even if they aren't used anywhere in the current editor document?

In that case, in v8.1, this currently does not yet exist.

if in the interpreter I type:

>> mydata = pi;


autocomplete for mydata works in the interpreter.  but if I switch to the editor, myd<TAB> produces no autocompletion. (v8.1 on windows)

Nicholas Jankowski <nrjank>
Group Member
Thu 25 Aug 2022 01:13:53 PM UTC, comment #1: 

Version 6.1
setting mydata = pi;
tab completion works.

Anonymous
Wed 24 Apr 2019 04:23:51 PM UTC, original submission:  

Similar to bug #56207, although of lesser importance, it would be nice if the autocomplete list in the GUI Editor included available variables defined in the current workspace.

Matlab does this, and the Octave interpreter in the Command Window also does this.

As an example, in the Command Window do


mydata = pi;
myd<TAB>
mydata



Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by seijikun
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-14 nrjank StatusConfirmed Need Info
    2019-06-20 seijikun Carbon-Copy- Added seijikun

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code