-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
False positive warning "Function ... is never used" #214 : adjust gra…
…mmar to introduce string mixin
- Loading branch information
Showing
7 changed files
with
50 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package intellij_awk.psi; | ||
|
||
import com.intellij.lang.ASTNode; | ||
import com.intellij.openapi.util.TextRange; | ||
import com.intellij.psi.PsiElement; | ||
import com.intellij.psi.PsiReference; | ||
import intellij_awk.AwkReferenceFunction; | ||
import javax.swing.*; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public abstract class AwkStringMixin extends AwkNamedElementImpl { | ||
public AwkStringMixin(@NotNull ASTNode node) { | ||
super(node); | ||
} | ||
|
||
public PsiElement setName(String newName) { | ||
return replaceNameNode(AwkElementFactory.createFunctionCallName(getProject(), newName)); | ||
} | ||
|
||
@Override | ||
public PsiReference getReference() { | ||
// return new AwkReferenceFunction(this, getNameTextRange()); | ||
return new AwkReferenceFunction(this, TextRange.from(1, getTextLength()-2)); | ||
// return null; | ||
} | ||
|
||
@Override | ||
public @Nullable Icon getIcon(int flags) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters