mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git@git.labs.intellij.net:idea/community
This commit is contained in:
@@ -72,6 +72,13 @@ public abstract class JavaParsingTestCase extends ParsingTestCase {
|
||||
myLanguageLevel = LanguageLevel.JDK_1_6;
|
||||
getProject().registerService(LanguageLevelProjectExtension.class, new LanguageLevelProjectExtensionImpl(getProject()));
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new JavaASTFactory());
|
||||
try {
|
||||
registerApplicationService((Class<Object>)Class.forName("com.intellij.psi.jsp.JspSpiUtil"),
|
||||
Class.forName("com.intellij.jsp.impl.JspSpiUtilImpl").newInstance());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
// jsp not available
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.testFramework.fixtures;
|
||||
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.codeInsight.lookup.impl.LookupImpl;
|
||||
import com.intellij.openapi.application.Result;
|
||||
import com.intellij.openapi.command.WriteCommandAction;
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
*/
|
||||
public abstract class InjectedLanguageFixtureTestCase extends LightCodeInsightFixtureTestCase {
|
||||
protected void checkCompletionVariants(final FileType fileType, final String text, final String... strings) throws Throwable {
|
||||
myFixture.configureByText(fileType, text.replaceAll("\\|", "<caret>"));
|
||||
tuneCompletionFile(myFixture.getFile());
|
||||
final LookupElement[] elements = myFixture.completeBasic();
|
||||
assertNotNull(elements);
|
||||
myFixture.checkResult(text.replaceAll("\\|", "<caret>"));
|
||||
|
||||
assertSameElements(ContainerUtil.map(elements, new Function<LookupElement, String>() {
|
||||
@Override
|
||||
public String fun(final LookupElement lookupItem) {
|
||||
return lookupItem.getLookupString();
|
||||
}
|
||||
}), strings);
|
||||
}
|
||||
|
||||
protected void assertNoVariants(final FileType fileType, final String text) throws Throwable {
|
||||
checkCompleted(fileType, text, text);
|
||||
}
|
||||
|
||||
protected void checkCompleted(final FileType fileType, final String text, final String resultText) throws Throwable {
|
||||
myFixture.configureByText(fileType, text.replaceAll("\\|", "<caret>"));
|
||||
tuneCompletionFile(myFixture.getFile());
|
||||
final LookupElement[] elements = myFixture.completeBasic();
|
||||
if (elements != null && elements.length == 1) {
|
||||
new WriteCommandAction(getProject()) {
|
||||
@Override
|
||||
protected void run(Result result) throws Throwable {
|
||||
((LookupImpl)LookupManager.getInstance(getProject()).getActiveLookup()).finishLookup(Lookup.NORMAL_SELECT_CHAR);
|
||||
}
|
||||
}.execute();
|
||||
}
|
||||
else if (elements != null && elements.length > 0) {
|
||||
fail(Arrays.toString(elements));
|
||||
}
|
||||
myFixture.checkResult(resultText.replaceAll("\\|", "<caret>"));
|
||||
FileDocumentManager.getInstance().saveDocument(myFixture.getDocument(myFixture.getFile()));
|
||||
}
|
||||
|
||||
protected void tuneCompletionFile(PsiFile file) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -113,7 +113,7 @@ class EventLogConsole {
|
||||
Document document = myLogEditor.getDocument();
|
||||
boolean scroll = document.getTextLength() == myLogEditor.getCaretModel().getOffset();
|
||||
|
||||
append(document, DateFormat.getTimeInstance(DateFormat.MEDIUM).format(notification.getCreationTime()) + " ");
|
||||
append(document, DateFormat.getTimeInstance(DateFormat.MEDIUM).format(notification.getCreationTime()) + ". ");
|
||||
|
||||
EventLog.LogEntry pair = EventLog.formatForLog(notification);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.intellij.mock;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.fileTypes.*;
|
||||
import com.intellij.openapi.fileTypes.ex.FileTypeManagerEx;
|
||||
import com.intellij.openapi.fileTypes.impl.AbstractFileType;
|
||||
@@ -138,25 +137,21 @@ public class MockFileTypeManager extends FileTypeManagerEx {
|
||||
public FileType getStdFileType(@NotNull @NonNls final String fileTypeName) {
|
||||
if ("ARCHIVE".equals(fileTypeName) || "CLASS".equals(fileTypeName)) return UnknownFileType.INSTANCE;
|
||||
if ("PLAIN_TEXT".equals(fileTypeName)) return PlainTextFileType.INSTANCE;
|
||||
Language language = Language.findLanguageByID(fileTypeName);
|
||||
if (language == null) {
|
||||
// StdFileTypes initialization..
|
||||
if ("JAVA".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.java.JavaLanguage");
|
||||
if ("XML".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.xml.XMLLanguage");
|
||||
if ("DTD".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.dtd.DTDLanguage");
|
||||
if ("JSP".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.jsp.NewJspLanguage");
|
||||
if ("JSPX".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.jspx.JSPXLanguage");
|
||||
if ("HTML".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.html.HTMLLanguage");
|
||||
if ("XHTML".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.xhtml.XHTMLLanguage");
|
||||
if ("JavaScript".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.javascript.JavascriptLanguage");
|
||||
if ("Properties".equals(fileTypeName)) language = loadLanguageSafe("com.intellij.lang.properties.PropertiesLanguage");
|
||||
}
|
||||
return new MockLanguageFileType(language == null? PlainTextLanguage.INSTANCE : language, fileTypeName.toLowerCase());
|
||||
if ("JAVA".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.JavaFileType");
|
||||
if ("XML".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.XmlFileType");
|
||||
if ("DTD".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.DTDFileType");
|
||||
if ("JSP".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.NewJspFileType");
|
||||
if ("JSPX".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.JspxFileType");
|
||||
if ("HTML".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.HtmlFileType");
|
||||
if ("XHTML".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.ide.highlighter.XHtmlFileType");
|
||||
if ("JavaScript".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.lang.javascript.JavaScriptFileType");
|
||||
if ("Properties".equals(fileTypeName)) return loadFileTypeSafe("com.intellij.lang.properties.PropertiesFileType");
|
||||
return new MockLanguageFileType(PlainTextLanguage.INSTANCE, fileTypeName.toLowerCase());
|
||||
}
|
||||
|
||||
private static Language loadLanguageSafe(final String className) {
|
||||
private static FileType loadFileTypeSafe(final String className) {
|
||||
try {
|
||||
return (Language)Class.forName(className).getField("INSTANCE").get(null);
|
||||
return (FileType)Class.forName(className).getField("INSTANCE").get(null);
|
||||
}
|
||||
catch (Exception e) {
|
||||
return null;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MockLanguageFileType extends LanguageFileType{
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof MockLanguageFileType)) return false;
|
||||
return getLanguage().equals(((MockLanguageFileType)obj).getLanguage());
|
||||
if (!(obj instanceof LanguageFileType)) return false;
|
||||
return getLanguage().equals(((LanguageFileType)obj).getLanguage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ import java.io.IOException;
|
||||
public abstract class ParsingTestCase extends PlatformLiteFixture {
|
||||
protected String myFilePrefix = "";
|
||||
protected String myFileExt;
|
||||
@NonNls private final String myFullDataPath;
|
||||
@NonNls protected final String myFullDataPath;
|
||||
protected PsiFile myFile;
|
||||
private MockPsiManager myPsiManager;
|
||||
private PsiFileFactoryImpl myFileFactory;
|
||||
|
||||
-2
@@ -313,8 +313,6 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture {
|
||||
|
||||
Document getDocument(PsiFile file);
|
||||
|
||||
void setFileContext(@Nullable PsiElement context);
|
||||
|
||||
@NotNull
|
||||
Collection<GutterIconRenderer> findAllGutters(String filePath);
|
||||
|
||||
|
||||
-29
@@ -94,7 +94,6 @@ import com.intellij.psi.impl.PsiManagerImpl;
|
||||
import com.intellij.psi.impl.cache.impl.todo.TodoIndex;
|
||||
import com.intellij.psi.impl.source.PostprocessReformattingAspect;
|
||||
import com.intellij.psi.impl.source.PsiFileImpl;
|
||||
import com.intellij.psi.impl.source.resolve.FileContextUtil;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.UsageSearchContext;
|
||||
@@ -151,7 +150,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
private final TempDirTestFixture myTempDirFixture;
|
||||
protected final IdeaProjectTestFixture myProjectFixture;
|
||||
@NonNls private static final String XXX = "XXX";
|
||||
private PsiElement myFileContext;
|
||||
private final FileTreeAccessFilter myJavaFilesFilter = new FileTreeAccessFilter();
|
||||
private boolean myAllowDirt;
|
||||
private boolean toInitializeDaemon;
|
||||
@@ -901,19 +899,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
@Override
|
||||
public void run() {
|
||||
final CodeCompletionHandlerBase handler = new CodeCompletionHandlerBase(type) {
|
||||
@Override
|
||||
protected PsiFile createFileCopy(final PsiFile file) {
|
||||
final PsiFile copy = super.createFileCopy(file);
|
||||
if (myFileContext != null) {
|
||||
final PsiElement contextCopy = myFileContext.copy();
|
||||
final PsiFile containingFile = contextCopy.getContainingFile();
|
||||
if (containingFile instanceof PsiFileImpl) {
|
||||
((PsiFileImpl)containingFile).setOriginalFile(myFileContext.getContainingFile());
|
||||
}
|
||||
setContext(copy, contextCopy);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void completionFinished(int offset1,
|
||||
@@ -1064,7 +1049,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
myInspections = null;
|
||||
myAvailableLocalTools.clear();
|
||||
myAvailableTools.clear();
|
||||
myFileContext = null;
|
||||
|
||||
myProjectFixture.tearDown();
|
||||
myTempDirFixture.tearDown();
|
||||
@@ -1221,12 +1205,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
return PsiDocumentManager.getInstance(getProject()).getDocument(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFileContext(@Nullable final PsiElement context) {
|
||||
myFileContext = context;
|
||||
setContext(myFile, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param filePath
|
||||
* @throws IOException
|
||||
@@ -1266,7 +1244,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
myFile = myPsiManager.findFile(copy);
|
||||
setContext(myFile, myFileContext);
|
||||
myEditor = createEditor(copy);
|
||||
assert myEditor != null : "Editor couldn't be created for file: " +
|
||||
copy.getPath() +
|
||||
@@ -1292,12 +1269,6 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
return myFile;
|
||||
}
|
||||
|
||||
private static void setContext(final PsiFile file, final PsiElement context) {
|
||||
if (file != null && context != null) {
|
||||
file.putUserData(FileContextUtil.INJECTED_IN_ELEMENT, new IdentitySmartPointer<PsiElement>(context));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VirtualFile findFileInTempDir(final String filePath) {
|
||||
if (myTempDirFixture instanceof LightTempDirTestFixtureImpl) {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<orderEntry type="module" module-name="compiler-openapi" />
|
||||
<orderEntry type="module" module-name="execution-openapi" />
|
||||
<orderEntry type="module" module-name="idea-ui" />
|
||||
<orderEntry type="library" name="Groovy" level="project" />
|
||||
<orderEntry type="library" exported="" name="Groovy" level="project" />
|
||||
<orderEntry type="module" module-name="java-impl" />
|
||||
<orderEntry type="module" module-name="copyright" />
|
||||
<orderEntry type="module" module-name="IntelliLang" />
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.groovy.completion
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil
|
||||
import com.intellij.psi.util.PsiTreeUtil
|
||||
import com.intellij.psi.xml.XmlText
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
@@ -43,4 +46,14 @@ s.codePointAt(<caret>0)
|
||||
</groovy>""")
|
||||
}
|
||||
|
||||
public void testIntelliLangInjections() throws Exception {
|
||||
myFixture.addClass("package groovy.lang; public class GroovyShell { public void evaluate(String s) { }}");
|
||||
final PsiFile psiFile = myFixture.configureByText("script.groovy", 'new groovy.lang.GroovyShell().evaluate("s = new String()")');
|
||||
assertNotNull(psiFile);
|
||||
def offset = psiFile.getText().indexOf('"') + 1
|
||||
final PsiElement elementAt = psiFile.findElementAt(offset);
|
||||
assertNotNull(elementAt);
|
||||
assert InjectedLanguageUtil.findInjectedPsiNoCommit(psiFile, offset)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2010 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 org.jetbrains.plugins.groovy.lang;
|
||||
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
import org.intellij.plugins.intelliLang.inject.InjectorUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Gregory.Shrago
|
||||
*/
|
||||
public class GroovyInjectionTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testIntelliLangInjections() throws Exception {
|
||||
myFixture.addClass("package groovy.lang; public class GroovyShell { void evaluate(String s) { }}");
|
||||
final PsiFile psiFile = myFixture.configureByText("script.groovy", "void f() { new groovy.lang.GroovyShell().evaluate(\"s = new String()\") }");
|
||||
assertNotNull(psiFile);
|
||||
final PsiElement elementAt = psiFile.findElementAt(psiFile.getText().indexOf('\"') + 1);
|
||||
assertNotNull(elementAt);
|
||||
InjectedLanguageUtil.forceInjectionOnElement(elementAt);
|
||||
final List<Pair<PsiElement,TextRange>> files = InjectedLanguageUtil.getInjectedPsiFiles(elementAt);
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ import com.intellij.openapi.util.IconLoader;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -31,7 +31,7 @@ import java.nio.charset.Charset;
|
||||
*/
|
||||
public class PropertiesFileType extends LanguageFileType {
|
||||
public static final Icon FILE_ICON = IconLoader.getIcon("/fileTypes/properties.png");
|
||||
public static final LanguageFileType FILE_TYPE = new PropertiesFileType();
|
||||
public static final LanguageFileType INSTANCE = new PropertiesFileType();
|
||||
@NonNls public static final String DEFAULT_EXTENSION = "properties";
|
||||
@NonNls public static final String DOT_DEFAULT_EXTENSION = "."+DEFAULT_EXTENSION;
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class PropertiesFileTypeFactory extends FileTypeFactory {
|
||||
public void createFileTypes(@NotNull FileTypeConsumer consumer) {
|
||||
consumer.consume(PropertiesFileType.FILE_TYPE, PropertiesFileType.DEFAULT_EXTENSION);
|
||||
consumer.consume(PropertiesFileType.INSTANCE, PropertiesFileType.DEFAULT_EXTENSION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,11 +82,11 @@ public class PropertiesFilesManager extends AbstractProjectComponent {
|
||||
}
|
||||
|
||||
public Collection<VirtualFile> getAllPropertiesFiles() {
|
||||
return FileBasedIndex.getInstance().getContainingFiles(FileTypeIndex.NAME, PropertiesFileType.FILE_TYPE, GlobalSearchScope.allScope(myProject));
|
||||
return FileBasedIndex.getInstance().getContainingFiles(FileTypeIndex.NAME, PropertiesFileType.INSTANCE, GlobalSearchScope.allScope(myProject));
|
||||
}
|
||||
|
||||
public boolean processAllPropertiesFiles(final Processor<VirtualFile> processor) {
|
||||
return FileBasedIndex.getInstance().processValues(FileTypeIndex.NAME, PropertiesFileType.FILE_TYPE, null, new FileBasedIndex.ValueProcessor<Void>() {
|
||||
return FileBasedIndex.getInstance().processValues(FileTypeIndex.NAME, PropertiesFileType.INSTANCE, null, new FileBasedIndex.ValueProcessor<Void>() {
|
||||
public boolean process(VirtualFile file, Void value) {
|
||||
return processor.process(file);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class PropertiesReferenceManager {
|
||||
@NotNull final PropertiesFileProcessor processor,
|
||||
@NotNull final BundleNameEvaluator evaluator) {
|
||||
|
||||
return FileBasedIndex.getInstance().processValues(FileTypeIndex.NAME, PropertiesFileType.FILE_TYPE, null, new FileBasedIndex.ValueProcessor<Void>() {
|
||||
return FileBasedIndex.getInstance().processValues(FileTypeIndex.NAME, PropertiesFileType.INSTANCE, null, new FileBasedIndex.ValueProcessor<Void>() {
|
||||
public boolean process(VirtualFile file, Void value) {
|
||||
|
||||
final PsiFile psiFile = myPsiManager.findFile(file);
|
||||
|
||||
+3
-3
@@ -236,21 +236,21 @@ public class ResourceBundleEditor extends UserDataHolderBase implements FileEdit
|
||||
VirtualFileManager.getInstance().addVirtualFileListener(new VirtualFileAdapter() {
|
||||
@Override
|
||||
public void fileCreated(VirtualFileEvent event) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.FILE_TYPE) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.INSTANCE) {
|
||||
recreateEditorsPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileDeleted(VirtualFileEvent event) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.FILE_TYPE) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.INSTANCE) {
|
||||
recreateEditorsPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(VirtualFilePropertyEvent event) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.FILE_TYPE) {
|
||||
if (event.getFile().getFileType() == PropertiesFileType.INSTANCE) {
|
||||
if (VirtualFile.PROP_NAME.equals(event.getPropertyName())) {
|
||||
recreateEditorsPanel();
|
||||
}
|
||||
|
||||
@@ -129,9 +129,6 @@ public class EvaluatedXmlNameImpl implements EvaluatedXmlName {
|
||||
}
|
||||
|
||||
public final boolean isNamespaceAllowed(String namespace, final XmlFile file, boolean qualified) {
|
||||
if (myEqualToParent && qualified) {
|
||||
System.out.println();
|
||||
}
|
||||
return myNamespaceKey == null || myEqualToParent && !qualified || isNamespaceAllowed(namespace, getNamespaceList(file));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.swing.*;
|
||||
|
||||
public class DTDFileType extends LanguageFileType {
|
||||
private static final Icon ICON = IconLoader.getIcon("/fileTypes/dtd.png");
|
||||
public static final DTDFileType INSTANCE = new DTDFileType();
|
||||
|
||||
public DTDFileType() {
|
||||
super(DTDLanguage.INSTANCE);
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.intellij.ide.highlighter;
|
||||
|
||||
import com.intellij.codeInsight.editorActions.TypedHandler;
|
||||
import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.lang.xml.XMLLanguage;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
@@ -32,7 +31,6 @@ public class XmlFileType extends XmlLikeFileType implements DomSupportEnabled {
|
||||
|
||||
private XmlFileType() {
|
||||
super(XMLLanguage.INSTANCE);
|
||||
TypedHandler.registerBaseLanguageQuoteHandler(XMLLanguage.class, TypedHandler.getQuoteHandlerForType(this));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
*/
|
||||
package com.intellij.xml;
|
||||
|
||||
import com.intellij.codeInsight.editorActions.TypedHandler;
|
||||
import com.intellij.ide.highlighter.DTDFileType;
|
||||
import com.intellij.ide.highlighter.HtmlFileType;
|
||||
import com.intellij.ide.highlighter.XHtmlFileType;
|
||||
import com.intellij.ide.highlighter.XmlFileType;
|
||||
import com.intellij.lang.xml.XMLLanguage;
|
||||
import com.intellij.openapi.fileTypes.FileTypeConsumer;
|
||||
import com.intellij.openapi.fileTypes.FileTypeFactory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -30,8 +32,9 @@ public class XmlFileTypeFactory extends FileTypeFactory {
|
||||
public void createFileTypes(@NotNull final FileTypeConsumer consumer) {
|
||||
consumer.consume(HtmlFileType.INSTANCE, "html;htm;sht;shtm;shtml");
|
||||
consumer.consume(XHtmlFileType.INSTANCE, "xhtml");
|
||||
consumer.consume(new DTDFileType(), "dtd;ent;mod");
|
||||
consumer.consume(DTDFileType.INSTANCE, "dtd;ent;mod");
|
||||
|
||||
consumer.consume(XmlFileType.INSTANCE, "xml;xsd;tld;xsl;jnlp;wsdl;hs;jhm;ant;xul;xslt");
|
||||
TypedHandler.registerBaseLanguageQuoteHandler(XMLLanguage.class, TypedHandler.getQuoteHandlerForType(XmlFileType.INSTANCE));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user