From c653a55bb9da5bb875d2a36a7bc2d0fe619a51aa Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:51:43 +0100 Subject: [PATCH 01/20] [CFML] catch for uncaught null pointer exception --- .../intellij/coldFusion/injection/CfqueryEscaper.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CFML/src/com/intellij/coldFusion/injection/CfqueryEscaper.kt b/CFML/src/com/intellij/coldFusion/injection/CfqueryEscaper.kt index baa3db85221..90af2d03dd8 100644 --- a/CFML/src/com/intellij/coldFusion/injection/CfqueryEscaper.kt +++ b/CFML/src/com/intellij/coldFusion/injection/CfqueryEscaper.kt @@ -18,10 +18,14 @@ class CfqueryEscaper(tag: CfmlTagImpl) : LiteralTextEscaper(tag) { //exclude cfquery tags from TextRange override fun getRelevantTextRange(): TextRange { - val startOffset = Regex("]*>").find(myHost.text)!!.range.endInclusive + 1 - val closeTagOffset = Regex("]*>").find(myHost.text) ?: return TextRange(startOffset, startOffset) - val endOffset = closeTagOffset.range.start - return TextRange(startOffset, endOffset) + try { + val startOffset = Regex("]*>").find(myHost.text)!!.range.endInclusive + 1 + val closeTagOffset = Regex("]*>").find(myHost.text) ?: return TextRange(startOffset, startOffset) + val endOffset = closeTagOffset.range.start + return TextRange(startOffset, endOffset) + } catch (e: KotlinNullPointerException) { + return TextRange(0, 0) + } } } \ No newline at end of file From f18bee4bbdba9671ba0055ab33d8a0068c4ca90d Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:51:59 +0100 Subject: [PATCH 02/20] [CFML] version and project info adjustment --- CFML/CFML-plugin.iml | 6 +++--- CFML/resources/META-INF/plugin.xml | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CFML/CFML-plugin.iml b/CFML/CFML-plugin.iml index 00d76084934..15df663f097 100644 --- a/CFML/CFML-plugin.iml +++ b/CFML/CFML-plugin.iml @@ -1,16 +1,16 @@ - + + - - + \ No newline at end of file diff --git a/CFML/resources/META-INF/plugin.xml b/CFML/resources/META-INF/plugin.xml index bd2287157b6..d39edb9161a 100644 --- a/CFML/resources/META-INF/plugin.xml +++ b/CFML/resources/META-INF/plugin.xml @@ -1,6 +1,7 @@ CFML Support CFML + 2019.3.0-BETA Settings / Preferences dialog and se com.intellij.modules.java com.intellij.modules.ultimate com.intellij.modules.idea.ultimate + + + Date: Fri, 3 Jan 2020 15:52:21 +0100 Subject: [PATCH 03/20] [CFML] implemented documentation lookup for cfcs For components and functions defined in cfml instead of cfscript: Quick documentation now shows the actual cfc and cfc-method documentation instead of the documentation for the cfcomponent or cffunction tag --- .../coldFusion/UI/CfmlLookUpItemUtil.java | 7 ++- .../editorActions/CfmlDocumentProvider.java | 14 +++++- .../CfmlParameterInfoHandler.java | 4 +- .../intellij/coldFusion/model/CfmlDocUtil.kt | 49 ++++++++++++++++++- .../intellij/coldFusion/model/CfmlUtil.java | 10 ++++ .../model/info/CfmlFunctionDescription.java | 12 ++++- .../info/CfmlTagsDescriptionsParser.java | 3 +- .../coldFusion/model/psi/CfmlComponent.java | 3 ++ .../coldFusion/model/psi/CfmlFunction.java | 3 ++ .../coldFusion/model/psi/CfmlParameter.java | 6 +++ .../model/psi/impl/CfmlComponentImpl.java | 7 +++ .../model/psi/impl/CfmlFunctionImpl.java | 13 +++++ .../psi/impl/CfmlFunctionParameterImpl.java | 20 +++++++- .../model/psi/impl/CfmlTagComponentImpl.java | 6 +++ .../model/psi/impl/CfmlTagFunctionImpl.java | 6 +++ .../impl/CfmlTagFunctionParameterImpl.java | 17 ++++++- 16 files changed, 172 insertions(+), 8 deletions(-) diff --git a/CFML/src/com/intellij/coldFusion/UI/CfmlLookUpItemUtil.java b/CFML/src/com/intellij/coldFusion/UI/CfmlLookUpItemUtil.java index 85272c185d6..2d6b57a0002 100755 --- a/CFML/src/com/intellij/coldFusion/UI/CfmlLookUpItemUtil.java +++ b/CFML/src/com/intellij/coldFusion/UI/CfmlLookUpItemUtil.java @@ -132,9 +132,14 @@ public static CfmlFunctionDescription getFunctionDescription(CfmlFunction functi PsiType returnType = function.getReturnType(); CfmlFunctionDescription functionInfo = new CfmlFunctionDescription(function.getName(), returnType != null ? returnType.getCanonicalText() : null); + + functionInfo.setDescription(function.getDescription()); CfmlParameter[] params = function.getParameters(); for (CfmlParameter param : params) { - functionInfo.addParameter(new CfmlFunctionDescription.CfmlParameterDescription(param.getName(), param.getType(), param.isRequired())); + CfmlFunctionDescription.CfmlParameterDescription description = + new CfmlFunctionDescription.CfmlParameterDescription(param.getName(), param.getType(), param.getDefault(), param.isRequired()); + description.setDescription(param.getDescription()); + functionInfo.addParameter(description); } return functionInfo; } diff --git a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlDocumentProvider.java b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlDocumentProvider.java index 7c866600d4e..d983f0a69f6 100644 --- a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlDocumentProvider.java +++ b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlDocumentProvider.java @@ -2,6 +2,8 @@ package com.intellij.coldFusion.UI.editorActions; import com.intellij.coldFusion.model.CfmlUtil; +import com.intellij.coldFusion.model.psi.CfmlComponent; +import com.intellij.coldFusion.model.psi.CfmlFunction; import com.intellij.coldFusion.model.psi.CfmlTag; import com.intellij.coldFusion.model.psi.impl.CfmlAttributeImpl; import com.intellij.coldFusion.model.psi.impl.CfmlAttributeNameImpl; @@ -21,7 +23,17 @@ public class CfmlDocumentProvider extends DocumentationProviderEx { @Override public String generateDoc(PsiElement element, PsiElement originalElement) { - if (element instanceof CfmlAttributeImpl && element.getParent() instanceof CfmlTag) { + if (element instanceof CfmlComponent) { + return CfmlUtil.getComponentDescription((CfmlComponent)element, element.getProject()); + } + else if (element instanceof CfmlFunction) { + try{ + return CfmlUtil.getFunctionDescription((CfmlFunction)element, element.getProject()); + } catch (Exception e) { + System.err.println("error"); + } + } + else if (element instanceof CfmlAttributeImpl && element.getParent() instanceof CfmlTag) { String tagName = StringUtil.toLowerCase(((CfmlTag)element.getParent()).getTagName()); String attributeName = (element instanceof CfmlAttributeNameImpl) ? "name" : diff --git a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlParameterInfoHandler.java b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlParameterInfoHandler.java index 3f5912dec83..848dd31f440 100755 --- a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlParameterInfoHandler.java +++ b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmlParameterInfoHandler.java @@ -114,9 +114,11 @@ else if (element1 instanceof PsiMethod) { new CfmlFunctionDescription(function.getName(), function.getReturnType().getPresentableText()); final PsiParameter[] psiParameters = function.getParameterList().getParameters(); for (PsiParameter psiParameter : psiParameters) { + PsiExpression initializerElement = psiParameter.getInitializer(); + String initializerValue = initializerElement == null ? null : initializerElement.getText(); javaMethodDescr.addParameter(new CfmlFunctionDescription.CfmlParameterDescription(psiParameter.getName(), psiParameter.getType() - .getPresentableText(), true)); + .getPresentableText(), initializerValue, true)); } return javaMethodDescr; } diff --git a/CFML/src/com/intellij/coldFusion/model/CfmlDocUtil.kt b/CFML/src/com/intellij/coldFusion/model/CfmlDocUtil.kt index f52a6eb0525..5aa06526c80 100644 --- a/CFML/src/com/intellij/coldFusion/model/CfmlDocUtil.kt +++ b/CFML/src/com/intellij/coldFusion/model/CfmlDocUtil.kt @@ -1,15 +1,17 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.coldFusion.model -import com.intellij.coldFusion.model.CfmlDocUtil.bold import com.intellij.coldFusion.model.CfmlUtil.getCfmlLangInfo import com.intellij.coldFusion.model.info.CfmlAttributeDescription import com.intellij.coldFusion.model.info.CfmlLangInfo import com.intellij.coldFusion.model.info.CfmlTagDescription import com.intellij.coldFusion.model.info.CfmlTypesInfo +import com.intellij.coldFusion.model.psi.CfmlComponent +import com.intellij.coldFusion.model.psi.CfmlFunction import com.intellij.openapi.project.Project import com.intellij.util.containers.isNullOrEmpty import com.intellij.xml.util.XmlStringUtil +import java.util.* object CfmlDocUtil { @@ -117,4 +119,49 @@ object CfmlDocUtil { return "$this" } + private fun String.faint(): String { + return "$this" + } + + @JvmStatic + fun componentDescription(component: CfmlComponent, project: Project): String { + var description = p { (component.name ?: "Unknown component name").bold() } + + val hintDescription = component.description + if (hintDescription != null) { + description += p { hintDescription } + } + + val init = Arrays.stream(component.getFunctionsWithSupers(false)).filter { f: CfmlFunction -> f.name == "init" } + .findFirst() + if (init.isPresent) { + description += "

" + functionDescription(init.get(), project) + } + return description + } + + @JvmStatic + fun functionDescription(function: CfmlFunction, project: Project): String { + val info = function.functionInfo + var paramsLabel = "Params: ".faint() + return p { + info.name.trim().bold() + if (info.parameters.isEmpty()) "()" else "(...)" + " : " + (info.returnType ?: "any") + } + p { + info.description?.trim() ?: "" + } + table { + info.parameters.map { + tr { + td { + paramsLabel + } + td { + paramsLabel = "" + it.presetableText.bold() + " " + } + td { + it.description?.trim() ?: "" + } + } + }.joinToString("") + } + } + } \ No newline at end of file diff --git a/CFML/src/com/intellij/coldFusion/model/CfmlUtil.java b/CFML/src/com/intellij/coldFusion/model/CfmlUtil.java index 8db2e7a6fef..d419dece412 100644 --- a/CFML/src/com/intellij/coldFusion/model/CfmlUtil.java +++ b/CFML/src/com/intellij/coldFusion/model/CfmlUtil.java @@ -8,6 +8,8 @@ import com.intellij.coldFusion.model.lexer.CfmlTokenTypes; import com.intellij.coldFusion.model.lexer.CfscriptTokenTypes; import com.intellij.coldFusion.model.parsers.CfmlKeywords; +import com.intellij.coldFusion.model.psi.CfmlComponent; +import com.intellij.coldFusion.model.psi.CfmlFunction; import com.intellij.coldFusion.model.psi.CfmlImport; import com.intellij.coldFusion.model.psi.CfmlReferenceExpression; import com.intellij.coldFusion.model.psi.impl.CfmlTagImpl; @@ -167,6 +169,14 @@ public static boolean isEndTagRequired(String tagName, Project project) { return getCfmlLangInfo(project).getTagAttributes().get(tagName).isEndTagRequired(); } + public static String getComponentDescription(CfmlComponent component, Project project) { + return CfmlDocUtil.componentDescription(component, project); + } + + public static String getFunctionDescription(CfmlFunction function, Project project) { + return CfmlDocUtil.functionDescription(function, project); + } + public static String getTagDescription(String tagName, Project project) { return CfmlDocUtil.tagDescription(tagName, project); } diff --git a/CFML/src/com/intellij/coldFusion/model/info/CfmlFunctionDescription.java b/CFML/src/com/intellij/coldFusion/model/info/CfmlFunctionDescription.java index 6b1d9b313c4..14e88180cdb 100755 --- a/CFML/src/com/intellij/coldFusion/model/info/CfmlFunctionDescription.java +++ b/CFML/src/com/intellij/coldFusion/model/info/CfmlFunctionDescription.java @@ -59,12 +59,14 @@ public void setDescription(String description) { public static class CfmlParameterDescription { private final String myName; private final String myType; + private final String myDefault; private final boolean myIsRequired; private String myDescription; - public CfmlParameterDescription(String name, String type, boolean isRequired) { + public CfmlParameterDescription(String name, String type, String defaultValue, boolean isRequired) { myName = name; myType = type; + myDefault = defaultValue; myIsRequired = isRequired; } @@ -75,6 +77,10 @@ public String getName() { public String getType() { return myType; } + + public String getDefault() { + return myDefault; + } public boolean isRequired() { return myIsRequired; @@ -95,6 +101,10 @@ public String getPresetableText() { if (type != null) { paramDescription = paramDescription + " : " + type; } + final String defaultValue = getDefault(); + if (defaultValue != null) { + paramDescription = paramDescription + " = \"" + defaultValue + "\""; + } if (!isRequired()) { sb.append("["); sb.append(paramDescription); diff --git a/CFML/src/com/intellij/coldFusion/model/info/CfmlTagsDescriptionsParser.java b/CFML/src/com/intellij/coldFusion/model/info/CfmlTagsDescriptionsParser.java index 993c319baab..9970378e2c3 100644 --- a/CFML/src/com/intellij/coldFusion/model/info/CfmlTagsDescriptionsParser.java +++ b/CFML/src/com/intellij/coldFusion/model/info/CfmlTagsDescriptionsParser.java @@ -135,9 +135,10 @@ else if (myState == FUNCTION_STATE) { else if (localName.equals("parameter") && myCurrentFunction != null) { String aName = attr.getValue("name"); String aType = attr.getValue("type"); + String aDefault = attr.getValue("default"); boolean aRequired = Boolean.valueOf(attr.getValue("required")); - myCurrentFunction.addParameter(new CfmlFunctionDescription.CfmlParameterDescription(aName, aType, aRequired)); + myCurrentFunction.addParameter(new CfmlFunctionDescription.CfmlParameterDescription(aName, aType, aDefault, aRequired)); } else if (localName.equals("help")) { myIsFunctionHelpSection = true; diff --git a/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponent.java b/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponent.java index a6cc2bc150b..384459148af 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponent.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponent.java @@ -24,6 +24,9 @@ public interface CfmlComponent extends CfmlPsiElement, CfmlNamedElement { CfmlComponent[] EMPTY_ARRAY = new CfmlComponent[0]; + @Nullable + String getDescription(); + @NotNull CfmlFunction[] getFunctions(); diff --git a/CFML/src/com/intellij/coldFusion/model/psi/CfmlFunction.java b/CFML/src/com/intellij/coldFusion/model/psi/CfmlFunction.java index e1b66c61d13..9a845f88183 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/CfmlFunction.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/CfmlFunction.java @@ -18,6 +18,9 @@ public interface CfmlFunction extends PsiNameIdentifierOwner { @Nullable PsiType getReturnType(); + + @Nullable + String getDescription(); @Override @NotNull diff --git a/CFML/src/com/intellij/coldFusion/model/psi/CfmlParameter.java b/CFML/src/com/intellij/coldFusion/model/psi/CfmlParameter.java index af54a01dc56..f521cf26d7b 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/CfmlParameter.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/CfmlParameter.java @@ -11,9 +11,15 @@ public interface CfmlParameter extends PsiElement, PsiNamedElement { @Nullable String getType(); + + @Nullable + String getDefault(); @Override @Nullable @NonNls String getName(); + + @Nullable + String getDescription(); } diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlComponentImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlComponentImpl.java index 4da5fdfa142..3914c3eed1e 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlComponentImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlComponentImpl.java @@ -16,6 +16,7 @@ import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * @author vnikolaenko @@ -42,6 +43,12 @@ public String getName() { return ""; } + @Nullable + @Override + public String getDescription() { + return null; + } + @Override @NotNull public CfmlFunction[] getFunctions() { diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionImpl.java index 13e31a4b39f..0b070e22c18 100644 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionImpl.java @@ -85,6 +85,19 @@ public PsiType getReturnType() { new CfmlComponentType(type.getText(), getContainingFile(), getProject()) : null; } + @Nullable + @Override + public String getDescription() { + PsiElement previousSibling = getPrevSibling(); + while (previousSibling instanceof PsiWhiteSpace) { + previousSibling = previousSibling.getPrevSibling(); + } + if (!(previousSibling instanceof PsiComment)) { + return null; + } + return previousSibling.getText(); + } + @Override public Icon getIcon(int flags) { return PlatformIcons.METHOD_ICON; diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionParameterImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionParameterImpl.java index b1b77f7bec6..f465a224d74 100644 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionParameterImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlFunctionParameterImpl.java @@ -5,6 +5,7 @@ import com.intellij.coldFusion.model.CfmlScopesInfo; import com.intellij.coldFusion.model.lexer.CfscriptTokenTypes; import com.intellij.coldFusion.model.parsers.CfmlElementTypes; +import com.intellij.coldFusion.model.psi.CfmlComponentType; import com.intellij.coldFusion.model.psi.CfmlCompositeElement; import com.intellij.coldFusion.model.psi.CfmlParameter; import com.intellij.coldFusion.model.psi.CfmlVariable; @@ -14,6 +15,7 @@ import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * @author vnikolaenko @@ -32,7 +34,9 @@ public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperatio @Override public PsiType getPsiType() { - return null; + final String returnTypeString = this.getType(); + return returnTypeString != null ? + new CfmlComponentType(returnTypeString, getContainingFile(), getProject()) : null; } @NotNull @@ -45,6 +49,12 @@ public String getName() { return ""; } + @Nullable + @Override + public String getDescription() { + return null; + } + @Override public boolean isRequired() { final PsiElement element = findChildByType(CfscriptTokenTypes.REQUIRED_KEYWORD); @@ -59,6 +69,14 @@ public String getType() { } return null; } + + public String getDefault() { + final PsiElement defaultElement = findChildByType(CfmlElementTypes.VALUE); + if (defaultElement != null) { + return defaultElement.getText(); + } + return null; + } @Override public int getProvidedScope() { diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagComponentImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagComponentImpl.java index 4c2b7f69c69..ee16b49601b 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagComponentImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagComponentImpl.java @@ -35,6 +35,12 @@ public String getName() { return !StringUtil.isEmpty(nameFromFile) ? nameFromFile : (name != null ? name : ""); } + @Nullable + @Override + public String getDescription() { + return CfmlPsiUtil.getPureAttributeValue(this, "hint"); + } + @Override public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException { return null; diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionImpl.java index 50b0add55ad..4fe9493869d 100644 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionImpl.java @@ -44,6 +44,12 @@ public PsiType getReturnType() { new CfmlComponentType(returnTypeString, getContainingFile(), getProject()) : null; } + @Override + @Nullable + public String getDescription() { + return CfmlPsiUtil.getPureAttributeValue(this, "hint"); + } + @Override public Icon getIcon(int flags) { String access = CfmlPsiUtil.getPureAttributeValue(this, "access"); diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionParameterImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionParameterImpl.java index 53dcf427cae..add8e3d83e3 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionParameterImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagFunctionParameterImpl.java @@ -2,6 +2,7 @@ package com.intellij.coldFusion.model.psi.impl; import com.intellij.coldFusion.model.CfmlScopesInfo; +import com.intellij.coldFusion.model.psi.CfmlComponentType; import com.intellij.coldFusion.model.psi.CfmlParameter; import com.intellij.coldFusion.model.psi.CfmlPsiUtil; import com.intellij.coldFusion.model.psi.CfmlVariable; @@ -15,6 +16,7 @@ import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class CfmlTagFunctionParameterImpl extends CfmlTagImpl implements CfmlParameter, CfmlVariable { public final static String TAG_NAME = "cfargument"; @@ -43,6 +45,12 @@ public String getName() { return ""; } + @Nullable + @Override + public String getDescription() { + return CfmlPsiUtil.getPureAttributeValue(this, "hint"); + } + @Override public boolean isRequired() { String requiredAttr = CfmlPsiUtil.getPureAttributeValue(this, "required"); @@ -57,6 +65,11 @@ public boolean isRequired() { public String getType() { return CfmlPsiUtil.getPureAttributeValue(this, "type"); } + + @Override + public String getDefault() { + return CfmlPsiUtil.getPureAttributeValue(this, "default"); + } @Override public int getProvidedScope() { @@ -97,7 +110,9 @@ public boolean processDeclarations(@NotNull PsiScopeProcessor processor, @Override public PsiType getPsiType() { - return null; + final String returnTypeString = this.getType(); + return returnTypeString != null ? + new CfmlComponentType(returnTypeString, getContainingFile(), getProject()) : null; } @Override From 1466755fad81e644cd656858a44c942adef8e254 Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:52:43 +0100 Subject: [PATCH 04/20] [CFML] fix: new expression followed by method call a new expression directly followed by a function call is no longer falsely marked as a syntax error --- .../model/parsers/CfmlExpressionParser.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java index 27a5189f69d..ffdba6eb76a 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java @@ -643,11 +643,31 @@ else if (getTokenType() == CfscriptTokenTypes.IDENTIFIER) { parseComponentReference(); } else { - myBuilder.error(CfmlBundle.message("cfml.parsing.identifier.expected")); + newExpression.rollbackTo(); + return false; } parseArgumentsList(); constructorCall.done(CfmlElementTypes.COMPONENT_CONSTRUCTOR_CALL); newExpression.done(CfmlElementTypes.NEW_EXPRESSION); + while (getTokenType() == POINT) { + PsiBuilder.Marker expr = newExpression.precede(); + advance(); + if (getTokenType() == IDENTIFIER) { + advance(); + if (getTokenType() == L_BRACKET) { + expr.done(CfmlElementTypes.REFERENCE_EXPRESSION); + PsiBuilder.Marker functionExpr = expr.precede(); + if (!parseArgumentsList()) { + expr.rollbackTo(); + break; + } + functionExpr.done(CfmlElementTypes.FUNCTION_CALL_EXPRESSION); + } + } else { + expr.rollbackTo(); + break; + } + } return true; } From b539152a29389d49d8e3b50b7025dbe452d21d00 Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:53:06 +0100 Subject: [PATCH 05/20] [CFML] added support for wildcard imports --- .../model/parsers/CfmlExpressionParser.java | 11 ++++- .../model/psi/CfmlComponentReference.java | 15 +++++-- .../model/psi/impl/CfmlImportImpl.java | 19 ++++++-- .../model/psi/impl/CfmlScriptImportImpl.java | 43 ++++++++++++++----- 4 files changed, 68 insertions(+), 20 deletions(-) diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java index ffdba6eb76a..278d31a29b0 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlExpressionParser.java @@ -18,10 +18,13 @@ import com.intellij.coldFusion.CfmlBundle; import com.intellij.coldFusion.model.lexer.CfmlTokenTypes; import com.intellij.coldFusion.model.lexer.CfscriptTokenTypes; +import com.intellij.coldFusion.model.psi.CfmlElementType; import com.intellij.lang.PsiBuilder; import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.Nullable; +import java.util.Objects; + import static com.intellij.coldFusion.model.lexer.CfscriptTokenTypes.*; /** @@ -100,7 +103,8 @@ public boolean parseExpression() { return true; } expr.done(CfmlElementTypes.TERNARY_EXPRESSION); - } else if (myBuilder.getTokenType() == ELVIS) { + } + else if (myBuilder.getTokenType() == ELVIS) { advance(); if (!parseExpression()) { myBuilder.error(CfmlBundle.message("cfml.parsing.expression.expected")); @@ -445,6 +449,9 @@ public void parseComponentReference() { } myBuilder.advanceLexer(); } + if (myBuilder.getTokenType() == MUL) { + myBuilder.advanceLexer(); + } componentReferenceMarker.done(CfmlElementTypes.COMPONENT_REFERENCE); } @@ -619,7 +626,7 @@ else if (parseRValue()) { */ private void parseAssignsList() { - while(true) { + while (true) { parseAssignmentExpression(true); if (getTokenType() != COMMA) break; advance(); diff --git a/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponentReference.java b/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponentReference.java index d3d72f02d15..0250f90c65f 100755 --- a/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponentReference.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/CfmlComponentReference.java @@ -122,8 +122,8 @@ public static Collection resolveFromQualifiedName(String componen // PsiFile containingFile = getContainingFile(); // containingFile = containingFile == null ? null : containingFile.getOriginalFile(); { - CfmlFile cfmlConteiningFile = originalFile; - PsiDirectory directory = cfmlConteiningFile.getParent(); + CfmlFile cfmlContainingFile = originalFile; + PsiDirectory directory = cfmlContainingFile.getParent(); if (directory != null) { GlobalSearchScope searchScope = GlobalSearchScopesCore.directoryScope(directory, false); @@ -166,6 +166,15 @@ public static Collection resolveFromQualifiedName(String componen components.addAll(CfmlIndex.getInstance(project).getInterfacesByName( componentName)); + if (componentName.equals("*")) { + for (String name : CfmlIndex.getInstance(project).getAllComponentsNames()) { + components.addAll(CfmlIndex.getInstance(project).getComponentsByName(name)); + } + for (String name : CfmlIndex.getInstance(project).getAllInterfaceNames()) { + components.addAll(CfmlIndex.getInstance(project).getInterfacesByName(name)); + } + } + for (CfmlComponent component : components) { PsiDirectory parent = component.getContainingFile().getParent(); if (parent == null) { @@ -333,7 +342,7 @@ public Object[] getVariants() { public static Object[] buildVariants(String text, PsiFile containingFile, final Project project, @Nullable CfmlComponentReference reference, final boolean forceQualify - ) { + ) { Collection variants = new THashSet<>(); String directoryName = ""; diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlImportImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlImportImpl.java index 5e181dbc8a5..8f3a6448397 100644 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlImportImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlImportImpl.java @@ -39,8 +39,16 @@ public boolean isImported(String componentName) { @Override public String getImportString() { + String retval = null; PsiElement taglib = getAttributeValueElement("taglib"); - return taglib != null ? taglib.getText() : null; + if (taglib != null) { + retval = taglib.getText(); + } + PsiElement path = getAttributeValueElement("path"); + if (path != null) { + retval = path.getText(); + } + return retval; } @Override @@ -52,9 +60,12 @@ public String getPrefix() { @NotNull @Override public PsiReference[] getReferences() { - PsiElement taglib = getAttributeValueElement("taglib"); - if (taglib != null) { - return new PsiReference[]{new CfmlComponentReference(taglib.getNode(), this)}; + PsiElement valueNode = getAttributeValueElement("taglib"); + if (valueNode != null) { + valueNode = getAttributeValueElement("path"); + } + if (valueNode != null) { + return new PsiReference[]{new CfmlComponentReference(valueNode.getNode(), this)}; } return super.getReferences(); } diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlScriptImportImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlScriptImportImpl.java index 59b4df39d56..78ddcb65518 100644 --- a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlScriptImportImpl.java +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlScriptImportImpl.java @@ -15,13 +15,17 @@ */ package com.intellij.coldFusion.model.psi.impl; -import com.intellij.coldFusion.model.psi.CfmlCompositeElement; -import com.intellij.coldFusion.model.psi.CfmlImport; -import com.intellij.coldFusion.model.psi.CfmlStringLiteralExpression; +import com.intellij.coldFusion.model.parsers.CfmlElementTypes; +import com.intellij.coldFusion.model.psi.*; import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; +import com.intellij.psi.ResolveResult; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Objects; + /** * @author vnikolaenko * @date 16.02.11 @@ -34,15 +38,34 @@ public CfmlScriptImportImpl(@NotNull ASTNode node) { @Override public boolean isImported(String componentName) { String importString = getImportString(); - return importString != null ? importString.endsWith(componentName) : false; + if (importString == null) return false; + if (importString.endsWith(componentName)) return true; + if (importString.endsWith("*")) { + PsiReference[] references = getReferences(); + for (PsiReference reference : references) { + if (!(reference instanceof CfmlComponentReference)) { + continue; + } + ResolveResult[] results = ((CfmlComponentReference)reference).multiResolve(false); + for (ResolveResult result : results) { + PsiElement element = result.getElement(); + if (element instanceof CfmlComponent) { + if (Objects.equals(((CfmlComponent)element).getName(), componentName)) { + return true; + } + } + } + } + } + return false; } @Override @Nullable public String getImportString() { - CfmlStringLiteralExpression childByType = findChildByClass(CfmlStringLiteralExpression.class); - if (childByType != null) { - return childByType.getValue(); + CfmlComponentReference referenceChild = findChildByType(CfmlElementTypes.COMPONENT_REFERENCE); + if (referenceChild != null) { + return referenceChild.getText(); } return null; } @@ -52,15 +75,13 @@ public String getPrefix() { return null; } - /* @NotNull @Override public PsiReference[] getReferences() { - PsiElement reference = findChildByType(CfscriptElementTypes.COMPONENT_REFERENCE); + PsiElement reference = findChildByType(CfmlElementTypes.COMPONENT_REFERENCE); if (reference != null) { - return new PsiReference[]{new CfmlComponentReference( reference.getNode(), this)}; + return new PsiReference[]{new CfmlComponentReference(reference.getNode(), this)}; } return super.getReferences(); } - */ } From 817a5dddf2e22063690ebb32dd52840e8eab8c84 Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:53:25 +0100 Subject: [PATCH 06/20] [CFML] fix: type definition as string when parsing types, values enclosed in quotes are now accepted --- .../model/parsers/CfscriptParser.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java index 11a4e6d5f33..57c7ec4475e 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java @@ -635,6 +635,26 @@ private static boolean parseType(PsiBuilder myBuilder) { typeMarker.done(CfmlElementTypes.TYPE); } else { + if (STRING_ELEMENTS.contains(myBuilder.getTokenType())) { + final PsiBuilder.Marker stringMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + if (myBuilder.getTokenType() != STRING_TEXT) { + stringMarker.rollbackTo(); + myBuilder.error(CfmlBundle.message("cfml.parsing.string.expected")); + return false; + } + final PsiBuilder.Marker typeMarker = myBuilder.mark(); + myBuilder.advanceLexer(); + typeMarker.done(CfmlElementTypes.TYPE); + if (!STRING_ELEMENTS.contains(myBuilder.getTokenType())) { + stringMarker.rollbackTo(); + myBuilder.error(CfmlBundle.message("cfml.parsing.string.expected")); + return false; + } + myBuilder.advanceLexer(); + stringMarker.done(CfmlElementTypes.STRING_LITERAL); + return true; + } if (myBuilder.getTokenType() != IDENTIFIER) { myBuilder.error(CfmlBundle.message("cfml.parsing.type.expected")); return false; From 3d532ef241407f310d289beb171a216335828c5a Mon Sep 17 00:00:00 2001 From: adventurous-gerbil Date: Fri, 3 Jan 2020 15:53:43 +0100 Subject: [PATCH 07/20] [CFML] fix: keywords as variable names keywords used as variable names are no longer falsely marked as a syntax error in certain places --- .../intellij/coldFusion/model/parsers/CfscriptParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java index 57c7ec4475e..c541a00323f 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfscriptParser.java @@ -24,6 +24,7 @@ import java.util.Objects; +import static com.intellij.coldFusion.model.lexer.CfmlTokenTypes.*; import static com.intellij.coldFusion.model.lexer.CfscriptTokenTypes.*; import static com.intellij.coldFusion.model.parsers.CfmlKeywordsKt.isKeyword; import static com.intellij.coldFusion.model.parsers.CfmlKeywordsKt.parseKeyword; @@ -444,14 +445,14 @@ private void parseParametersList(PsiBuilder myBuilder) { } // try to parse type final PsiBuilder.Marker marker = myBuilder.mark(); - if (!parseType(myBuilder) || myBuilder.getTokenType() != IDENTIFIER) { + if (!parseType(myBuilder) || (myBuilder.getTokenType() != IDENTIFIER && !KEYWORDS.contains(myBuilder.getTokenType()))) { marker.rollbackTo(); } else { marker.drop(); } // parse parameter name - if (myBuilder.getTokenType() == IDENTIFIER) { + if (myBuilder.getTokenType() == IDENTIFIER || KEYWORDS.contains(myBuilder.getTokenType())) { myBuilder.advanceLexer(); if (myBuilder.getTokenType() == CfmlTokenTypes.ASSIGN) { // parse default value From 17356f6b917097c10e3a650a469022a23d9e738e Mon Sep 17 00:00:00 2001 From: Adventurous Gerbil Date: Fri, 10 Jan 2020 11:29:42 +0100 Subject: [PATCH 08/20] [CFML] implementation implemented the tag as an assignment-type statement (with type assignment to a variable) --- .../CfmllFindUsagesProvider.java | 1 + ...CfmlAttributeValuesCompletionProvider.java | 1 + .../model/parsers/CfmlElementTypes.java | 6 + .../coldFusion/model/parsers/CfmlParser.java | 4 + .../model/psi/impl/CfmlTagParamImpl.java | 139 ++++++++++++++++++ 5 files changed, 151 insertions(+) create mode 100644 CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagParamImpl.java diff --git a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmllFindUsagesProvider.java b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmllFindUsagesProvider.java index b5386ae5b94..c569be3c845 100644 --- a/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmllFindUsagesProvider.java +++ b/CFML/src/com/intellij/coldFusion/UI/editorActions/CfmllFindUsagesProvider.java @@ -19,6 +19,7 @@ public class CfmllFindUsagesProvider implements FindUsagesProvider { public boolean canFindUsagesFor(@NotNull final PsiElement psiElement) { return psiElement instanceof CfmlReferenceExpression || (psiElement instanceof CfmlTagFunctionImpl) || (psiElement instanceof CfmlTag && ((CfmlTag)psiElement).getTagName().equalsIgnoreCase("cfargument")) || + (psiElement instanceof CfmlTag && ((CfmlTag)psiElement).getTagName().equalsIgnoreCase("cfparam")) || psiElement instanceof CfmlFunctionImpl || psiElement instanceof CfmlFunctionParameterImpl; } diff --git a/CFML/src/com/intellij/coldFusion/UI/editorActions/completionProviders/CfmlAttributeValuesCompletionProvider.java b/CFML/src/com/intellij/coldFusion/UI/editorActions/completionProviders/CfmlAttributeValuesCompletionProvider.java index 852c113ae54..9c78aa9cf20 100644 --- a/CFML/src/com/intellij/coldFusion/UI/editorActions/completionProviders/CfmlAttributeValuesCompletionProvider.java +++ b/CFML/src/com/intellij/coldFusion/UI/editorActions/completionProviders/CfmlAttributeValuesCompletionProvider.java @@ -40,6 +40,7 @@ public void addCompletions(@NotNull final CompletionParameters parameters, String[] attributeValue = CfmlUtil.getAttributeValues(tagName, attributeName, parameters.getPosition().getProject()); if ("type".equalsIgnoreCase(attributeName) && "cfargument".equalsIgnoreCase(tagName) || + "type".equalsIgnoreCase(attributeName) && "cfparam".equalsIgnoreCase(tagName) || "returntype".equalsIgnoreCase(attributeName) && "cffunction".equalsIgnoreCase(tagName) ) { Object[] objects = diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlElementTypes.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlElementTypes.java index edd6517f450..45061541457 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlElementTypes.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlElementTypes.java @@ -181,6 +181,12 @@ public PsiElement createPsiElement(final ASTNode node) { return new CfmlTagFunctionParameterImpl(node); } }; + CfmlCompositeElementType PARAM_TAG = new CfmlCompositeElementType("Tag") { + @Override + public PsiElement createPsiElement(final ASTNode node) { + return new CfmlTagParamImpl(node); + } + }; CfmlCompositeElementType SCRIPT_TAG = new CfmlCompositeElementType("Tag") { @Override public PsiElement createPsiElement(final ASTNode node) { diff --git a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlParser.java b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlParser.java index aeddc4c9be0..8411846ef53 100644 --- a/CFML/src/com/intellij/coldFusion/model/parsers/CfmlParser.java +++ b/CFML/src/com/intellij/coldFusion/model/parsers/CfmlParser.java @@ -47,6 +47,9 @@ else if ("cfinvoke".equals(StringUtil.toLowerCase(tagName))) { else if ("cfargument".equals(StringUtil.toLowerCase(tagName))) { return CfmlElementTypes.ARGUMENT_TAG; } + else if ("cfparam".equals(StringUtil.toLowerCase(tagName))) { + return CfmlElementTypes.PARAM_TAG; + } else if ("cfscript".equals(StringUtil.toLowerCase(tagName))) { return CfmlElementTypes.SCRIPT_TAG; } @@ -185,6 +188,7 @@ private static boolean doNeedNamedAttribute(String tagName) { return false; } return !(StringUtil.toLowerCase(tagName).equals("cffunction") || + StringUtil.toLowerCase(tagName).equals("cfparam") || StringUtil.toLowerCase(tagName).equals("cfargument")); } diff --git a/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagParamImpl.java b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagParamImpl.java new file mode 100644 index 00000000000..5aef8cd42eb --- /dev/null +++ b/CFML/src/com/intellij/coldFusion/model/psi/impl/CfmlTagParamImpl.java @@ -0,0 +1,139 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.coldFusion.model.psi.impl; + +import com.intellij.coldFusion.model.CfmlScopesInfo; +import com.intellij.coldFusion.model.CfmlUtil; +import com.intellij.coldFusion.model.psi.CfmlComponentType; +import com.intellij.coldFusion.model.psi.CfmlParameter; +import com.intellij.coldFusion.model.psi.CfmlPsiUtil; +import com.intellij.coldFusion.model.psi.CfmlVariable; +import com.intellij.lang.ASTNode; +import com.intellij.openapi.util.text.StringUtil; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiType; +import com.intellij.psi.ResolveState; +import com.intellij.psi.impl.CheckUtil; +import com.intellij.psi.scope.PsiScopeProcessor; +import com.intellij.util.ArrayUtil; +import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class CfmlTagParamImpl extends CfmlTagImpl implements CfmlVariable { + public final static String TAG_NAME = "cfparam"; + + public CfmlTagParamImpl(ASTNode astNode) { + super(astNode); + } + + @Override + public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException { + CheckUtil.checkWritable(this); + CfmlAttributeNameImpl childByClass = findChildByClass(CfmlAttributeNameImpl.class); + if (childByClass != null) { + childByClass.setName(name); + } + return this; + } + + private String[] getScopeNameSplit() { + final CfmlAttributeNameImpl attribute = findChildByClass(CfmlAttributeNameImpl.class); + if (attribute == null) { + return new String[]{null, ""}; + } + String name = attribute.getName(); + String[] split = name.split("\\.", 1); + if (split.length > 1 && ArrayUtil.find(CfmlUtil.getVariableScopes(getProject()), split[0]) > -1) { + return split; + } + return new String[]{null, name}; + } + + @NotNull + @Override + public String getName() { + return getScopeNameSplit()[1]; + } + + @Nullable + public String getDescription() { + return CfmlPsiUtil.getPureAttributeValue(this, "hint"); + } + + public boolean isRequired() { + String requiredAttr = CfmlPsiUtil.getPureAttributeValue(this, "required"); + if (requiredAttr == null) { + return false; + } + requiredAttr = StringUtil.toLowerCase(requiredAttr); + return "yes".equals(requiredAttr) || "true".equals(requiredAttr); + } + + public String getType() { + return CfmlPsiUtil.getPureAttributeValue(this, "type"); + } + + @Override + public int getProvidedScope() { + return CfmlScopesInfo.getScopeByString(getScopeNameSplit()[0]); + } + + @Override + @NotNull + public String getTagName() { + return TAG_NAME; + } + + @Override + public PsiElement getNameIdentifier() { + return getNavigationElement(); + } + + @NotNull + @Override + public PsiElement getNavigationElement() { + final PsiElement parameterName = findChildByClass(CfmlAttributeNameImpl.class); + if (parameterName != null) { + PsiElement navigationElement = parameterName.getNavigationElement(); + if (navigationElement != null) { + return navigationElement; + } + } + return super.getNavigationElement(); + } + + @Override + public boolean processDeclarations(@NotNull PsiScopeProcessor processor, + @NotNull ResolveState state, + PsiElement lastParent, + @NotNull PsiElement place) { + return processor.execute(this, state); + } + + @Override + public PsiType getPsiType() { + final String returnTypeString = this.getType(); + return returnTypeString != null ? + new CfmlComponentType(returnTypeString, getContainingFile(), getProject()) : null; + } + + @Override + public boolean isTrulyDeclaration() { + return false; + } + + @NotNull + @Override + public String getlookUpString() { + return getName(); + } + + @Override + public int getTextOffset() { + if (getNavigationElement() == this) { + return super.getTextOffset(); + } + return getNavigationElement().getTextOffset(); + } +} From 6910910c3764325df6c04866d6b045547f4dc58e Mon Sep 17 00:00:00 2001 From: Adventurous Gerbil Date: Fri, 10 Jan 2020 13:52:55 +0100 Subject: [PATCH 09/20] minor changes to tests to get them to run --- CFML/.idea/runConfigurations/CFML_Tests.xml | 15 +++++---------- .../intellij/coldFusion/CfmlStorageStateTest.java | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CFML/.idea/runConfigurations/CFML_Tests.xml b/CFML/.idea/runConfigurations/CFML_Tests.xml index 5e76a0539a3..d7d09c662a9 100644 --- a/CFML/.idea/runConfigurations/CFML_Tests.xml +++ b/CFML/.idea/runConfigurations/CFML_Tests.xml @@ -1,24 +1,17 @@ - -