Skip to content

Plugin reports typing in C file using PhpStorm as Plain text

Indeed PhpStorm is not intended to work with C files, I get that. But still, reporting language stats should ideally not depend on the editor in use. It recognises C files, it has syntax highlighting, so I thought it'd be okay. I'm not sure if it is an IDE issue or plugin issue. But anyway, title says it.

Out of curiosity I've also tried to explicitly override the file type in the IDE to c++, typed a bit, still reported as Plain Text. Than I've overridden the same file to PHP, typed a bit and it was reported as PHP.

So my guess is that this line GenericHandler.java#L18 receives this info from the IDE, but on one hand I cannot confirm that (not sure how to debug the IDE itself), but it sounds bizarre for the IDE to report a known file type as plain text, just because it is not one of the main languages of the given IDE variant, but also I am wondering if the plugin could rather than querying the active code inspection language (which could explain "plain Text" because PhpStorm indeed cannot analyse C code) could the plugin get the active syntax highlighting language instead? Or at least as a second try if the IDE reports "Plain Text" in the first place?

Info:

PhpStorm 2024.3.5 Build #PS-243.26053.13, built on March 12, 2025 Runtime version: 21.0.6+8-b631.39 aarch64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 15.4.1

Code Stats Plugin: v1.0.9

My profile: https://codestats.net/users/sbnc (In the lest few days pretty much all the plain text you can see was supposed to be C)

Let me know If I should provide more info.

Edited by Bence Szalai