mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 14:15:23 +02:00
Removed an attempt to present entries in resource hierarchy for BOP
providers. It should be OK to keep it on per-file bases as there is no duplication/memory bloating which has been addressed in LanguageSettingsSerializable.
This commit is contained in:
parent
d01d0bfd60
commit
7fc11c53c4
3 changed files with 5 additions and 40 deletions
|
@ -1891,37 +1891,4 @@ public class GCCBuildCommandParserTest extends TestCase {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void testBuildResourceTree() throws Exception {
|
||||
// create resources
|
||||
IProject project = ResourceHelper.createCDTProjectWithConfig(this.getName());
|
||||
ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
|
||||
ICConfigurationDescription cfgDescription = cfgDescriptions[0];
|
||||
IFolder folder = ResourceHelper.createFolder(project, "Folder");
|
||||
IFile file = ResourceHelper.createFile(project, "Folder/file.cpp");
|
||||
|
||||
// create GCCBuildCommandParser
|
||||
GCCBuildCommandParser parser = (GCCBuildCommandParser) LanguageSettingsManager.getExtensionProviderCopy(GCC_BUILD_COMMAND_PARSER_EXT);
|
||||
ErrorParserManager epm = new ErrorParserManager(project, null);
|
||||
|
||||
// parse line
|
||||
parser.startup(cfgDescription);
|
||||
parser.processLine("gcc "
|
||||
+ " -DMACRO"
|
||||
+ " Folder/file.cpp",
|
||||
epm);
|
||||
parser.shutdown();
|
||||
|
||||
// check that entries go to highest possible level
|
||||
CMacroEntry entry = new CMacroEntry("MACRO", null, 0);
|
||||
List<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
|
||||
entries.add(entry);
|
||||
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(parser, cfgDescription, file, LANG_CPP));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(parser, cfgDescription, folder, LANG_CPP));
|
||||
assertEquals(entries, LanguageSettingsManager.getSettingEntriesUpResourceTree(parser, cfgDescription, project, LANG_CPP));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -101,13 +101,6 @@ public abstract class AbstractBuildCommandParser extends AbstractLanguageSetting
|
|||
return super.processLine(line, epm);
|
||||
}
|
||||
|
||||
// TODO - test cases
|
||||
@Override
|
||||
public void shutdown() {
|
||||
LanguageSettingsManager.buildResourceTree(this, currentCfgDescription, currentLanguageId, currentProject);
|
||||
super.shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* Trivial Error Parser which allows highlighting of output lines matching the patterns
|
||||
* of this parser. Intended for better troubleshooting experience.
|
||||
|
|
|
@ -61,6 +61,11 @@ public class LanguageSettingsManager {
|
|||
/**
|
||||
* Builds for the provider a nice looking resource tree to present hierarchical view to the user.
|
||||
*
|
||||
* TODO - Note that after using this method for a while for BOP parsers it appears that disadvantages
|
||||
* outweight benefits. In particular, it doesn't result in saving memory as the language settings
|
||||
* (and the lists itself) are not duplicated in memory anyway but optimized with using WeakHashSet
|
||||
* and SafeStringInterner.
|
||||
*
|
||||
* @param provider - language settings provider to build the tree for.
|
||||
* @param cfgDescription - configuration description.
|
||||
* @param languageId - language ID.
|
||||
|
|
Loading…
Add table
Reference in a new issue