question about variables.h

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

question about variables.h

ian reinhart geiser
Greetings,
I have a question on the function:
extern string_vector
generate_struct_completions (const std::string& text, std::string& prefix,
std::string& hint);

Am I correct that this will give me the completion hints for the currently
available variables in the current top_level_sym_tab?

The reason I ask is because im working on code completion in the editor
and this method looked promising.  The issue I see with it is that I would
have to have two instances of the octave interpreter running, one for the
main console, and one for the code completion, syntax error reporter, and
current functions/variables information for the current editor view.

Could anyone please explain how this method works, and if it even will do
what i think it should do?

Cheers
   -ian reinhart geiser
--
+-Ian Reinhart Geiser [hidden email]
+-Vice President of Engineering
+-http://www.sourcextreme.com
+-It's not that we don't make mistakes, we just don't keep them around.


Reply | Threaded
Open this post in threaded view
|

question about variables.h

John W. Eaton-6
On  6-Oct-2004, Ian Reinhart Geiser <[hidden email]> wrote:

| Greetings,
| I have a question on the function:
| extern string_vector
| generate_struct_completions (const std::string& text, std::string& prefix,
| std::string& hint);
|
| Am I correct that this will give me the completion hints for the currently
| available variables in the current top_level_sym_tab?

No, I think it just attempts to give you completions for things that
look like structs.  You might want to look at generate_completion,
also in input.cc.  These completion functions are not called directly by
Octave, but by readline, when someone asks for a completion (usually
by typing TAB after entering some text).

| The reason I ask is because im working on code completion in the editor
| and this method looked promising.  The issue I see with it is that I would
| have to have two instances of the octave interpreter running, one for the
| main console, and one for the code completion, syntax error reporter, and
| current functions/variables information for the current editor view.

Completion works on the symbols that are currently in the symbol table
as well as functions that might be found in files, etc.  If you have
two instances of the interpreter, you may not get the right
completions because you would be looking at a different symbol table
from the one that is being used for calculations.

jwe