mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
HTML: enable autopopup after < and & only
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ public class HtmlTextCompletionConfidence extends CompletionConfidence {
|
||||
PsiElement parent = contextElement.getParent();
|
||||
if (parent instanceof XmlText || parent instanceof XmlDocument) {
|
||||
String prefix = contextElement.getText().substring(0, offset - contextElement.getTextRange().getStartOffset());
|
||||
if (StringUtil.isJavaIdentifier(prefix)) {
|
||||
if (!StringUtil.startsWithChar(prefix, '<') && !StringUtil.startsWithChar(prefix, '&')) {
|
||||
return ThreeState.YES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,15 @@ public class XmlAutopopupTest extends CompletionAutoPopupTestCase {
|
||||
doTestNoPopup(XHtmlFileType.INSTANCE, "<div><caret></div>", "p");
|
||||
}
|
||||
|
||||
public void testAfterTagOpenXhtml() throws Exception {
|
||||
public void testAfterAmpersand() {
|
||||
doTestPopup(HtmlFileType.INSTANCE, "<div>&<caret></div>", "t");
|
||||
}
|
||||
|
||||
public void testDoNotShowPopupAfterQuotedSymbol() {
|
||||
doTestNoPopup(HtmlFileType.INSTANCE, "<div>\"<caret></div>", "s");
|
||||
}
|
||||
|
||||
public void testAfterTagOpenXhtml() {
|
||||
doTestPopup(XHtmlFileType.INSTANCE, "<div><caret></div>", "<");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user