Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
correct isCloudFormationFile, check psiFile too
Browse files Browse the repository at this point in the history
  • Loading branch information
shalupov committed Apr 27, 2018
1 parent 2a1fb6c commit 0d5e9bd
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.intellij.aws.cloudformation.model.CfnNamedNode
import com.intellij.aws.cloudformation.model.CfnNode
import com.intellij.aws.cloudformation.model.CfnScalarValueNode
import com.intellij.json.JsonFileType
import com.intellij.json.psi.JsonFile
import com.intellij.json.psi.JsonObject
import com.intellij.lang.injection.InjectedLanguageManager
import com.intellij.psi.PsiDocumentManager
Expand Down Expand Up @@ -72,6 +73,9 @@ fun YAMLValue.getFirstTag() = when {
object CloudFormationPsiUtils {
fun isCloudFormationFile(element: PsiElement): Boolean {
val psiFile = element.containingFile
if (psiFile !is JsonFile && psiFile !is YAMLFile) {
return false
}

val fileType = psiFile.viewProvider.fileType

Expand Down

0 comments on commit 0d5e9bd

Please sign in to comment.