codesheet.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. #include "sheets/codesheet.h"
  2. #include "widgets/codeeditor.h"
  3. #include "widgets/codesearchbar.h"
  4. #include "windows/rememberdialog.h"
  5. #include "windows/progressdialog.h"
  6. #include "base/application.h"
  7. #include <KSyntaxHighlighting/Definition>
  8. #include <KSyntaxHighlighting/DefinitionDownloader>
  9. #include <QAbstractButton>
  10. #include <QAction>
  11. #include <QBoxLayout>
  12. #include <QFileInfo>
  13. #include <QPushButton>
  14. #include <QRegularExpression>
  15. #include <QScrollBar>
  16. #include <QTextCodec>
  17. CodeSheet::CodeSheet(const ResourceModelIndex &index, QWidget *parent)
  18. : BaseFileSheet(index, parent)
  19. {
  20. filePath = index.path();
  21. QString sheetTitle = filePath.section('/', -2);
  22. QRegularExpression guid("^{\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12}}");
  23. if (guid.match(sheetTitle).hasMatch()) {
  24. sheetTitle = sheetTitle.split('/').last();
  25. }
  26. setSheetTitle(sheetTitle);
  27. btnDownloadDefinitions = new QPushButton(this);
  28. btnDownloadDefinitions->hide();
  29. connect(btnDownloadDefinitions, &QPushButton::clicked, this, &CodeSheet::downloadDefinitions);
  30. editor = new CodeEditor(this);
  31. editor->setCenterOnScroll(true);
  32. const auto definition = app->highlightingRepository.definitionForFileName(filePath);
  33. if (definition.isValid()) {
  34. editor->setDefinition(definition);
  35. } else {
  36. checkFormatSupport();
  37. }
  38. searchBar = new CodeSearchBar(editor);
  39. connect(editor, &CodeEditor::searchFinished, searchBar, &CodeSearchBar::setResults);
  40. auto statusBar = new QHBoxLayout;
  41. statusBar->addWidget(btnDownloadDefinitions);
  42. auto layout = new QVBoxLayout(this);
  43. layout->addWidget(editor);
  44. layout->addWidget(searchBar);
  45. layout->addLayout(statusBar);
  46. layout->setMargin(0);
  47. layout->setSpacing(0);
  48. load();
  49. connect(editor, &QPlainTextEdit::modificationChanged, this, &CodeSheet::setModified);
  50. // Initialize actions:
  51. addActionSeparator();
  52. auto actionWordWrap = app->actions.getWordWrap(this);
  53. actionWordWrap->setChecked(editor->getWordWrap());
  54. addAction(actionWordWrap);
  55. connect(actionWordWrap, &QAction::triggered, editor, &CodeEditor::setWordWrap);
  56. addActionSeparator();
  57. auto actionFind = app->actions.getFind(this);
  58. addAction(actionFind);
  59. connect(actionFind, &QAction::triggered, this, &CodeSheet::findSelectedText);
  60. auto actionFindNext = app->actions.getFindNext(this);
  61. addAction(actionFindNext);
  62. connect(actionFindNext, &QAction::triggered, this, [=]() {
  63. searchBar->show();
  64. editor->nextSearchQuery();
  65. });
  66. auto actionFindPrevious = app->actions.getFindPrevious(this);
  67. addAction(actionFindPrevious);
  68. connect(actionFindPrevious, &QAction::triggered, this, [=]() {
  69. searchBar->show();
  70. editor->prevSearchQuery();
  71. });
  72. auto actionReplace = app->actions.getReplace(this);
  73. addAction(actionReplace);
  74. connect(actionReplace, &QAction::triggered, this, &CodeSheet::replaceSelectedText);
  75. retranslate();
  76. }
  77. bool CodeSheet::load()
  78. {
  79. QFile file(index.path());
  80. if (file.open(QFile::ReadOnly)) {
  81. QTextStream stream(&file);
  82. stream.setCodec("UTF-8"); // Fallback if no codec is detected on further read
  83. auto cursor = editor->textCursor();
  84. const int selectionStart = cursor.selectionStart();
  85. const int selectionEnd = cursor.selectionEnd();
  86. const int scrollPosition = editor->verticalScrollBar()->value();
  87. editor->setPlainText(stream.readAll());
  88. codec = stream.codec(); // Qt automatically deletes the codec on exit
  89. cursor.setPosition(selectionStart);
  90. cursor.setPosition(selectionEnd, QTextCursor::KeepAnchor);
  91. editor->setTextCursor(cursor);
  92. editor->verticalScrollBar()->setValue(scrollPosition);
  93. setModified(false);
  94. return true;
  95. }
  96. qWarning() << "Error: Could not open code resource file";
  97. return false;
  98. }
  99. bool CodeSheet::save(const QString &as)
  100. {
  101. QFile file(as.isEmpty() ? index.path() : as);
  102. if (file.open(QFile::WriteOnly)) {
  103. file.resize(0);
  104. QTextStream stream(&file);
  105. stream.setCodec(codec);
  106. stream.setGenerateByteOrderMark(codec->name() != "UTF-8");
  107. stream << editor->toPlainText();
  108. if (as.isEmpty()) {
  109. setModified(false);
  110. emit saved();
  111. }
  112. return true;
  113. }
  114. qWarning() << "Error: Could not save code resource file";
  115. return false;
  116. }
  117. void CodeSheet::setTextCursor(int lineNumber, int columnNumber, int selectionLength)
  118. {
  119. auto cursor = editor->textCursor();
  120. cursor.movePosition(QTextCursor::Start);
  121. cursor.movePosition(QTextCursor::NextBlock, QTextCursor::MoveAnchor, lineNumber - 1);
  122. cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::MoveAnchor, columnNumber);
  123. if (selectionLength > 0) {
  124. cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, selectionLength);
  125. }
  126. editor->setTextCursor(cursor);
  127. }
  128. void CodeSheet::changeEvent(QEvent *event)
  129. {
  130. if (event->type() == QEvent::LanguageChange) {
  131. retranslate();
  132. }
  133. BaseSheet::changeEvent(event);
  134. }
  135. void CodeSheet::keyPressEvent(QKeyEvent *event)
  136. {
  137. if (event->key() == Qt::Key_Escape) {
  138. searchBar->hide();
  139. }
  140. BaseFileSheet::keyPressEvent(event);
  141. }
  142. void CodeSheet::findSelectedText()
  143. {
  144. auto cursor = editor->textCursor();
  145. if (!cursor.hasSelection()) {
  146. cursor.select(QTextCursor::WordUnderCursor);
  147. }
  148. const auto selection(cursor.selectedText());
  149. cursor.setPosition(cursor.selectionStart()); // Move to the beginning of the selection and clear it
  150. editor->setTextCursor(cursor);
  151. searchBar->setFindText(selection);
  152. searchBar->show();
  153. searchBar->focusFindBar();
  154. }
  155. void CodeSheet::replaceSelectedText()
  156. {
  157. const auto selection = editor->textCursor().selectedText();
  158. searchBar->show();
  159. searchBar->showReplaceBar();
  160. if (selection.isEmpty()) {
  161. searchBar->focusFindBar();
  162. } else {
  163. searchBar->setFindText(selection);
  164. searchBar->focusReplaceBar();
  165. }
  166. }
  167. void CodeSheet::checkFormatSupport()
  168. {
  169. const auto fileName = QFileInfo(filePath).fileName();
  170. for (const auto &extension : supportedExtensions()) {
  171. auto regex = QRegularExpression::wildcardToRegularExpression(extension);
  172. if (QRegularExpression(regex).match(fileName).hasMatch()) {
  173. const QString question(tr("Would you like to download syntax definitions for this and other formats?"));
  174. if (RememberDialog::ask("download-syntax-definitions", question, this)) {
  175. downloadDefinitions();
  176. } else {
  177. btnDownloadDefinitions->show();
  178. }
  179. break;
  180. }
  181. }
  182. }
  183. void CodeSheet::downloadDefinitions()
  184. {
  185. auto progressDialog = new ProgressDialog(this);
  186. progressDialog->setPrimaryText(tr("Downloading syntax definitions..."));
  187. progressDialog->setCancelEnabled(false);
  188. progressDialog->show();
  189. auto downloader = new KSyntaxHighlighting::DefinitionDownloader(&app->highlightingRepository);
  190. connect(downloader, &KSyntaxHighlighting::DefinitionDownloader::informationMessage, [progressDialog](const QString &message) {
  191. qDebug() << message;
  192. });
  193. connect(downloader, &KSyntaxHighlighting::DefinitionDownloader::done, this, [=]() {
  194. editor->setDefinition(app->highlightingRepository.definitionForFileName(filePath));
  195. btnDownloadDefinitions->hide();
  196. downloader->deleteLater();
  197. progressDialog->deleteLater();
  198. });
  199. downloader->start();
  200. }
  201. void CodeSheet::retranslate()
  202. {
  203. btnDownloadDefinitions->setText(tr("Download Syntax Definitions"));
  204. }
  205. QStringList CodeSheet::supportedExtensions() const
  206. {
  207. return {
  208. "*.mustache", "*.handlebars", "*.hbs", "*.ractive", "*.hogan", "*.hulk", "*.html.mst", "*.html.mu", "*.html.rac",
  209. "*.kbasic",
  210. "*.per", "*.PER", "*.per.err",
  211. "*.csv",
  212. "*.xul", "*.xbl",
  213. "*.bat",
  214. "*.c++", "*.cxx", "*.cpp", "*.cc", "*.C", "*.h", "*.hh", "*.H", "*.h++", "*.hxx", "*.hpp", "*.hcc",
  215. "*.clist", "*.CLIST",
  216. "*.mll",
  217. "*.mtt",
  218. "*.k",
  219. "*.dtd",
  220. "*.reg",
  221. "*.pb", "*.pbi",
  222. "*.sql", "*.SQL", "*.ddl", "*.DDL",
  223. "*.supp",
  224. "*.asm",
  225. "*.ll",
  226. "*.prg", "*.PRG", "*.ch",
  227. "*.abc", "*.ABC",
  228. "*.scss",
  229. "*.graphql",
  230. "*.dat",
  231. "*.jira",
  232. "*.html",
  233. "*.sa",
  234. "*.oors",
  235. "*.stl",
  236. "*.cfg",
  237. "*.kt", "*.kts",
  238. "*.vhdl", "*.vhd",
  239. "*.dart",
  240. "*.jsp", "*.JSP",
  241. "*.eml", "*.email", "*.emlx", "*.mbox", "*.mbx",
  242. "*.c", "*.C", "*.h",
  243. "*.mod", "*.def",
  244. "*.idr",
  245. "*.clj", "*.cljs", "*.cljc",
  246. "*.php", "*.php3", "*.wml", "*.phtml", "*.phtm", "*.inc", "*.ctp",
  247. "*.cfg",
  248. "*.mab", "*.MAB", "*.Mab",
  249. "*.pro", "*.pri", "*.prf",
  250. "*.vtc",
  251. "*.e",
  252. "*.sv", "*.svh",
  253. "*.asm",
  254. "*.tsx",
  255. "*.nsi",
  256. "Jam*", "*.jam",
  257. "*.lgt", ".logtalk",
  258. "*.d", "*.D", "*.di", "*.DI",
  259. "*.lua", "*.rockspec",
  260. "changelog",
  261. "*.curry",
  262. "*.raku", "*.rakumod", "*.rakudoc", "*.rakutest", "*.pl6", "*.PL6", "*.p6", "*.pm6", "*.pod6",
  263. "*.java",
  264. "*.desktop", "*.kdelnk", "*.desktop.cmake",
  265. "Kconfig*", "Config.*",
  266. "*.t2t",
  267. "fstab", "mtab",
  268. "*.ad", "*.adoc", "*.asciidoc",
  269. "*.tex", "*.ltx", "*.dtx", "*.sty", "*.cls", "*.bbx", "*.cbx", "*.lbx", "*.tikz", "*.pgf",
  270. "*.sql", "*.SQL", "*.ddl", "*.DDL",
  271. "*.go",
  272. "*.csv",
  273. "*.css",
  274. "*.aff",
  275. "*.lcurry",
  276. "*.js", "*.mjs", "*.cjs", "*.kwinscript", "*.julius",
  277. "*.btm",
  278. "*.vala",
  279. "*.4th", "*.4TH", "*.f", "*.F", "*.frt", "*.FRT", "*.fs", "*.FS", "*.fth", "*.FTH", "*.seq", "*.SEQ",
  280. "*.adb", "*.ads", "*.ada", "*.a",
  281. "*.rng", "*.RNG",
  282. "*.erl",
  283. "*.asm", "*.inc", "*.ASM", "*.INC",
  284. "*.mml",
  285. "*.yang",
  286. "*.replicode",
  287. "*.w", "*.nw",
  288. "*.as",
  289. "*.mm", "*.M", "*.h",
  290. "*.f", "*.F", "*.for", "*.FOR", "*.fpp", "*.FPP",
  291. "*.m3", "*.i3", "*.ig", "*.mg",
  292. "*.s", "*.i", "*.S", "*.I",
  293. "*.sql", "*.SQL", "*.ddl", "*.DDL", "*.trg", "*.TRG", "*.spc", "*.SPC", "*.bdy", "*.DBY",
  294. "*.purs",
  295. "*.do", "*.ado", "*.doh", "*.DO", "*.ADO", "*.DOH",
  296. "*.mod", "*.def",
  297. "*.m3u",
  298. "*.sh", "*.zsh", ".zshrc", ".zprofile", ".zlogin", ".zlogout", ".profile",
  299. "*.mod", "*.def",
  300. "*.inf", "*.h",
  301. "*.dic",
  302. "*.tig",
  303. "*.obj",
  304. ".kdesrc-buildrc", "kdesrc-buildrc",
  305. "*.rtf",
  306. "*.gdf",
  307. "*.pug", "*.jade",
  308. "*.properties",
  309. "*.sed",
  310. "*.p", "*.w", "*.i", "*.cls",
  311. "*.c++", "*.cxx", "*.cpp", "*.cc", "*.C", "*.h", "*.hh", "*.H", "*.h++", "*.hxx", "*.hpp", "*.hcc", "*.moc",
  312. "*.mup", "*.not",
  313. "*.v", "*.V", "*.vl",
  314. "*.logcat",
  315. "*.s",
  316. "*.vcl",
  317. "*.sci", "*.sce",
  318. "QRPG*.*", "qrpg*.*",
  319. "*.tf",
  320. "*.mod", "*.def",
  321. "*.prolog", "*.dcg", "*.pro",
  322. "*.pp",
  323. "*.n",
  324. "*.znn",
  325. "*.dot",
  326. "*.p", "*.pas", "*.pp",
  327. "*.1", "*.2", "*.3", "*.4", "*.5", "*.6", "*.7", "*.8", "*.1m", "*.3x", "*.tmac",
  328. "*.kcrash", "*.crash", "*.bt",
  329. "*.proto",
  330. "*.s", "*.S",
  331. "*.elm",
  332. "*.bib",
  333. "*.feature",
  334. "*.gdb",
  335. "*.texi",
  336. "*.cg", "*.cgfx",
  337. "*.hs", "*.chs", "*.hs-boot",
  338. "*.rib",
  339. "*.rs",
  340. "*.crk",
  341. "*.sp", "*.hsp",
  342. "*.nb",
  343. "*.tt*",
  344. "*.org",
  345. "*.ample", "*.menu", "*.startup",
  346. "*.less",
  347. "*.bb", "*.bbappend", "*.bbclass", "*.inc",
  348. "*.boo",
  349. "*.idl",
  350. "*.fe", "*.feh",
  351. "*.te", "*.if", "*.spt", "policy.conf", "access_vectors", "mls", "mcs", "mls_macros", "te_macros", "policy_capabilities", "seapp_contexts", "port_contexts",
  352. "*.haml",
  353. "*.pike",
  354. "*.qml", "*.qmltypes",
  355. "GNUmakefile", "Makefile", "makefile", "GNUmakefile.*", "Makefile.*", "makefile.*", "*.mk",
  356. "*.mako", "*.mak",
  357. "*.awk",
  358. "Dockerfile",
  359. "*.cfg", "*.pbl", "*.CFG", "*.PBL",
  360. "*.ninja",
  361. "*.htm", "*.html",
  362. "*.m4",
  363. "*.rkt", "*.scrbl",
  364. "*.cis",
  365. "*.mediawiki",
  366. "*.textile",
  367. "*.jl",
  368. "*.ldif",
  369. "*.hex", "*.ihx",
  370. "*.csv",
  371. "*.diff", "*patch", "*.rej",
  372. "*.g",
  373. "*.Rd",
  374. "Cakefile", "*.coffee", "*.coco", "*.cson",
  375. "gitolite.conf",
  376. "*.iss",
  377. "*.mch", "*.imp", "*.ref",
  378. "Doxyfile", "Doxyfile.*",
  379. "*.py", "*.pyw", "*.pyi", "SConstruct", "SConscript", "*.FCMacro",
  380. "*.iCal", "*.iCalendar", ".ics", "*.ifb", "*.iFBf", "*.vcal", "*.vcalendar", "*.vcard", "*.vcf",
  381. "*.asn", "*.asn1",
  382. "*.ftl",
  383. "*.pgn", "*.PGN",
  384. "*.md", "*.mmd", "*.markdown",
  385. "*.hamlet",
  386. "*.vb",
  387. "*.sst", "*.ssm", "*.ssi", "*._sst", "*.-sst",
  388. "*.ys",
  389. "*.rqb",
  390. "*.glsl", "*.vert", "*.vs", "*.frag", "*.fs", "*.geom", "*.gs", "*.tcs", "*.tes",
  391. "*.swift",
  392. "*.sgml",
  393. "*.nc",
  394. "*.fbs",
  395. "*.toml",
  396. "*.cp", "*.bro",
  397. "*.inc", "*.pov",
  398. "*.pl", "*.PL", "*.pm",
  399. "meson.build", "meson_options.txt",
  400. "*.vr", "*.vri", "*.vrh",
  401. "*.agda",
  402. "*.rnc",
  403. "*.c++", "*.cxx", "*.cpp", "*.cc", "*.C", "*.cu", "*.h", "*.hh", "*.H", "*.h++", "*.hxx", "*.hpp", "*.hcc", "*.cuh", "*.inl", "*.ino", "*.pde", "*.moc",
  404. "*.gnuplot", "*.gp", "*.gplt", "*.plt",
  405. "*.ml", "*.mli",
  406. "*.cfg",
  407. "*.nim", "*.nims", "*.nimble",
  408. "*.jsx",
  409. "*.c++", "*.cxx", "*.cpp", "*.cc", "*.C", "*.h", "*.hh", "*.H", "*.h++", "*.hxx", "*.hpp", "*.hcc", "*.moc",
  410. "ChangeLog",
  411. "*.sass",
  412. "git-rebase-todo",
  413. "*.ctx", "*.mkiv", "*.mkvi", "*.mkxl", "*.mklx",
  414. "*.nix",
  415. "*.idx",
  416. "*.cs", "*.ashx",
  417. "*.vm",
  418. "*.m", "*.h",
  419. "*.fastq", "*.fq", "*.fastq.gz", "*.fq.gz",
  420. "*.abap", "*.ABAP",
  421. "*.vcc",
  422. "*.fish", "fishd.*",
  423. "*.l", "*.lex", "*.flex",
  424. "*.srt",
  425. "*.stan", "*.stanfunctions",
  426. "*.ini", "*.pls", "*.kcfgc", ".gitattributes*", ".gitconfig*", ".gitmodules*", ".editorconfig*",
  427. "*.octave", "*.m", "*.M",
  428. "*.bas", "*.bi", "*.BAS", "*.BI",
  429. "*.cl",
  430. "*.rules", "*.snort", "*.suricata",
  431. "*.prg", "*.PRG", "*.ch",
  432. "*.csh", "*.tcsh", "csh.cshrc", "csh.login", ".tcshrc", ".cshrc", ".login",
  433. "*.asm", "*.ASM", "*.asm-avr",
  434. "*.cfg",
  435. "*.fc", "file_contexts", "file_contexts_*", "file_contexts.local", "file_contexts.homedirs", "file_contexts.template", "homedir_template", "property_contexts", "service_contexts", "hwservice_contexts", "initial_sid_contexts", "genfs_contexts", "fs_use",
  436. "*.sh", "*.bash", "*.ebuild", "*.eclass", "*.exlib", "*.exheres-0", ".bashrc", ".bash_profile", ".bash_login", ".profile", "PKGBUILD", "APKBUILD",
  437. "*.dox", "*.doxygen",
  438. "*.cue",
  439. "*.yar", "*.yara",
  440. "usr.bin.*", "usr.sbin.*", "bin.*", "sbin.*", "usr.lib.*", "usr.lib64.*", "usr.lib32.*", "usr.libx32.*", "usr.libexec.*", "usr.local.bin.*", "usr.local.sbin.*", "usr.local.lib*", "opt.*", "etc.cron.*", "snap.*", "snap-update-ns.*", "snap-confine.*",
  441. "*.brs",
  442. "*.ahk", "*.iahk",
  443. "todo.txt",
  444. "*.automount", "*.device", "*.mount", "*.path", "*.service", "*.slice", "*.socket", "*.swap", "*.target", "*.timer",
  445. "xorg.conf",
  446. "*.asm", "*.inc", "*.fasm",
  447. "*.mapcss",
  448. "*.lsl",
  449. "*.lhs",
  450. "*.Praat", "*.praat", "*.psc", "*.praat-script", "*.praatscript", "*.proc",
  451. "*.tcl", "*.tk",
  452. "*.gd", "*.gi", "*.g",
  453. "*.retro",
  454. "*.ps1", "*.psm1", "*.psd1",
  455. "*.rmd", "*.Rmd", "*.RMD",
  456. "*.ahdl", "*.tdf",
  457. "*.sml", "*.ml",
  458. "*.ijs", "*.ijt", "*.IJS", "*.IJT",
  459. "*.overpassql",
  460. "*.rpy",
  461. "*.sol",
  462. "*.gd",
  463. "*.4gl", "*.4GL", "*.err",
  464. "*.mm",
  465. "*.mp", "*.mps", "*.mpost", "*.mf",
  466. "*.fs", "*.fsi", "*.fsx",
  467. "*.groovy", "*.gradle", "*.gvy", "Jenkinsfile",
  468. "*.po", "*.pot",
  469. "*.hx", "*.Hx", "*.hX", "*.HX",
  470. "*.ngc", "*.gcode",
  471. "*.mib",
  472. "*.pro",
  473. "*.scm", "*.ss", "*.scheme", "*.guile", "*.chicken", "*.meta",
  474. "*.wrl",
  475. "*.json", ".kateproject", ".arcconfig", "*.geojson", "*.gltf", "*.theme",
  476. "*.tjp", "*.tji",
  477. "*.pony",
  478. "*.gdl", "*.vcg", "*.GDL", "*.VCG",
  479. "*.qdocconf",
  480. "*.cil",
  481. "*.pig",
  482. "*.src", "*.SRC", "*.asm", "*.ASM", "*.pic", "*.PIC",
  483. "*.ps", "*.ai", "*.eps",
  484. "*.f90", "*.F90", "*.f95", "*.F95", "*.f03", "*.F03", "*.f08", "*.F08",
  485. "*.dats", "*.sats", "*.hats",
  486. "*.uc",
  487. "*.spec",
  488. "*.t", "*.h",
  489. "*.ftl",
  490. "*.mel",
  491. "*.mss",
  492. "*.sql", "*.SQL", "*.ddl", "*.DDL",
  493. "*.cr",
  494. "*.q",
  495. "*.ex", "*.exs", "*.eex", "*.xml.eex", "*.js.eex",
  496. "*.tsv", "*.tab",
  497. "*.mo",
  498. "*.ccss",
  499. "*.ppd",
  500. "*.mac", "*.MAC", "*.dem", "*.DEM",
  501. "*.cfm", "*.cfc", "*.cfml", "*.dbm",
  502. "*.ts", "*.mts", "*.cts",
  503. "*.csv",
  504. ".gitignore*",
  505. "*.R", "*.r", "*.S", "*.s", "*.q",
  506. "*.ly", "*.LY", "*.ily", "*.ILY", "*.lyi", "*.LYI",
  507. "*.mly",
  508. "*.gdbinit",
  509. "control",
  510. "*.ld",
  511. "*.xsl", "*.xslt",
  512. "*.rhtml", "*.RHTML", "*.html.erb",
  513. "*.pure",
  514. "*.pli", "*.pl1",
  515. "httpd.conf", "httpd2.conf", "apache.conf", "apache2.conf", ".htaccess*", ".htpasswd*",
  516. "*.rst",
  517. "*.e", "*.ex", "*.exw", "*.exu",
  518. "*.rex", "*.rx", "*.rexx",
  519. "*.rb", "*.rjs", "*.rxml", "*.xml.erb", "*.js.erb", "*.rake", "Rakefile", "Gemfile", "*.gemspec", "Vagrantfile",
  520. "*.e",
  521. "*.JCL", "*.jcl",
  522. "*.ply",
  523. "*.ans",
  524. "*.c", "*.h", "*.inc", "*.o",
  525. "*.m", "*.M",
  526. "*.asp",
  527. "*.m", "*.mag",
  528. "*.y", "*.yy", "*.ypp", "*.y++",
  529. "*.lisp", "*.cl", "*.lsp", "*.el",
  530. "*.il",
  531. "CMakeLists.txt", "*.cmake", "*.cmake.in",
  532. "*.cgis",
  533. "*.c", "*.C", "*.h",
  534. "*.siv", "*.sieve",
  535. "*.scad",
  536. "*.scala", "*.sbt",
  537. "*.impl", "*.sign",
  538. };
  539. }