Skip to content

Commit

Permalink
Enable optimizing imports on the fly by default (#1144)
Browse files Browse the repository at this point in the history
Configure Intellij to optimize imports on the fly
  • Loading branch information
ferozco authored and bulldozer-bot[bot] committed Jan 6, 2020
1 parent b79b01c commit 13ae717
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-1144.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: feature
feature:
description: Configure Intellij to optimize imports on the fly
links:
- https://github.com/palantir/gradle-baseline/pull/1144
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class BaselineIdea extends AbstractBaselinePlugin {
ideaRootModel.workspace.iws.withXml { provider ->
def node = provider.asNode()
setRunManagerWorkingDirectory(node)
addEditorSettings(node)
}
}

Expand Down Expand Up @@ -238,6 +239,14 @@ class BaselineIdea extends AbstractBaselinePlugin {
""".stripIndent()))
}

private void addEditorSettings(node) {
node.append(new XmlParser().parseText("""
<component name="CodeInsightWorkspaceSettings">
<option name="optimizeImportsOnTheFly" value="true" />
</component>
""".stripIndent()))
}

private void addGitHubIssueNavigation(node) {
GitUtils.maybeGitHubUri().ifPresent { githubUri ->
node.append(new XmlParser().parseText("""
Expand Down

0 comments on commit 13ae717

Please sign in to comment.