Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Which event triggers language settings provider and from where?

Hi Andrew,

The language settings provider is implemented like this:

public class CMakeLangSetProvider extends LanguageSettingsBaseProvider implements ILanguageSettingsProvider
and uses an instance of e.g. GCCBuildCommandParser internally similar to this:
if comiler is gcc
     m_commandParser = new GCCBuildCommandParser();
if compiler is clang
    m_commandParser = new ClangBuildCommandParser();
if compiler is msvc
   m_commandParser = new MSVCBuildCommandParser();

I need to detect the compiler at runtime, so I do not know which compiler's build command parser to use until I parse the output in the cmake generated file "compile_commands.json". Thats why I don't derive from AbstractBuildCommandParser but use an instance of it.

In the meanwhile I found out, that I called startup() ...for all lines: processLine() .. shutdown()  every time getSettingsEntries got called. I thought, I can optimize that later and reparse the compiler_commands.json only if it changed. Now I think, that the serialisation happening on shutdown() somehow triggers another call to getSettingsEntries?

Another question:
is it possible to avoid the serialisation of the settings entries done by GCCBuildCommandParser and only use it to parse the commands and store them in memory so I can access the results by calling GCCBuildCommandParser.getSettingsEntries() ? I'm not sure if this is better at all... with cmake, many include paths may be unknown until cmake was run (Makefile generated). After that the compile_command.json file is also present, so I could consider it as the persistent storage. I would have to reparse it on every start of Eclipse, but the information would not be kept double and cannot get out of sync.

What do you think?

thanks for your reply.

Von:        Andrew Gvozdev <>
An:        "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Datum:        2015-09-21 15:42
Betreff:        Re: [cdt-dev] Which event triggers language settings provider and from where?
Gesendet von:        cdt-dev-bounces@xxxxxxxxxxx

Hi Martin,
What kind of language settings provider is that? Is it derived from AbstractBuildCommandParser or AbstractBuiltinSpecsDetector?


On Mon, Sep 21, 2015 at 3:41 AM, <Martin.Runge@xxxxxxxxxxxxxxxxx> wrote:
Hi all,

I have a language settings provider (CMakeLangSetProvider) that is called
endlessly in a loop. Unfortunetly it is run in a worker thread, so I
cannot see the cause that triggered it in the callstack (see below).

Where should I look at to find the cause that lets the language settings
provider's getSettingEntries() method beeing? Afaik, ressource changes
trigger the language settings provider and I can see the TreeView in
project Explorer flickering. But I don't understand why.

Is there a way to exclude some project folders like the output folder from
those triggering the language settings provider?

best regards

IResource, String) line: 70
IResource, String) line: 180
ICConfigurationDescription, IResource, String) line: 1421
ICConfigurationDescription, IResource, String) line: 1449
IResource, String, int, boolean, boolean) line: 1508
IResource, String, int) line: 1550
int, CResourceData, Set<ICLanguageSettingEntry>) line: 2064
PathEntryTranslator.access$11(ICConfigurationDescription, int,
CResourceData, Set) line: 2037
PathEntryTranslator$1.visit(PathSettingsContainer) line: 2025
PathSettingsContainer.doAccept(IPathSettingsContainerVisitor) line: 519
PathSettingsContainer.accept(IPathSettingsContainerVisitor) line: 515
PathEntryTranslator.collectEntries(IProject, ICConfigurationDescription)
line: 2017
ConfigBasedPathEntryStore.getEntries(IProject, ICConfigurationDescription)
line: 237
ConfigBasedPathEntryStore.handleEvent(CProjectDescriptionEvent) line: 198
CProjectDescriptionManager.notifyListeners(CProjectDescriptionEvent) line:
SetCProjectDescriptionOperation.executeOperation() line: 140
SetCProjectDescriptionOperation(CModelOperation).execute() line: 341
line: 607, ISchedulingRule, int, IProgressMonitor)
line: 2241
line: 638
int, IProgressMonitor) line: 203
ICProjectDescription, int, IProgressMonitor) line: 149
ICProjectDescription, int, IProgressMonitor) line: 885
ICProjectDescription, boolean, IProgressMonitor) line: 846
CProjectDescriptionManager$ line: 573
CProjectDescriptionManager$ line: 523, ISchedulingRule, int, IProgressMonitor)
line: 2241
CProjectDescriptionManager.runAtomic(IWorkspaceRunnable, ISchedulingRule,
IProgressMonitor) line: 519
CProjectDescriptionManager.access$2(IWorkspaceRunnable, ISchedulingRule,
IProgressMonitor) line: 517
CProjectDescriptionManager$ line: 498 line: 55
cdt-dev mailing list

To change your delivery options, retrieve your password, or unsubscribe from this list, visit
cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top