mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[structure-view] make LanguageFileTypeStructureViewBuilderProvider package private
GitOrigin-RevId: ad164c11ef7b2072b875037bce5843c7c5ab85e9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b8bec3f7ad
commit
92cff25bd9
@@ -1,22 +1,5 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
/*
|
||||
* @author max
|
||||
*/
|
||||
package com.intellij.ide.highlighter;
|
||||
|
||||
import com.intellij.ide.structureView.StructureViewBuilder;
|
||||
@@ -32,21 +15,19 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public class LanguageFileTypeStructureViewBuilderProvider implements StructureViewBuilderProvider {
|
||||
class LanguageFileTypeStructureViewBuilderProvider implements StructureViewBuilderProvider {
|
||||
@Override
|
||||
@Nullable
|
||||
public StructureViewBuilder getStructureViewBuilder(@NotNull final FileType fileType, @NotNull final VirtualFile file, @NotNull final Project project) {
|
||||
public StructureViewBuilder getStructureViewBuilder(@NotNull FileType fileType, @NotNull VirtualFile file, @NotNull Project project) {
|
||||
if (!(fileType instanceof LanguageFileType)) return null;
|
||||
|
||||
final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
|
||||
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
|
||||
if (psiFile == null) return null;
|
||||
|
||||
final PsiStructureViewFactory factory = LanguageStructureViewBuilder.getInstance().forLanguage(psiFile.getLanguage());
|
||||
PsiStructureViewFactory factory = LanguageStructureViewBuilder.getInstance().forLanguage(psiFile.getLanguage());
|
||||
if (factory == null) return null;
|
||||
StructureViewBuilder physicalBuilder = factory.getStructureViewBuilder(psiFile);
|
||||
if (!(physicalBuilder instanceof TreeBasedStructureViewBuilder treeBasedStructureViewBuilder)) return physicalBuilder;
|
||||
|
||||
Reference in New Issue
Block a user