// see com.python.pydev.analysis.builder.AnalysisBuilderRunnable.doAnalysis
IAnalysisPreferences analysisPreferences =
AnalysisPreferences.getAnalysisPreferences();
analysisPreferences.clearCaches();
IIndentPrefs indentPrefs = DefaultIndentPrefs.get();
indentPrefs.regenerateIndentString(); // TAB_INDENT pref may have changd.
OccurrencesAnalyzer analyzer = new OccurrencesAnalyzer();
IMessage[] messages = analyzer.analyzeDocument(
nature, module, analysisPreferences, document,
new NullProgressMonitor(), indentPrefs);