Re: [Pydev-code] Has the analyze only open editors setting ever had a meaning?
Brought to you by:
fabioz
From: Fabio Z. <fa...@gm...> - 2014-09-26 13:44:45
|
On Fri, Sep 26, 2014 at 10:34 AM, Andreas Pakulat <an...@fr...> wrote: > On 2014-09-26 12:57, Fabio Zadrozny wrote: > >> On Wed, Sep 24, 2014 at 9:25 AM, Andreas Pakulat <an...@fr...> >> 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. > > Humm... that sounds like you have disabled auto-build (project > build automatically)... if that's the case, you have to invoke the build manually for pydev to index those files (Ctrl+B)... or maybe something else became wrong and the indexing became lost (if that's the case, a manual fix would be going to the project properties > pydev-pythonpath > force restore internal info -- and it should definitely be kept up to date afterwards if auto build is turned on). Cheers, Fabio |