MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / detectLanguage

Method detectLanguage

src/NotepadNextApplication.cpp:300–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300QString NotepadNextApplication::detectLanguage(ScintillaNext *editor) const
301{
302 qInfo(Q_FUNC_INFO);
303
304 QString language_name = QStringLiteral("Text");
305
306 if (editor->isFile()) {
307 language_name = detectLanguageFromExtension(editor->getFileInfo().suffix());
308 }
309
310 if (language_name == QStringLiteral("Text")) {
311 language_name = detectLanguageFromContents(editor);
312 }
313
314 return language_name;
315}
316
317QString NotepadNextApplication::detectLanguageFromExtension(const QString &extension) const
318{

Callers

nothing calls this directly

Calls 2

isFileMethod · 0.80
getFileInfoMethod · 0.80

Tested by

no test coverage detected