actionManager,
0
);
- if (!doUpdate(group, e, presentation)) return;
+ if (!doUpdate(group, e, presentation)) {
+ return;
+ }
if (!presentation.isVisible()) { // don't process invisible groups
return;
e1.setInjectedContext(child.isInInjectedContext());
if (transparentOnly && child.isTransparentUpdate() || !transparentOnly) {
- if (!doUpdate(child, e1, presentation)) continue;
+ if (!doUpdate(child, e1, presentation)) {
+ continue;
+ }
}
if (!presentation.isVisible() || (!presentation.isEnabled() && hideDisabled)) { // don't create invisible items in the menu
list.add(child);
}
}
+ int i = 1;
}
// returns false if exception was thrown and handled
package com.jetbrains.python.templateLanguages;
import com.intellij.lang.Language;
-import com.intellij.openapi.module.Module;
import com.intellij.psi.templateLanguages.TemplateLanguage;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
+ * TODO: Make this class implemeent {@link com.intellij.lang.html.HtmlCompatibleLanguage} to prevent copy/paste by fixing dependencies
* Python template language
+ *
* @author Ilya.Kazakevich
*/
public abstract class PythonTemplateLanguage extends Language implements TemplateLanguage {
protected PythonTemplateLanguage(@Nullable final Language baseLanguage,
- @NotNull @NonNls final String ID,
- @NotNull @NonNls final String... mimeTypes) {
+ @NotNull @NonNls final String ID,
+ @NotNull @NonNls final String... mimeTypes) {
super(baseLanguage, ID, mimeTypes);
}
import com.intellij.ide.browsers.WebBrowserUrlProvider;
import com.intellij.lang.Language;
import com.intellij.lang.html.HTMLLanguage;
+import com.intellij.lang.html.HtmlCompatibleLanguage;
import com.intellij.lang.xhtml.XHTMLLanguage;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.project.DumbService;
public class WebBrowserServiceImpl extends WebBrowserService {
public static boolean isHtmlOrXmlFile(@NotNull PsiElement element) {
Language language = element.getLanguage();
+ if (language instanceof HtmlCompatibleLanguage) {
+ return true;
+ }
return language == HTMLLanguage.INSTANCE || language == XHTMLLanguage.INSTANCE || language == XMLLanguage.INSTANCE;
}
/**
* @author max
*/
-public class HTMLLanguage extends XMLLanguage {
+public class HTMLLanguage extends XMLLanguage implements HtmlCompatibleLanguage {
public static final HTMLLanguage INSTANCE = new HTMLLanguage();
--- /dev/null
+/*
+ * Copyright 2000-2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.lang.html;
+
+/**
+ * Language that is based on HTML (like some template languages)
+ * @author Ilya.Kazakevich
+ */
+public interface HtmlCompatibleLanguage {
+}