Skip to content

Commit 02c3913

Browse files
committed
[annotator] temporary disable a check for cap function
1 parent d0b47d5 commit 02c3913

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/com/goide/highlighting/GoAnnotator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class GoAnnotator implements Annotator {
3939
"int", "int8", "int16", "int32", "int64", "uint", "uint8", "uint16", "uint32", "uint64", "uintptr",
4040
"rune", "float32", "float64"
4141
); // todo: unify with DlvApi.Variable.Kind
42+
private static final boolean ENABLE_CAP_CHECK = false; // todo: disable for a while due to #2268
4243

4344
@Override
4445
public void annotate(@NotNull PsiElement element, @NotNull AnnotationHolder holder) {
@@ -112,7 +113,7 @@ else if (element instanceof GoBuiltinCallExpr) {
112113
checkMakeCall(call, holder);
113114
}
114115
}
115-
else if (element instanceof GoCallExpr) {
116+
else if (ENABLE_CAP_CHECK && element instanceof GoCallExpr) {
116117
GoCallExpr call = (GoCallExpr)element;
117118
if (call.getExpression() instanceof GoReferenceExpression) {
118119
GoReferenceExpression reference = (GoReferenceExpression)call.getExpression();

testData/highlighting/builtinFuncCalls.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ func main() {
6060
var capTest1 e
6161
var capTest2 a
6262
var capTest3 capChan
63-
var capTest4 int
63+
//var capTest4 int todo: #2268
6464
foo(cap<error descr="not enough arguments in call to cap">()</error>)
6565
foo(cap<error descr="too many arguments in call to cap">(capTest1, capTest2)</error>)
6666
foo(cap(capTest1))
67-
foo(cap(<error descr="Invalid argument for cap">capTest2</error>))
67+
//foo(cap(<error_ descr="Invalid argument for cap">capTest2</error>)) todo: #2268
6868
foo(cap(capTest3))
69-
foo(cap(<error descr="Invalid argument for cap">capTest4</error>))
70-
foo(cap(<error descr="Invalid argument for cap">map[string]struct{}{}</error>))
69+
//foo(cap(<error_ descr="Invalid argument for cap">capTest4</error>)) todo: #2268
70+
//foo(cap(<error_ descr="Invalid argument for cap">map[string]struct{}{}</error>)) todo: #2268
7171
foo(cap(&[4]string{"a", "b", "c", "d"}))
7272
foo(cap([]string{}))
7373
}

0 commit comments

Comments
 (0)