Style and COBOL key | 格式化和 COBOL 关键字

This commit is contained in:
林万程
2022-05-06 00:15:21 +08:00
parent 81fb77e9bc
commit 900f59b601
8 changed files with 16 additions and 10 deletions

View File

@@ -14,8 +14,8 @@ import com.intellij.psi.*;
import com.intellij.psi.javadoc.PsiDocComment;
import com.intellij.ui.ColoredTreeCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import io.github.linwancen.plugin.show.doc.PsiDocToStrDoc;
import io.github.linwancen.plugin.show.doc.OwnerToPsiDocUtils;
import io.github.linwancen.plugin.show.doc.PsiDocToStrDoc;
import io.github.linwancen.plugin.show.ext.TreeExt;
import io.github.linwancen.plugin.show.settings.AppSettingsState;
import org.jetbrains.annotations.Nullable;

View File

@@ -2,7 +2,9 @@ package io.github.linwancen.plugin.show.doc;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.*;
import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiField;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.PsiShortNamesCache;
import org.jetbrains.annotations.NotNull;

View File

@@ -48,7 +48,7 @@ class ConfCacheGetUtils {
map.put(levelStr + "\b" + confPath, entry.getValue());
} else if (confName.endsWith((name + confMidExt))) {
map.put(levelStr + "\t" + confPath, entry.getValue());
} else{
} else {
if (ext == null) {
ext = "";
}

View File

@@ -10,7 +10,10 @@ import groovy.json.StringEscapeUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.regex.Pattern;

View File

@@ -43,8 +43,8 @@ public class FileViewToPsiDocRightToLeft {
}
private static PsiDocComment psiDoc(AppSettingsState setting,
PsiElement identifier, PsiElement element,
int startOffset, int endOffset) {
PsiElement identifier, PsiElement element,
int startOffset, int endOffset) {
if (identifier != null && !(identifier instanceof PsiIdentifier)) {
return null;
}

View File

@@ -3,6 +3,7 @@
长的要放在短的前面
^.{7}
(?<=.{72}).*
\. .
\, ,
1 COBOL 必要【关键字】
3 长的要放在短的前面
4 ^.{7}
5 \. (?<=.{72}).*
6 \. .
7 \, ,
8 INITIALIZE 初始化
9 MOVE

View File

@@ -1,8 +1,8 @@
COBOL 数据类型【关键字】
66 重命名
77 不能被细分项
88 条件名
66 重命名
77 不能被细分项
88 条件名
9\( ( 数字
A\( ( 字母
1 COBOL 数据类型【关键字】
2 66 66 重命名
3 77 77 不能被细分项
4 88 88 条件名
5 9\( ( 数字
6 A\( ( 字母
7 X\( ( 字母数字
8 V\( ( 隐式小数

View File

@@ -1,5 +1,5 @@
COBOL 数据部必要【关键字】
^.{7} +\d{2}
^.{7} +[0-59]{2}
PIC
COPY
REPLACING
1 COBOL 数据部必要【关键字】
2 ^.{7} +\d{2} ^.{7} +[0-59]{2}
3 PIC
4 COPY
5 REPLACING