- /*
- * Minecraft Development for IntelliJ
- *
- * https://mcdev.io/
- *
- * Copyright (C) 2024 minecraft-dev
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, version 3.0 only.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
- package com.demonwav.mcdev.nbt.lang
- import com.intellij.lang.Language
- import com.intellij.openapi.fileTypes.FileType
- import com.intellij.openapi.project.Project
- import com.intellij.openapi.vfs.VirtualFile
- import com.intellij.psi.FileViewProvider
- import com.intellij.psi.FileViewProviderFactory
- import com.intellij.psi.PsiFile
- import com.intellij.psi.PsiManager
- import com.intellij.psi.SingleRootFileViewProvider
- class NbttFileViewProvider(manager: PsiManager, file: VirtualFile, eventSystemEnabled: Boolean) :
- SingleRootFileViewProvider(manager, file, eventSystemEnabled, NbttLanguage) {
- override fun createFile(project: Project, file: VirtualFile, fileType: FileType): PsiFile = NbttFile(this)
- override fun createFile(file: VirtualFile, fileType: FileType, language: Language): PsiFile = NbttFile(this)
- override fun createFile(lang: Language): PsiFile = NbttFile(this)
- }
- class NbttFileViewProviderFactory : FileViewProviderFactory {
- override fun createFileViewProvider(
- file: VirtualFile,
- language: Language?,
- manager: PsiManager,
- eventSystemEnabled: Boolean
- ): FileViewProvider = NbttFileViewProvider(manager, file, eventSystemEnabled)
- }
- /*
- * Minecraft Development for IntelliJ
- *
- * https://mcdev.io/
- *
- * Copyright (C) 2025 minecraft-dev
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, version 3.0 only.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
- package com.demonwav.mcdev.nbt.lang
- import com.intellij.lang.Language
- import com.intellij.openapi.fileTypes.FileType
- import com.intellij.openapi.project.Project
- import com.intellij.openapi.vfs.VirtualFile
- import com.intellij.psi.FileViewProvider
- import com.intellij.psi.FileViewProviderFactory
- import com.intellij.psi.PsiFile
- import com.intellij.psi.PsiManager
- import com.intellij.psi.SingleRootFileViewProvider
- class NbttFileViewProvider(manager: PsiManager, file: VirtualFile, eventSystemEnabled: Boolean) :
- SingleRootFileViewProvider(manager, file, eventSystemEnabled, NbttLanguage) {
- override fun createFile(project: Project, file: VirtualFile, fileType: FileType): PsiFile = NbttFile(this)
- override fun createFile(file: VirtualFile, fileType: FileType, language: Language): PsiFile = NbttFile(this)
- override fun createFile(lang: Language): PsiFile = NbttFile(this)
- }
- class NbttFileViewProviderFactory : FileViewProviderFactory {
- override fun createFileViewProvider(
- file: VirtualFile,
- language: Language?,
- manager: PsiManager,
- eventSystemEnabled: Boolean
- ): FileViewProvider = NbttFileViewProvider(manager, file, eventSystemEnabled)
- }