Minor. Renamed fields, optimized imports, added 'final'.
This commit is contained in:
@@ -23,7 +23,6 @@ import com.intellij.openapi.fileTypes.SyntaxHighlighter;
|
|||||||
import com.intellij.openapi.project.DumbService;
|
import com.intellij.openapi.project.DumbService;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.vfs.VirtualFile;
|
import com.intellij.openapi.vfs.VirtualFile;
|
||||||
import com.intellij.psi.PsiFile;
|
|
||||||
import com.intellij.psi.impl.compiled.ClsFileImpl;
|
import com.intellij.psi.impl.compiled.ClsFileImpl;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|||||||
@@ -37,23 +37,23 @@ import java.util.Set;
|
|||||||
* @since 3/2/12
|
* @since 3/2/12
|
||||||
*/
|
*/
|
||||||
class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileViewProvider {
|
class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileViewProvider {
|
||||||
private String myText;
|
private final String text;
|
||||||
private final PsiManager myManager;
|
private final PsiManager manager;
|
||||||
private JetFile myJetFile = null;
|
private JetFile jetFile = null;
|
||||||
private final VirtualFile myVirtualFile;
|
private final VirtualFile virtualFile;
|
||||||
|
|
||||||
public JetDummyClassFileViewProvider(@NotNull PsiManager manager, @NotNull VirtualFile file, String text) {
|
public JetDummyClassFileViewProvider(@NotNull PsiManager manager, @NotNull VirtualFile file, String text) {
|
||||||
myManager = manager;
|
this.manager = manager;
|
||||||
myVirtualFile = file;
|
virtualFile = file;
|
||||||
myText = text;
|
this.text = text;
|
||||||
|
|
||||||
myJetFile = new JetFile(this);
|
jetFile = new JetFile(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public PsiManager getManager() {
|
public PsiManager getManager() {
|
||||||
return myManager;
|
return manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -65,13 +65,13 @@ class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileVi
|
|||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public String getContents() {
|
public String getContents() {
|
||||||
return myText;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public VirtualFile getVirtualFile() {
|
public VirtualFile getVirtualFile() {
|
||||||
return myVirtualFile;
|
return virtualFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,13 +91,13 @@ class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileVi
|
|||||||
if (JetLanguage.INSTANCE != target) {
|
if (JetLanguage.INSTANCE != target) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return myJetFile;
|
return jetFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public List<PsiFile> getAllFiles() {
|
public List<PsiFile> getAllFiles() {
|
||||||
return Collections.<PsiFile>singletonList(myJetFile);
|
return Collections.<PsiFile>singletonList(jetFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -159,7 +159,7 @@ class JetDummyClassFileViewProvider extends UserDataHolderBase implements FileVi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PsiElement findElementAt(final int offset) {
|
public PsiElement findElementAt(final int offset) {
|
||||||
LeafElement element = myJetFile.calcTreeElement().findLeafElementAt(offset);
|
LeafElement element = jetFile.calcTreeElement().findLeafElementAt(offset);
|
||||||
return element != null ? element.getPsi() : null;
|
return element != null ? element.getPsi() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user