On 2014-09-26 12:57, Fabio Zadrozny wrote:
> On Wed, Sep 24, 2014 at 9:25 AM, Andreas Pakulat <andr...@froglogic.com> 
> wrote:
> 
>> Hi,
>> 
>> I recently stumbled about the 'Builder' page and its 'Analyze only open
>> editors' setting. It sounded like disabling this would help one of our
>> customers who wanted to get completion for functions in modules that are 
>> not
>> yet imported. Unfortunately it turns out this preference is not being used
>> anywhere in the codebase and looking at the existing pydev tags has never
>> been used.
>> 
>> I'm wondering wether I'm missing something or wether this has really been
>> added (to the ui) and then never used (by the builder)?
>> 
>> On a related note: Is there a way to get pydev to create completions for
>> functions/classes in files that haven't been opened yet (after starting
>> eclipse)? (i.e. where do I have to look into the codebase to find the
>> starting point)
> 
> Hi Andreas,
> 
> Actually, that's still used... if you take a look at the code, the getter 
> which uses the ANALYZE_ONLY_ACTIVE_EDITOR constant is
> org.python.pydev.builder.PyDevBuilderPrefPage.getAnalyzeOnlyActiveEditor().

Ah, I missed the public static getter and its uses during my grep :)

> As for getting completions for functions/classes that haven't been imported, 
> I think I don't quite follow what you mean (you do have
> context-insensitive code-completion which would add the import and the token 
> -- but apparently, that's not what you meant), so, can you
> rephrase that to explain better your use case?

What I see happening is that completion does not include functions from 
modules that haven't been open in an editor. For example lets take this 
project:

myproject
  |
  - module1
  |    |
  |    - util.py
  |
  - module2
       |
       - main.py

util.py has just 1 function definition 'mycoolfun' and main.py is empty. 
After a fresh start of Eclipse I open main.py and type myc and invoke 
code-completion. There's no entry for mycoolfunc. If I open util.py, close it 
again and again invoke code-completion inside main.py the entry for 
'mycoolfunc' shows up.

My assumption was that this is caused by the 'analyze-only-open-editors' 
setting, but changing the setting from its default value did not help.

Andreas

PS: The project's root folder is configured as python path so that shouldn't 
be a problem.
PPS: Tested this with the master branch as well as seeing it with the 2.8 
release.

-- 
Andreas Pakulat squ...@froglogic.com
froglogic GmbH - Automated UI and Web Testing

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
pydev-code mailing list
pydev-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to