<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-15"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 19.05.2009 22:33, schrieb Enrico Tröger:
<blockquote cite="mid:20090519223307.1a4a460f.enrico.troeger@uvena.de"
 type="cite">
  <pre wrap="">On Mon, 18 May 2009 19:54:24 +0200, Filip wrote:

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">This was already requested a couple of times. I'm not sure whether we
want this. It would probably require quite some effort to parse
import statements from an opened source file, find the corresponding
Python files, parse them, merge the parsed information into
tagmanager(the code which provides the main part of symbol
completion data). Additionally, added symbols should maybe removed
again when the source file is closed which also might not be that
trivial.
      </pre>
    </blockquote>
    <pre wrap="">I am not suggesting anything as complicated, as you say. I understand,
that in situation like
thos:

import sth

you want to find module sth.py and detect all symbols inside. I think
enough is to add sth to namespace. It would became useful in following
situation:

    </pre>
  </blockquote>
  <pre wrap=""><!---->>from sth import LongNameClass, AnotherLongNameClass
  </pre>
  <blockquote type="cite">
    <pre wrap="">and simply add those two. You need to only parse imports and detect
names, that were added to the local namespace.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Ha, I guess I was a bit off the road with my ideas...:).

Your suggestion was actually quite easy to implement, I did it in SVN.
Geany now parses import statements for Python files and provide it as
symbol compeltion.
Currently it also lists them in the symbol list though I'm not yet
completely sure whether we really want this. Awaiting some feedback of
Python users :).

For testing the parser, I mainly used the following code snippet:
import os, sys, errno, re, glob, gc, datetime, shutil
try: import cPickle
except: import pickle as cPickle
import Runner, TaskGen, Node, Scripting, Utils, Environment, Task,
Logs, Options
from Logs import debug, error, info
from Constants import *

Are there other variants of "import" statements possible? You know, my
Python knowledge is very limited :).


Regards,
Enrico
  </pre>
</blockquote>
<br>
Can we have this for C'ish #includes as well, if not already done that
is. The tricky part is the various include dirs which are totally
custom in many projects :(<br>
<br>
Best regards.<br>
</body>
</html>