private void setNoTabChar(@NotNull final CodeStyleSettings settings, final FileType fileType) { CommonCodeStyleSettings.IndentOptions indentOptions = settings.getIndentOptions(fileType); if (indentOptions != null) { indentOptions.USE_TAB_CHARACTER = false; } } }
private void setTestStyleSettings() { CodeStyleSettingsManager settingsManager = CodeStyleSettingsManager.getInstance(getProject()); com.intellij.psi.codeStyle.CodeStyleSettings codeStyleSettings = settingsManager.getCurrentSettings(); assertNotNull(codeStyleSettings); temporaryCodeStyleSettings = codeStyleSettings.clone(); com.intellij.psi.codeStyle.CodeStyleSettings.IndentOptions indentOptions = temporaryCodeStyleSettings.getIndentOptions(ElixirFileType.INSTANCE); assertNotNull(indentOptions); settingsManager.setTemporarySettings(temporaryCodeStyleSettings); }
protected void setSettingsBack() { final CodeStyleSettingsManager manager = CodeStyleSettingsManager.getInstance(myFixture.getProject()); myTempSettings.getIndentOptions(BashFileType.BASH_FILE_TYPE).INDENT_SIZE = 200; myTempSettings.getIndentOptions(BashFileType.BASH_FILE_TYPE).CONTINUATION_INDENT_SIZE = 200; myTempSettings.getIndentOptions(BashFileType.BASH_FILE_TYPE).TAB_SIZE = 200; myTempSettings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 5; manager.dropTemporarySettings(); myTempSettings = null; }
protected void setSettings(Project project) { Assert.assertNull(myTempSettings); CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project); myTempSettings = settings.clone(); CodeStyleSettings.IndentOptions gr = myTempSettings.getIndentOptions(BashFileType.BASH_FILE_TYPE); Assert.assertNotSame(gr, settings.OTHER_INDENT_OPTIONS); gr.INDENT_SIZE = 2; gr.CONTINUATION_INDENT_SIZE = 4; gr.TAB_SIZE = 2; myTempSettings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 3; CodeStyleSettingsManager.getInstance(project).setTemporarySettings(myTempSettings); }