Extracted JetContentBasedFileSubstitutor.getDecompiledPsiFile() to separate extension point implementation, JetClsFileDecompiledPsiFileProvider.
This commit is contained in:
@@ -156,6 +156,7 @@
|
||||
|
||||
<contentBasedClassFileProcessor implementation="org.jetbrains.jet.plugin.libraries.JetContentBasedFileSubstitutor" />
|
||||
<psi.clsCustomNavigationPolicy implementation="org.jetbrains.jet.plugin.libraries.JetClsNavigationPolicy" />
|
||||
<psi.clsDecompiledFileProvider implementation="org.jetbrains.jet.plugin.libraries.JetClsFileDecompiledPsiFileProvider" />
|
||||
|
||||
<editorNotificationProvider implementation="org.jetbrains.jet.plugin.quickfix.ConfigureKotlinLibraryNotificationProvider"/>
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2010-2012 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.jet.plugin.libraries;
|
||||
|
||||
import com.intellij.psi.ClsFileDecompiledPsiFileProvider;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiJavaFile;
|
||||
import com.intellij.psi.impl.compiled.ClsFileImpl;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Evgeny Gerashchenko
|
||||
* @since 3/20/12
|
||||
*/
|
||||
public class JetClsFileDecompiledPsiFileProvider implements ClsFileDecompiledPsiFileProvider {
|
||||
@Nullable
|
||||
@Override
|
||||
public PsiFile getDecompiledPsiFile(@NotNull PsiJavaFile psiFile) {
|
||||
return JetDecompiledData.getDecompiledData((ClsFileImpl) psiFile).getJetFile();
|
||||
}
|
||||
}
|
||||
@@ -59,10 +59,5 @@ public class JetContentBasedFileSubstitutor implements ContentBasedClassFileProc
|
||||
public SyntaxHighlighter createHighlighter(Project project, VirtualFile vFile) {
|
||||
return new JetHighlighter();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PsiFile getDecompiledPsiFile(PsiFile psiFile) {
|
||||
return JetDecompiledData.getDecompiledData((ClsFileImpl) psiFile).getJetFile();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user