mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +02:00
Bug 413357 - Change of scanner info provider doesn't take effect until
Eclipse restart Change-Id: I52dc82c7137ccd6507e626ffba8c49180d515e7f Reviewed-on: https://git.eclipse.org/r/14716 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
5bd1220fc8
commit
bfabd2198e
2 changed files with 23 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Andrew Gvozdev - initial API and implementation
|
* Andrew Gvozdev - initial API and implementation
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.core.language.settings.providers;
|
package org.eclipse.cdt.core.language.settings.providers;
|
||||||
|
@ -119,7 +120,11 @@ public class ScannerDiscoveryLegacySupport {
|
||||||
*/
|
*/
|
||||||
public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
|
public static void setLanguageSettingsProvidersFunctionalityEnabled(IProject project, boolean value) {
|
||||||
Preferences pref = getPreferences(project);
|
Preferences pref = getPreferences(project);
|
||||||
|
if (value == isLanguageSettingsProvidersFunctionalityEnabled(project))
|
||||||
|
return;
|
||||||
pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
|
pref.putBoolean(DISABLE_LSP_PREFERENCE, !value);
|
||||||
|
// Scanner info provider have changed - clear the cached copy (http://bugs.eclipse.org/413357).
|
||||||
|
CCorePlugin.getDefault().resetCachedScannerInfoProvider(project);
|
||||||
try {
|
try {
|
||||||
pref.flush();
|
pref.flush();
|
||||||
} catch (BackingStoreException e) {
|
} catch (BackingStoreException e) {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
* oyvind.harboe@zylin.com - http://bugs.eclipse.org/250638
|
* oyvind.harboe@zylin.com - http://bugs.eclipse.org/250638
|
||||||
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
|
* Jens Elmenthaler - http://bugs.eclipse.org/173458 (camel case completion)
|
||||||
|
* Sergey Prigogin (Google)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core;
|
package org.eclipse.cdt.core;
|
||||||
|
|
||||||
|
@ -1059,6 +1060,23 @@ public class CCorePlugin extends Plugin {
|
||||||
return provider;
|
return provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears cached scanner info provider for the given project so that the next call to
|
||||||
|
* {@link #getScannerInfoProvider(IProject)} would return an up to date scanner info provider.
|
||||||
|
*
|
||||||
|
* @noreference This method is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
|
public void resetCachedScannerInfoProvider(IProject project) {
|
||||||
|
try {
|
||||||
|
QualifiedName scannerInfoProviderName = new QualifiedName(PLUGIN_ID, SCANNER_INFO_PROVIDER2_NAME);
|
||||||
|
project.setSessionProperty(scannerInfoProviderName, null);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
if (project.isOpen()) {
|
||||||
|
log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find {@link IScannerInfoProvider} registered as extension via extension point
|
* Find {@link IScannerInfoProvider} registered as extension via extension point
|
||||||
* org.eclipse.cdt.core.ScannerInfoProvider2.
|
* org.eclipse.cdt.core.ScannerInfoProvider2.
|
||||||
|
|
Loading…
Add table
Reference in a new issue