mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Migration to new Code Style API
This commit is contained in:
@@ -222,19 +222,4 @@ public class CodeStyle {
|
||||
CodeStyleSettingsManager.getInstance(project).dropTemporarySettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A global application-level line separator. By default line separator is the same as defined in the system.
|
||||
*/
|
||||
public static String getDefaultLineSeparator() {
|
||||
return getDefaultSettings().getLineSeparator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param project The project to get a configured line separator for.
|
||||
* @return The line separator configured for the project or system line separator if not defined.
|
||||
*/
|
||||
public static String getLineSeparator(@NotNull Project project) {
|
||||
return getSettings(project).getLineSeparator();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
|
||||
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
|
||||
import com.intellij.psi.search.FileTypeIndex;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
@@ -64,7 +63,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
public static void export(Project project) {
|
||||
final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
|
||||
final CodeStyleSettings settings = CodeStyle.getSettings(project);
|
||||
final CommonCodeStyleSettings.IndentOptions commonIndentOptions = settings.getIndentOptions();
|
||||
StringBuilder result = new StringBuilder();
|
||||
addIndentOptions(result, "*", commonIndentOptions, getEncoding(project) +
|
||||
@@ -107,7 +106,7 @@ public class Utils {
|
||||
}
|
||||
|
||||
private static String getLineEndings(Project project) {
|
||||
final String separator = CodeStyle.getLineSeparator(project);
|
||||
final String separator = CodeStyle.getSettings(project).getLineSeparator();
|
||||
for (LineSeparator s : LineSeparator.values()) {
|
||||
if (separator.equals(s.getSeparatorString())) {
|
||||
return LineEndingsManager.lineEndingsKey + "=" + s.name().toLowerCase(Locale.US) + "\n";
|
||||
|
||||
Reference in New Issue
Block a user