mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA should ignore word "grails" in begin of command.
This commit is contained in:
@@ -41,6 +41,8 @@ import java.util.List;
|
||||
|
||||
public class MvcRunTargetDialog extends DialogWrapper {
|
||||
|
||||
private static final String GRAILS_PREFIX = "grails ";
|
||||
|
||||
private JPanel contentPane;
|
||||
private JLabel myTargetLabel;
|
||||
private JPanel myFakePanel;
|
||||
@@ -109,6 +111,12 @@ public class MvcRunTargetDialog extends DialogWrapper {
|
||||
|
||||
public String[] getTargetArguments() {
|
||||
String text = getSelectedText();
|
||||
|
||||
text = text.trim();
|
||||
if (text.startsWith(GRAILS_PREFIX)) {
|
||||
text = text.substring(GRAILS_PREFIX.length());
|
||||
}
|
||||
|
||||
Iterable<String> iterable = StringUtil.tokenize(text, " ");
|
||||
ArrayList<String> args = new ArrayList<String>();
|
||||
for (String s : iterable) {
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class MvcTargetDialogCompletionUtils {
|
||||
|
||||
List<LookupElement> res = new ArrayList<LookupElement>();
|
||||
|
||||
if (text.substring(0, offset).matches("\\s*(?:(:?-\\S+|dev|prod|test)\\s+)*\\S*")) {
|
||||
if (text.substring(0, offset).matches("\\s*(grails\\s*)?(?:(:?-\\S+|dev|prod|test)\\s+)*\\S*")) {
|
||||
// Complete command name because command name is not typed.
|
||||
for (String completionVariant : getAllTargetNames(module)) {
|
||||
res.add(TailTypeDecorator.withTail(LookupElementBuilder.create(completionVariant), TailType.SPACE));
|
||||
|
||||
Reference in New Issue
Block a user