mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
to line end comment: trim lines
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ public class ChangeToEndOfLineCommentIntention extends Intention {
|
||||
}
|
||||
}
|
||||
final PsiComment newComment =
|
||||
factory.createCommentFromText("//" + lines[0], parent);
|
||||
factory.createCommentFromText("//" + lines[0].trim(), parent);
|
||||
final PsiElement replacedComment = comment.replace(newComment);
|
||||
codeStyleManager.reformat(replacedComment);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class MyTest {
|
||||
/* simple end comment<caret> */
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
class MyTest {
|
||||
//simple end comment<caret>
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.siyeh.ipp.comment;
|
||||
|
||||
import com.siyeh.IntentionPowerPackBundle;
|
||||
import com.siyeh.ipp.IPPTestCase;
|
||||
|
||||
public class ChangeToEndOfLineCommentIntentionTest extends IPPTestCase {
|
||||
|
||||
public void testTrimLines() { doTest(); }
|
||||
|
||||
@Override
|
||||
protected String getIntentionName() {
|
||||
return IntentionPowerPackBundle.message("change.to.end.of.line.comment.intention.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRelativePath() {
|
||||
return "comment/to_end_of_line";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user