Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ Shortcut keys can be used for actions
- **Jump to Dao**
- Jump to action from SQL to Dao
- You can also jump to the Dao Method from the gutter icon that is displayed together.
- **Jump to Declaration**
- Jump to action from SQL bind variable to declaration location
- ex: Dao arguments, fields, method declaration

## Inspection
Check that bind variables are used appropriately for Dao and SQL associations.
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/domaframework/doma/intellij/Sql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
extends("el_invocation_expr_group|el_primary_expr")=el_factor_expr
extends("el_logical_expr_group|el_factor_expr")=el_term_expr
extends(".*expr")=el_expr
mixin("el_primary_expr|el_class")="org.domaframework.doma.intellij.psi.SqlCustomExprImpl"
consumeTokenMethod("literal|word|.*directive|.*expr")="consumeTokenFast"
}

Expand Down Expand Up @@ -166,5 +167,8 @@ el_parameters ::= "(" (el_expr ("," el_expr)*)? ")" {pin=1}
// primary
el_primary_expr ::= el_literal_expr | el_id_expr | el_paren_expr
private el_literal_expr ::= EL_NULL | BOOLEAN | (EL_PLUS | EL_MINUS)? EL_NUMBER | EL_STRING | EL_CHAR
private el_id_expr ::= EL_IDENTIFIER
el_id_expr ::= EL_IDENTIFIER
{
mixin="org.domaframework.doma.intellij.psi.SqlElPrimaryExprImpl"
}
private el_paren_expr ::= "(" el_expr ")" {pin=1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright Doma Tools Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.domaframework.doma.intellij.psi;

import com.intellij.psi.PsiElement;

public interface SqlCustomElExpr extends PsiElement {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright Doma Tools Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.domaframework.doma.intellij.psi;

import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiReference;
import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry;
import org.jetbrains.annotations.NotNull;

public class SqlCustomExprImpl extends ASTWrapperPsiElement implements SqlCustomElExpr {

public SqlCustomExprImpl(@NotNull ASTNode node) {
super(node);
}

@Override
public PsiReference @NotNull [] getReferences() {
return ReferenceProvidersRegistry.getReferencesFromProviders(this);
}
}
Loading
Loading