Phase 0: strip JetBrains template, register Jai language and file type

- delete demo tool window + message bundle, rewrite plugin.xml metadata
- add JaiLanguage, JaiFileType, file icon, JaiTokenTypes (from the compiler's
  own lexer: modules/Jai_Lexer/module.jai)
- add ./jaitest: runs tests and reports the JUnit XML, not just the exit code
- ignore .kotlin
This commit is contained in:
hgranthorner
2026-08-04 10:19:11 -04:00
parent cb5a1d9555
commit 711334885b
11 changed files with 510 additions and 81 deletions

View File

@@ -0,0 +1,25 @@
package dev.hgh.jai
import com.intellij.openapi.fileTypes.FileTypeManager
import com.intellij.testFramework.fixtures.BasePlatformTestCase
/**
* Verifies plugin.xml wiring: the `.jai` extension resolves to our file type and
* our language, without launching an IDE.
*/
class JaiFileTypeTest : BasePlatformTestCase() {
fun testJaiExtensionIsRegistered() {
val type = FileTypeManager.getInstance().getFileTypeByExtension("jai")
assertEquals(JaiFileType, type)
}
/**
* The *virtual* file already resolves to our type. The PSI file's language stays
* plain text until a ParserDefinition is registered (phase 3) — asserting that here
* would be asserting the platform's fallback, not our wiring.
*/
fun testVirtualFileUsesJaiFileType() {
val file = myFixture.configureByText("sample.jai", "main :: () { }")
assertEquals(JaiFileType, file.virtualFile.fileType)
}
}