Skip to content

Commit

Permalink
#632: added .editorconfig to settings-workspaces (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingAmeise authored Nov 11, 2024
1 parent 6cb3765 commit 1e5e98d
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -354,4 +354,4 @@ ij_yaml_keep_line_breaks = true
ij_yaml_sequence_on_new_line = false
ij_yaml_space_before_colon = false
ij_yaml_spaces_within_braces = true
ij_yaml_spaces_within_brackets = true
ij_yaml_spaces_within_brackets = true
3 changes: 2 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE

Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/415[#415]: Added a message that will inform the user for what process he will need to enter his sudo- password
* https://github.com/devonfw/IDEasy/issues/632[#632]: Add .editorconfig to settings workspaces
* https://github.com/devonfw/IDEasy/issues/415[#415]: Added a message that will inform the user for what process he will need to enter his sudo-password
* https://github.com/devonfw/IDEasy/issues/708[#708]: Open vscode in workspace path
* https://github.com/devonfw/IDEasy/issues/608[#608]: Enhanced error messages. Now logs missing command output and error messages
* https://github.com/devonfw/IDEasy/issues/715[#715]: Show "cygwin is not supported" message for cygwin users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public void run() {
try {
Parser parser = new DefaultParser();
try (Terminal terminal = TerminalBuilder.builder().build()) {

// initialize our own completer here and add exit as an autocompletion option
Completer completer = new AggregateCompleter(
new StringsCompleter("exit"), new IdeCompleter((AbstractIdeContext) this.context));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public DirectoryMerger(IdeContext context) {
this.extension2mergerMap.put("json", jsonMerger);
TextMerger textMerger = new TextMerger(context);
this.extension2mergerMap.put("name", textMerger); // intellij specific
this.extension2mergerMap.put("editorconfig", textMerger);
this.fallbackMerger = new FallbackMerger(context);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ protected void configureWorkspace() {

Path settingsWorkspaceFolder = this.context.getSettingsPath().resolve(this.tool)
.resolve(IdeContext.FOLDER_WORKSPACE);
Path genericWorkspaceFolder = this.context.getSettingsPath().resolve(IdeContext.FOLDER_WORKSPACE);
Path workspaceUpdateFolder = genericWorkspaceFolder.resolve(IdeContext.FOLDER_UPDATE);
Path workspaceSetupFolder = genericWorkspaceFolder.resolve(IdeContext.FOLDER_SETUP);
FileAccess fileAccess = this.context.getFileAccess();
if (!fileAccess.isExpectedFolder(settingsWorkspaceFolder)) {
return;
Expand All @@ -76,7 +79,8 @@ protected void configureWorkspace() {
return; // should actually never happen...
}
try (Step step = this.context.newStep("Configuring workspace " + ideWorkspacePath.getFileName() + " for IDE " + this.tool)) {
int errors = this.context.getWorkspaceMerger().merge(setupFolder, updateFolder, this.context.getVariables(), ideWorkspacePath);
int errors = this.context.getWorkspaceMerger().merge(workspaceSetupFolder, workspaceUpdateFolder, this.context.getVariables(), ideWorkspacePath);
errors += this.context.getWorkspaceMerger().merge(setupFolder, updateFolder, this.context.getVariables(), ideWorkspacePath);
if (errors == 0) {
step.success();
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.devonfw.tools.ide.tool.ide;

import java.nio.file.Path;

import org.junit.jupiter.api.Test;

import com.devonfw.tools.ide.context.AbstractIdeContextTest;
import com.devonfw.tools.ide.context.IdeContext;
import com.devonfw.tools.ide.tool.intellij.Intellij;

/**
* Test of {@link IdeToolCommandlet}.
*/
public class IdeToolCommandletTest extends AbstractIdeContextTest {

/**
* Tests if .editorconfig was copied to workspace-folder after running an ide-tool.
*/
@Test
public void testConfigureWorkspace() {
// arrange
IdeContext context = newContext("intellij");
Path workspace = context.getWorkspacePath();
// act
context.getCommandletManager().getCommandlet(Intellij.class).run();
// assert
assertThat(workspace.resolve(".editorconfig")).exists();
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 7
indent_style = space
insert_final_newline = true
max_line_length = 160
tab_width = 2
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides =
ij_wrap_on_typing = false

0 comments on commit 1e5e98d

Please sign in to comment.