Open Lordfirespeed opened 1 year ago
Specifically, the Ref<PsiElement>
can be Ref<null>
:boom:
However, TsExecuteUtil.isTypeScript(PsiFile)
does not accept nullable:
https://github.com/Lordfirespeed/intellij-typescript-run-configuration/blob/26db4921ba3e2638eb0f04b9936b3588099f42b1/src/main/kotlin/com/github/lordfirespeed/intellij_typescript_run_configuration/typescript/TSExecuteUtil.kt#L56-L60
I believe it should be sufficient to implement an overload isTypeScript(PsiFile?)
that null-checks before delegating to isTypeScript(PsiFile)
.
Also, quick sanity check: I copied this implementation from an old version of run configurations for Node or NPM or something.
Why am I using context.location
? Going off createConfigurationFromContext, it seems that the passed Ref<PsiElement>
is just the wrapped value of context.location
.