Skip to content

Commit 737587c

Browse files
author
wallaby.pouch
committed
exception fix
git-svn-id: http://bashsupport.googlecode.com/svn/trunk@110 91dd7c56-102c-11df-9f54-17e475596acb
1 parent 98e1640 commit 737587c

File tree

13 files changed

+152
-124
lines changed

13 files changed

+152
-124
lines changed

bashsupport/BashSupport.iml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<excludeFolder url="file://$MODULE_DIR$/generated_src" />
1919
<excludeFolder url="file://$MODULE_DIR$/javadoc" />
2020
</content>
21-
<orderEntry type="library" name="Clover IDEA Plugin" level="application" />
2221
<orderEntry type="inheritedJdk" />
2322
<orderEntry type="sourceFolder" forTests="false" />
2423
<orderEntry type="library" name="Google collections" level="project" />

bashsupport/BashSupport.iws

Lines changed: 138 additions & 107 deletions
Large diffs are not rendered by default.

bashsupport/Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2010-07-23:
2+
- Fixed exception which occured while adding a REPL console
3+
14
2010-07-22:
25
- Lexer improvements
36

bashsupport/src/com/ansorgit/plugins/bash/actions/AddReplAction.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright 2010 Joachim Ansorg, [email protected]
33
* File: AddReplAction.java, Class: AddReplAction
4-
* Last modified: 2010-06-03
4+
* Last modified: 2010-07-23
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -43,11 +43,13 @@ public AddReplAction() {
4343
@Override
4444
public void update(AnActionEvent e) {
4545
final Module m = getModule(e);
46+
4647
final Presentation presentation = e.getPresentation();
4748
if (m == null) {
4849
presentation.setEnabled(false);
4950
return;
5051
}
52+
5153
presentation.setEnabled(true);
5254

5355
super.update(e);
@@ -90,11 +92,13 @@ static Module getModule(AnActionEvent e) {
9092
break;
9193
}
9294
}
93-
if (module == null) {
95+
96+
if (module == null && modules.length > 0) {
9497
module = modules[0];
9598
}
9699
}
97100
}
101+
98102
return module;
99103
}
100104
}

bashsupport/src/com/ansorgit/plugins/bash/lang/parser/arithmetic/AbstractAssignment.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
package com.ansorgit.plugins.bash.lang.parser.arithmetic;
2020

2121
import com.ansorgit.plugins.bash.lang.parser.BashPsiBuilder;
22-
import com.ansorgit.plugins.bash.lang.parser.Parsing;
2322
import com.ansorgit.plugins.bash.lang.parser.util.ParserUtil;
24-
import com.ansorgit.plugins.bash.lang.psi.util.BashPsiUtils;
2523
import com.intellij.lang.PsiBuilder;
2624
import com.intellij.psi.tree.TokenSet;
2725

@@ -31,13 +29,11 @@
3129
* Time: 6:31:03 PM
3230
*/
3331
class AbstractAssignment implements ArithmeticParsingFunction {
34-
private String description;
3532
private final ArithmeticParsingFunction next;
3633
private final TokenSet acceptedEqualTokens;
3734
private TokenSet acceptedWords = TokenSet.create(WORD, ASSIGNMENT_WORD);
3835

39-
public AbstractAssignment(String description, ArithmeticParsingFunction next, TokenSet acceptedEqualTokens) {
40-
this.description = description;
36+
public AbstractAssignment(ArithmeticParsingFunction next, TokenSet acceptedEqualTokens) {
4137
this.next = next;
4238
this.acceptedEqualTokens = acceptedEqualTokens;
4339
}

bashsupport/src/com/ansorgit/plugins/bash/lang/parser/arithmetic/ArithmeticFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ private ArithmeticFactory() {
5050
private static ArithmeticParsingFunction logicalAnd = repeated(bitwiseOr, AND_AND, ARITH_LOGIC_AND_ELEMENT);
5151
private static ArithmeticParsingFunction logicalOr = repeated(logicalAnd, OR_OR, ARITH_LOGIC_OR_ELEMENT);
5252
private static TernaryExpression ternary = new TernaryExpression(logicalOr);
53-
private static ArithmeticParsingFunction simpleAssignment = new AbstractAssignment("simple assignment", ternary, TokenSet.create(EQ));
54-
private static ArithmeticParsingFunction assignmentCombination = new AbstractAssignment("assignment combination", simpleAssignment, arithmeticAssign);
53+
private static ArithmeticParsingFunction simpleAssignment = new AbstractAssignment(ternary, TokenSet.create(EQ));
54+
private static ArithmeticParsingFunction assignmentCombination = new AbstractAssignment(simpleAssignment, arithmeticAssign);
5555
private static ArithmeticParsingFunction assignmentChain = repeated(assignmentCombination, COMMA, ARITH_ASSIGNMENT_CHAIN_ELEMENT);
5656

5757
public static ArithmeticParsingFunction entryPoint() {

bashsupport/src/com/ansorgit/plugins/bash/lang/parser/arithmetic/ArithmeticParsingFunction.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818

1919
package com.ansorgit.plugins.bash.lang.parser.arithmetic;
2020

21-
import com.ansorgit.plugins.bash.lang.parser.BashPsiBuilder;
2221
import com.ansorgit.plugins.bash.lang.parser.ParsingFunction;
23-
import com.intellij.lang.PsiBuilder;
2422

2523
/**
2624
* Extended parsing function for parsing of arithmetic expressions.

bashsupport/src/com/ansorgit/plugins/bash/lang/parser/arithmetic/ParenExpr.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.ansorgit.plugins.bash.lang.parser.BashPsiBuilder;
2222
import com.ansorgit.plugins.bash.lang.parser.util.ParserUtil;
2323
import com.intellij.lang.PsiBuilder;
24-
import com.intellij.psi.tree.IElementType;
2524

2625
/**
2726
* Parses an optional parantheses expression. If not found it delegates to another function.

bashsupport/src/com/ansorgit/plugins/bash/lang/psi/impl/BashKeywordDefaultImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public boolean isReferenceTo(PsiElement element) {
9191
return element == this;
9292
}
9393

94+
@NotNull
9495
public Object[] getVariants() {
9596
return new Object[0];
9697
}

bashsupport/src/com/ansorgit/plugins/bash/lang/psi/impl/arithmetic/AssignmentChainImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import com.ansorgit.plugins.bash.lang.psi.api.arithmetic.ArithmeticExpression;
2222
import com.ansorgit.plugins.bash.lang.psi.api.arithmetic.AssignmentChain;
23-
import com.ansorgit.plugins.bash.lang.psi.api.arithmetic.AssignmentExpression;
2423
import com.intellij.lang.ASTNode;
2524
import com.intellij.psi.tree.IElementType;
2625

0 commit comments

Comments
 (0)