| 7 | namespace QodeAssist::Context { |
| 8 | |
| 9 | ProgrammingLanguage ProgrammingLanguageUtils::fromMimeType(const QString &mimeType) |
| 10 | { |
| 11 | if (mimeType == "text/x-qml" || mimeType == "application/javascript" |
| 12 | || mimeType == "text/javascript" || mimeType == "text/x-javascript") { |
| 13 | return ProgrammingLanguage::QML; |
| 14 | } |
| 15 | if (mimeType == "text/x-c++src" || mimeType == "text/x-c++hdr" || mimeType == "text/x-csrc" |
| 16 | || mimeType == "text/x-chdr") { |
| 17 | return ProgrammingLanguage::Cpp; |
| 18 | } |
| 19 | if (mimeType == "text/x-python") { |
| 20 | return ProgrammingLanguage::Python; |
| 21 | } |
| 22 | return ProgrammingLanguage::Unknown; |
| 23 | } |
| 24 | |
| 25 | QString ProgrammingLanguageUtils::toString(ProgrammingLanguage language) |
| 26 | { |
nothing calls this directly
no outgoing calls
no test coverage detected