mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 393641: When importing an existing CDT project, language settings providers are disabled
This commit is contained in:
parent
92376ee191
commit
6012e77cfa
2 changed files with 21 additions and 1 deletions
|
@ -62,6 +62,22 @@ public class ScannerDiscoveryLegacySupport {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if Language Settings functionality is defined for given project in preferences.
|
||||
*
|
||||
* @param project - project to check the preference
|
||||
* @return {@code true} if functionality is defined
|
||||
*
|
||||
* @noreference This method is temporary and not intended to be referenced by clients.
|
||||
*
|
||||
* @since 5.4.1
|
||||
*/
|
||||
public static boolean isLanguageSettingsProvidersFunctionalityDefined(IProject project) {
|
||||
Preferences pref = getPreferences(project);
|
||||
String value = pref.get(DISABLE_LSP_PREFERENCE, null);
|
||||
return value != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if Language Settings functionality is enabled for given project.
|
||||
*
|
||||
|
|
|
@ -1172,7 +1172,6 @@ public class LanguageSettingsProvidersSerializer {
|
|||
} else {
|
||||
providers.add(LanguageSettingsManager.getExtensionProviderCopy(id, true));
|
||||
}
|
||||
|
||||
}
|
||||
((ILanguageSettingsProvidersKeeper) cfgDescription).setLanguageSettingProviders(providers);
|
||||
}
|
||||
|
@ -1188,6 +1187,11 @@ public class LanguageSettingsProvidersSerializer {
|
|||
}
|
||||
}
|
||||
|
||||
if (!ScannerDiscoveryLegacySupport.isLanguageSettingsProvidersFunctionalityDefined(project)) {
|
||||
// if not yet defined by user - set preference to tell if this is legacy .cproject (i.e. no LSP storageElement)
|
||||
ScannerDiscoveryLegacySupport.setLanguageSettingsProvidersFunctionalityEnabled(project, storageElement != null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue