Skip to content

Commit

Permalink
feat(preview panel): switch to AsyncAPISpecificationRecognizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Sep 20, 2024
1 parent 9de3112 commit fe7a688
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 141 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package com.asyncapi.plugin.idea.extensions.editor.preview

import com.asyncapi.plugin.idea._core.AsyncAPISchemaRecognizer
import com.asyncapi.plugin.idea._core.AsyncAPISpecificationRecognizer
import com.intellij.openapi.components.service
import com.intellij.openapi.fileEditor.FileDocumentManager
import com.intellij.openapi.fileEditor.FileEditor
import com.intellij.openapi.fileEditor.FileEditorPolicy
import com.intellij.openapi.fileEditor.WeighedFileEditorProvider
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiManager

class AsyncAPIPreviewEditorProvider: WeighedFileEditorProvider() {

private val asyncAPISchemaRecognizer = service<AsyncAPISchemaRecognizer>()
private val asyncAPISpecificationRecognizer = service<AsyncAPISpecificationRecognizer>()

override fun accept(project: Project, file: VirtualFile): Boolean {
return asyncAPISchemaRecognizer.isSchema(project, file)
return asyncAPISpecificationRecognizer.isSpecification(PsiManager.getInstance(project).findFile(file))
}

override fun createEditor(project: Project, file: VirtualFile): FileEditor {
Expand Down

This file was deleted.

0 comments on commit fe7a688

Please sign in to comment.