summaryrefslogtreecommitdiff
path: root/xml/impl
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-08-15 14:06:37 -0700
committerTor Norbye <tnorbye@google.com>2013-08-15 14:06:37 -0700
commita3c36999a717e0d9923378ca5e0ae1160118c1e6 (patch)
treeeda7fde5565d08649c0f5952e957a5ff4b2070d5 /xml/impl
parentd1129abbe4dc0ce9bbad9118a35a85dbebc8758f (diff)
downloadidea-a3c36999a717e0d9923378ca5e0ae1160118c1e6.tar.gz
Snapshot 13baaa319cd568c4e19b9232b24f2002f2631688 from master branch of git://git.jetbrains.org/idea/community.git
Change-Id: I2ede7fef748e781ed425346a4e03e721bf4d2610
Diffstat (limited to 'xml/impl')
-rw-r--r--xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java2
-rw-r--r--xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java10
-rw-r--r--xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java8
-rw-r--r--xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java2
-rw-r--r--xml/impl/src/com/intellij/ide/browsers/Urls.java2
5 files changed, 11 insertions, 13 deletions
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java
index 828e654eee5f..5e23d8223e62 100644
--- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlErrorQuickFixProvider.java
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.NotNull;
public class XmlErrorQuickFixProvider implements ErrorQuickFixProvider {
@NonNls private static final String AMP_ENTITY = "&amp;";
- public void registerErrorQuickFix(final PsiErrorElement element, final HighlightInfo highlightInfo) {
+ public void registerErrorQuickFix(@NotNull final PsiErrorElement element, @NotNull final HighlightInfo highlightInfo) {
if (PsiTreeUtil.getParentOfType(element, XmlTag.class) != null) {
registerXmlErrorQuickFix(element,highlightInfo);
}
diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
index 4162ec0b509c..624e0c066590 100644
--- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
+++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java
@@ -17,10 +17,7 @@ package com.intellij.codeInsight.daemon.impl.analysis;
import com.intellij.BundleBase;
import com.intellij.codeInsight.daemon.*;
-import com.intellij.codeInsight.daemon.impl.HighlightInfo;
-import com.intellij.codeInsight.daemon.impl.HighlightInfoType;
-import com.intellij.codeInsight.daemon.impl.HighlightVisitor;
-import com.intellij.codeInsight.daemon.impl.SeverityUtil;
+import com.intellij.codeInsight.daemon.impl.*;
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixActionRegistrarImpl;
import com.intellij.codeInsight.intention.IntentionAction;
@@ -361,7 +358,7 @@ public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightV
localizedMessage,
isInjectedHtmlTagForWhichNoProblemsReporting((HtmlTag)tag) ?
HighlightInfoType.INFORMATION :
- SeverityUtil.getSeverityRegistrar(tag.getProject()).getHighlightInfoTypeBySeverity(profile.getErrorLevel(key, tag).getSeverity()),
+ SeverityRegistrar.getSeverityRegistrar(tag.getProject()).getHighlightInfoTypeBySeverity(profile.getErrorLevel(key, tag).getSeverity()),
addAttributeFix,
basicIntention);
} else if (!htmlTag) {
@@ -414,6 +411,7 @@ public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightV
private void checkAttribute(XmlAttribute attribute) {
XmlTag tag = attribute.getParent();
+ if (tag == null) return;
final String name = attribute.getName();
@@ -689,7 +687,7 @@ public class XmlHighlightVisitor extends XmlElementVisitor implements HighlightV
addElementsForTag((XmlTag)context, message, infoType, null);
}
else {
- addToResults(HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(context).descriptionAndTooltip(message).create());
+ addToResults(HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(context).descriptionAndTooltip(message).create());
}
}
}
diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java b/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java
index 9f884a879825..b394bf953985 100644
--- a/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java
+++ b/xml/impl/src/com/intellij/codeInsight/editorActions/DtdSelectioner.java
@@ -15,18 +15,18 @@
*/
package com.intellij.codeInsight.editorActions;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.xml.XmlAttlistDecl;
import com.intellij.psi.xml.XmlElementDecl;
import com.intellij.psi.xml.XmlToken;
import com.intellij.psi.xml.XmlTokenType;
-import com.intellij.openapi.util.TextRange;
-import com.intellij.openapi.editor.Editor;
-import java.util.List;
import java.util.ArrayList;
+import java.util.List;
-public class DtdSelectioner implements ExtendWordSelectionHandler {
+public class DtdSelectioner extends ExtendWordSelectionHandlerBase {
public boolean canSelect(PsiElement e) {
return e instanceof XmlAttlistDecl || e instanceof XmlElementDecl;
}
diff --git a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java
index 15c45a88fb30..1af55fa90c01 100644
--- a/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java
+++ b/xml/impl/src/com/intellij/codeInspection/htmlInspections/XmlWrongClosingTagNameInspection.java
@@ -45,7 +45,7 @@ import org.jetbrains.annotations.Nullable;
public class XmlWrongClosingTagNameInspection implements Annotator {
@Override
- public void annotate(final PsiElement psiElement, final AnnotationHolder holder) {
+ public void annotate(@NotNull final PsiElement psiElement, @NotNull final AnnotationHolder holder) {
if (psiElement instanceof XmlToken) {
final PsiElement parent = psiElement.getParent();
if (parent instanceof XmlTag) {
diff --git a/xml/impl/src/com/intellij/ide/browsers/Urls.java b/xml/impl/src/com/intellij/ide/browsers/Urls.java
index bee9e7dda49f..669d93824f5d 100644
--- a/xml/impl/src/com/intellij/ide/browsers/Urls.java
+++ b/xml/impl/src/com/intellij/ide/browsers/Urls.java
@@ -77,7 +77,7 @@ public final class Urls {
// java.net.URI.create cannot parse "file:///Test Stuff" - but you don't need to worry about it - this method is aware
public static Url newFromIdea(@NotNull String url) {
- int index = url.indexOf("://");
+ int index = url.indexOf(URLUtil.SCHEME_SEPARATOR);
if (index < 0) {
// nodejs debug — files only in local filesystem
return new LocalFileUrl(url);