Skip to content

Commit

Permalink
fix api warning for annoations on Twig completion class
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed Jun 25, 2023
1 parent 7b786d1 commit dbfb974
Showing 1 changed file with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public TwigTemplateCompletionContributor() {
CompletionType.BASIC,
TwigPattern.getTranslationKeyPattern("trans", "transchoice"),
new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if (!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}
Expand All @@ -109,7 +109,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, ProcessingC
CompletionType.BASIC,
TwigPattern.getTransDomainPattern(),
new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if (!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}
Expand All @@ -134,7 +134,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, ProcessingC
TwigPattern.getTemplateImportFileReferenceTagPattern(),

new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {

PsiElement position = parameters.getPosition();
if (!Symfony2ProjectComponent.isEnabled(position)) {
Expand Down Expand Up @@ -269,7 +269,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, @NotNull Pr
CompletionType.BASIC,
TwigPattern.getVariableTypePattern(),
new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if (!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}
Expand Down Expand Up @@ -339,7 +339,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, ProcessingC
CompletionType.BASIC,
TwigPattern.getAutocompletableRoutePattern(),
new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if (!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}
Expand Down Expand Up @@ -434,7 +434,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, @NotNull Pr
CompletionType.BASIC,
TwigPattern.getPrintBlockOrTagFunctionPattern("constant"),
new CompletionProvider<>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
PsiElement position = parameters.getPosition();
if (!Symfony2ProjectComponent.isEnabled(position)) {
return;
Expand Down Expand Up @@ -584,15 +584,15 @@ private boolean isCompletionStartingRegexMatch(@RegExp String fullText, @NotNull
}

private static class FilterCompletionProvider extends CompletionProvider<CompletionParameters> {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if(!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}

// move this stuff to pattern fixed event stopping by phpstorm
PsiElement currElement = parameters.getPosition().getOriginalElement();
PsiElement prevElement = currElement.getPrevSibling();
if ((prevElement != null) && ((prevElement instanceof PsiWhiteSpace))) prevElement = prevElement.getPrevSibling();
if (((prevElement instanceof PsiWhiteSpace))) prevElement = prevElement.getPrevSibling();

if ((prevElement != null) && (prevElement.getNode().getElementType() == TwigTokenTypes.FILTER)) {
for(Map.Entry<String, TwigExtension> entry : TwigExtensionParser.getFilters(parameters.getPosition().getProject()).entrySet()) {
Expand All @@ -607,7 +607,7 @@ public void addCompletions(@NotNull CompletionParameters parameters, ProcessingC
*/
private static class TagTokenParserCompletionProvider extends CompletionProvider<CompletionParameters> {
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
PsiElement position = parameters.getPosition();
if(!Symfony2ProjectComponent.isEnabled(position)) {
return;
Expand All @@ -626,7 +626,7 @@ protected void addCompletions(@NotNull CompletionParameters parameters, Processi
}

private static class TranslationDomainCompletionProvider extends CompletionProvider<CompletionParameters> {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
if(!Symfony2ProjectComponent.isEnabled(parameters.getPosition())) {
return;
}
Expand Down Expand Up @@ -670,24 +670,23 @@ public void addCompletions(@NotNull CompletionParameters parameters, @NotNull Pr
}
}

private class FormThemeCompletionProvider extends CompletionProvider<CompletionParameters> {
private static class FormThemeCompletionProvider extends CompletionProvider<CompletionParameters> {
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
PsiElement psiElement = parameters.getOriginalPosition();

if(psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
if(!Symfony2ProjectComponent.isEnabled(psiElement)) {
return;
}

resultSet.addAllElements(TwigUtil.getTwigLookupElements(parameters.getPosition().getProject()));
}
}

private class TypeCompletionProvider extends CompletionProvider<CompletionParameters> {
private static class TypeCompletionProvider extends CompletionProvider<CompletionParameters> {
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext paramProcessingContext, @NotNull CompletionResultSet resultSet) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext paramProcessingContext, @NotNull CompletionResultSet resultSet) {
PsiElement psiElement = parameters.getOriginalPosition();
if(psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
if(!Symfony2ProjectComponent.isEnabled(psiElement)) {
return;
}

Expand Down Expand Up @@ -729,11 +728,11 @@ protected void addCompletions(@NotNull CompletionParameters parameters, Processi
}
}

private class PathParameterCompletionProvider extends CompletionProvider<CompletionParameters> {
private static class PathParameterCompletionProvider extends CompletionProvider<CompletionParameters> {
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext paramProcessingContext, @NotNull CompletionResultSet paramCompletionResultSet) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext paramProcessingContext, @NotNull CompletionResultSet paramCompletionResultSet) {
PsiElement psiElement = parameters.getOriginalPosition();
if(psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
if(!Symfony2ProjectComponent.isEnabled(psiElement)) {
return;
}

Expand Down Expand Up @@ -783,8 +782,8 @@ public void addCompletions(@NotNull CompletionParameters parameters,
}
}

private class BlockCompletionProvider extends CompletionProvider<CompletionParameters> {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
private static class BlockCompletionProvider extends CompletionProvider<CompletionParameters> {
public void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet resultSet) {
PsiElement position = parameters.getOriginalPosition();
if(!Symfony2ProjectComponent.isEnabled(position)) {
return;
Expand Down Expand Up @@ -814,9 +813,9 @@ public void addCompletions(@NotNull CompletionParameters parameters, ProcessingC
*/
private static class MyMacroImportAsCompletionProvider extends CompletionProvider<CompletionParameters> {
@Override
protected void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
protected void addCompletions(@NotNull CompletionParameters parameters, @NotNull ProcessingContext processingContext, @NotNull CompletionResultSet resultSet) {
PsiElement psiElement = parameters.getOriginalPosition();
if(psiElement == null || !Symfony2ProjectComponent.isEnabled(psiElement)) {
if (!Symfony2ProjectComponent.isEnabled(psiElement)) {
return;
}

Expand Down

0 comments on commit dbfb974

Please sign in to comment.