mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-79375 IDEA doesn't highlight parent brackets
Brace matching is non-strict by default, so, critical places that change document text on that brace match information explicitly use strict matching now
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -317,7 +317,7 @@ public class TypedHandler extends TypedActionHandlerBase {
|
||||
if (lparenOffset < 0) lparenOffset = 0;
|
||||
|
||||
iterator = ((EditorEx)editor).getHighlighter().createIterator(lparenOffset);
|
||||
boolean matched = BraceMatchingUtil.matchBrace(fileText, fileType, iterator, true);
|
||||
boolean matched = BraceMatchingUtil.matchBrace(fileText, fileType, iterator, true, true);
|
||||
|
||||
if (!matched) {
|
||||
String text;
|
||||
@@ -388,7 +388,7 @@ public class TypedHandler extends TypedActionHandlerBase {
|
||||
}
|
||||
|
||||
iterator = ((EditorEx) editor).getHighlighter().createIterator(lparenthOffset);
|
||||
boolean matched = BraceMatchingUtil.matchBrace(text, fileType, iterator, true);
|
||||
boolean matched = BraceMatchingUtil.matchBrace(text, fileType, iterator, true, true);
|
||||
|
||||
if (!matched) return false;
|
||||
|
||||
|
||||
@@ -156,8 +156,8 @@ public class BraceMatchingUtil {
|
||||
topTokenType = myBraceStack.pop();
|
||||
}
|
||||
}
|
||||
else if (!topTokenType.equals(baseType) && (brace1TagName == null || !brace1TagName.equals(tagName))) {
|
||||
// Ignore non-matched opposite-direction brace.
|
||||
else if ((brace1TagName == null || !brace1TagName.equals(tagName)) && !isPairBraces(topTokenType, tokenType, fileType)) {
|
||||
// Ignore non-matched opposite-direction brace for non-strict processing.
|
||||
myBraceStack.push(topTokenType);
|
||||
continue;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -431,8 +431,8 @@ public abstract class LightPlatformCodeInsightTestCase extends LightPlatformTest
|
||||
caretMarker.getStartOffset(),
|
||||
CodeStyleSettingsManager.getSettings(getProject()).getIndentOptions(StdFileTypes.JAVA).TAB_SIZE);
|
||||
|
||||
assertEquals(getMessage("caretLine", message), caretLine + 1, myEditor.getCaretModel().getLogicalPosition().line + 1);
|
||||
assertEquals(getMessage("caretColumn", message), caretCol + 1, myEditor.getCaretModel().getLogicalPosition().column + 1);
|
||||
assertEquals(getMessage("caretLine", message), caretLine, myEditor.getCaretModel().getLogicalPosition().line);
|
||||
assertEquals(getMessage("caretColumn", message), caretCol, myEditor.getCaretModel().getLogicalPosition().column);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user