Skip to content

Commit 4c617db

Browse files
committed
build: 构建2.1.5版本
1 parent 535332d commit 4c617db

4 files changed

Lines changed: 32 additions & 23 deletions

File tree

244 Bytes
Binary file not shown.

resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<name>NutzCodeInsight</name>
55
<version>2.1.5</version>
66
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
7-
<idea-version since-build="201"/>
7+
<idea-version since-build="203"/>
88
<vendor email="huchuc@vip.qq.com" url="https://gitee.com/threefish/NutzCodeInsight">threefish</vendor>
99
<description><![CDATA[
1010
<h1>Intellij idea plugin for <a href="https://github.com/nutzam/nutz">Nutz</a></h1>

src/com/sgaop/idea/annotator/JavaSqlXmlAnnotator.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.sgaop.idea.annotator;
22

3-
import com.intellij.lang.annotation.Annotation;
3+
import com.intellij.lang.annotation.AnnotationBuilder;
44
import com.intellij.lang.annotation.AnnotationHolder;
55
import com.intellij.lang.annotation.HighlightSeverity;
66
import com.intellij.openapi.util.TextRange;
@@ -33,16 +33,22 @@ public boolean isSqlsXml(@NotNull PsiElement psiElement) {
3333
*/
3434
@Override
3535
public void process(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
36-
List<VirtualFile> virtualFileList = SqlsXmlUtil.findTemplteFileList(psiElement);
37-
if (virtualFileList.size() == 0) {
38-
TextRange textRange;
39-
if (psiElement.getNextSibling().getChildren().length == 0) {
40-
textRange = psiElement.getTextRange();
41-
} else {
42-
textRange = new TextRange(psiElement.getTextRange().getStartOffset(), psiElement.getNextSibling().getTextRange().getEndOffset());
36+
try {
37+
List<VirtualFile> virtualFileList = SqlsXmlUtil.findTemplteFileList(psiElement);
38+
if (virtualFileList.size() == 0) {
39+
TextRange textRange;
40+
if (psiElement.getNextSibling().getChildren().length == 0) {
41+
textRange = psiElement.getTextRange();
42+
} else {
43+
textRange = new TextRange(psiElement.getTextRange().getStartOffset(), psiElement.getNextSibling().getTextRange().getEndOffset());
44+
}
45+
AnnotationBuilder annotationBuilder = annotationHolder.newAnnotation(HighlightSeverity.ERROR, ERR_MSG);
46+
annotationBuilder.range(textRange);
47+
AnnotationBuilder.FixBuilder fixBuilder = annotationBuilder.newFix(new GenerateSqlXmlIntention());
48+
fixBuilder.registerFix();
49+
annotationBuilder.create();
4350
}
44-
Annotation annotation = new Annotation(textRange.getStartOffset(), textRange.getEndOffset(), HighlightSeverity.ERROR, ERR_MSG, null);
45-
annotation.registerFix(new GenerateSqlXmlIntention());
51+
} catch (Exception e) {
4652
}
4753
}
4854
}

src/com/sgaop/idea/linemarker/IocBeanInterfaceLineMarkerProvider.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,24 @@ private List<PsiElement> getImplListElements(String name, String qualifiedName,
137137

138138
private HashMap<String, List<PsiElement>> getMethodIocBeans(Project project, GlobalSearchScope moduleScope) {
139139
HashMap<String, List<PsiElement>> elementHashMap = new HashMap<>(1);
140-
Collection<PsiAnnotation> psiAnnotationCollection = JavaAnnotationIndex.getInstance().get("IocBean", project, moduleScope);
141-
for (PsiAnnotation psiAnnotation : psiAnnotationCollection) {
142-
if (psiAnnotation.getParent() instanceof PsiModifierList) {
143-
if (psiAnnotation.getParent().getParent() instanceof PsiMethod) {
144-
PsiMethod method = (PsiMethod) psiAnnotation.getParent().getParent();
145-
String returnQualifiedName = method.getReturnType().getCanonicalText();
146-
if (elementHashMap.containsKey(returnQualifiedName)) {
147-
elementHashMap.get(returnQualifiedName).add(method);
148-
} else {
149-
List<PsiElement> arr = new ArrayList<>();
150-
arr.add(method);
151-
elementHashMap.put(returnQualifiedName, arr);
140+
try {
141+
Collection<PsiAnnotation> psiAnnotationCollection = JavaAnnotationIndex.getInstance().get("IocBean", project, moduleScope);
142+
for (PsiAnnotation psiAnnotation : psiAnnotationCollection) {
143+
if (psiAnnotation.getParent() instanceof PsiModifierList) {
144+
if (psiAnnotation.getParent().getParent() instanceof PsiMethod) {
145+
PsiMethod method = (PsiMethod) psiAnnotation.getParent().getParent();
146+
String returnQualifiedName = method.getReturnType().getCanonicalText();
147+
if (elementHashMap.containsKey(returnQualifiedName)) {
148+
elementHashMap.get(returnQualifiedName).add(method);
149+
} else {
150+
List<PsiElement> arr = new ArrayList<>();
151+
arr.add(method);
152+
elementHashMap.put(returnQualifiedName, arr);
153+
}
152154
}
153155
}
154156
}
157+
} catch (Exception e) {
155158
}
156159
return elementHashMap;
157160
}

0 commit comments

Comments
 (0)