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

Method detectLanguageFromExtension

src/NotepadNextApplication.cpp:317–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317QString NotepadNextApplication::detectLanguageFromExtension(const QString &extension) const
318{
319 qInfo(Q_FUNC_INFO);
320
321 getLuaState()->setVariable("ext", extension);
322
323 return getLuaState()->executeAndReturn<QString>(R"(
324 for name, L in pairs(languages) do
325 if L.extensions then
326 for _, v in ipairs(L.extensions) do
327 if v == ext then
328 return name
329 end
330 end
331 end
332 end
333 return "Text"
334 )");
335}
336
337QString NotepadNextApplication::detectLanguageFromContents(ScintillaNext *editor) const
338{

Callers

nothing calls this directly

Calls 1

setVariableMethod · 0.80

Tested by

no test coverage detected