use of com.intellij.application.options.ReplacePathToMacroMap in project intellij-plugins by JetBrains.
the class ConversionHelper method collapsePaths.
public static void collapsePaths(Element element) {
ReplacePathToMacroMap map = new ReplacePathToMacroMap();
PathMacrosImpl.getInstanceEx().addMacroReplacements(map);
map.substitute(element, SystemInfo.isFileSystemCaseSensitive, true);
}
use of com.intellij.application.options.ReplacePathToMacroMap in project intellij-community by JetBrains.
the class BasePathMacroManager method getReplacePathMap.
@NotNull
protected ReplacePathToMacroMap getReplacePathMap() {
ReplacePathToMacroMap result = new ReplacePathToMacroMap();
getPathMacros().addMacroReplacements(result);
for (Map.Entry<String, String> entry : PathMacroUtil.getGlobalSystemMacros().entrySet()) {
result.addMacroReplacement(entry.getValue(), entry.getKey());
}
return result;
}
use of com.intellij.application.options.ReplacePathToMacroMap in project intellij-community by JetBrains.
the class ModulePathMacroManager method getReplacePathMap.
@NotNull
@Override
public ReplacePathToMacroMap getReplacePathMap() {
final ReplacePathToMacroMap result = super.getReplacePathMap();
final String modulePath = PathMacroUtil.getModuleDir(myModule.getModuleFilePath());
addFileHierarchyReplacements(result, PathMacroUtil.MODULE_DIR_MACRO_NAME, modulePath, PathMacroUtil.getUserHomePath());
return result;
}
use of com.intellij.application.options.ReplacePathToMacroMap in project intellij-community by JetBrains.
the class ProjectPathMacroManager method getReplacePathMap.
@NotNull
@Override
public ReplacePathToMacroMap getReplacePathMap() {
final ReplacePathToMacroMap result = super.getReplacePathMap();
addFileHierarchyReplacements(result, PathMacroUtil.PROJECT_DIR_MACRO_NAME, myProject.getBasePath(), null);
return result;
}
use of com.intellij.application.options.ReplacePathToMacroMap in project intellij-community by JetBrains.
the class PathMacroManagerTest method testRightMacrosOrder_RelativeValues_NoVariables.
@Test
public void testRightMacrosOrder_RelativeValues_NoVariables() {
setUpMocks("/tmp/foo");
final ReplacePathToMacroMap replacePathMap = new ModulePathMacroManager(myPathMacros, myModule).getReplacePathMap();
assertReplacements(replacePathMap, "file:/tmp/foo/module -> file:$MODULE_DIR$\n" + "file://tmp/foo/module -> file:/$MODULE_DIR$\n" + "file:///tmp/foo/module -> file://$MODULE_DIR$\n" + "jar:/tmp/foo/module -> jar:$MODULE_DIR$\n" + "jar://tmp/foo/module -> jar:/$MODULE_DIR$\n" + "jar:///tmp/foo/module -> jar://$MODULE_DIR$\n" + "/tmp/foo/module -> $MODULE_DIR$\n" + APP_HOME + " -> $APPLICATION_HOME_DIR$\n" + "file:" + APP_HOME + " -> file:$APPLICATION_HOME_DIR$\n" + "file:/" + APP_HOME + " -> file:/$APPLICATION_HOME_DIR$\n" + "file://" + APP_HOME + " -> file://$APPLICATION_HOME_DIR$\n" + "jar:" + APP_HOME + " -> jar:$APPLICATION_HOME_DIR$\n" + "jar:/" + APP_HOME + " -> jar:/$APPLICATION_HOME_DIR$\n" + "jar://" + APP_HOME + " -> jar://$APPLICATION_HOME_DIR$\n" + USER_HOME + " -> $USER_HOME$\n" + "file:" + USER_HOME + " -> file:$USER_HOME$\n" + "file:/" + USER_HOME + " -> file:/$USER_HOME$\n" + "file://" + USER_HOME + " -> file://$USER_HOME$\n" + "jar:" + USER_HOME + " -> jar:$USER_HOME$\n" + "jar:/" + USER_HOME + " -> jar:/$USER_HOME$\n" + "jar://" + USER_HOME + " -> jar://$USER_HOME$\n" + "file:/tmp/foo -> file:$MODULE_DIR$/..\n" + "file://tmp/foo -> file:/$MODULE_DIR$/..\n" + "file:///tmp/foo -> file://$MODULE_DIR$/..\n" + "jar:/tmp/foo -> jar:$MODULE_DIR$/..\n" + "jar://tmp/foo -> jar:/$MODULE_DIR$/..\n" + "jar:///tmp/foo -> jar://$MODULE_DIR$/..\n" + "/tmp/foo -> $MODULE_DIR$/..\n" + "file:/tmp -> file:$MODULE_DIR$/../..\n" + "file://tmp -> file:/$MODULE_DIR$/../..\n" + "file:///tmp -> file://$MODULE_DIR$/../..\n" + "jar:/tmp -> jar:$MODULE_DIR$/../..\n" + "jar://tmp -> jar:/$MODULE_DIR$/../..\n" + "jar:///tmp -> jar://$MODULE_DIR$/../..\n" + "/tmp -> $MODULE_DIR$/../..");
}
Aggregations