Skip to content

Commit 9d9b440

Browse files
committed
Enabled syntax highlighting for Groovy programming language.
1 parent c86e58c commit 9d9b440

File tree

9 files changed

+88
-59
lines changed

9 files changed

+88
-59
lines changed

FileList.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ bool IsTextFile(CString strFilePath)
136136
(_tcsicmp(lpszExtension, _T(".css")) == 0) ||
137137
(_tcsicmp(lpszExtension, _T(".cpp")) == 0) ||
138138
(_tcsicmp(lpszExtension, _T(".cxx")) == 0) ||
139+
(_tcsicmp(lpszExtension, _T(".groovy")) == 0) ||
139140
(_tcsicmp(lpszExtension, _T(".h")) == 0) ||
140141
(_tcsicmp(lpszExtension, _T(".hpp")) == 0) ||
141142
(_tcsicmp(lpszExtension, _T(".htm")) == 0) ||

IntelliFile.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ <h2>Supported Programming Languages</h2>
7070
<li>C/C++</li>
7171
<li>C#</li>
7272
<li>CSS</li>
73+
<li>Groovy</li>
7374
<li>HTML</li>
7475
<li>Java</li>
7576
<li>JavaScript</li>

IntelliFile.rc

28 Bytes
Binary file not shown.

ViewTextFileDlg.cpp

Lines changed: 86 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ const TCHAR* g_csKeywords
5555
_T("volatile while")
5656
};
5757

58+
const TCHAR* g_groovyKeywords
59+
{
60+
/* https://docs.oracle.com/cloud/latest/big-data-discovery-cloud/BDDDE/rsu_transform_unsupported_features.htm */
61+
_T("abstract as assert boolean break byte case catch char class const ")
62+
_T("continue def default do double else enum extends false final finally ")
63+
_T("float for goto if implements import in instanceof int interface long ")
64+
_T("native new null package private protected public return short static ")
65+
_T("strictfp super switch synchronized this threadsafe throw throws ")
66+
_T("transient true try void volatile while")
67+
_T("")
68+
};
69+
5870
const TCHAR* g_javaKeywords
5971
{
6072
/* https://www.w3schools.com/java/java_ref_keywords.asp */
@@ -273,7 +285,7 @@ BOOL CViewTextFileDlg::OnInitDialog()
273285
}
274286
else
275287
{
276-
if (_tcsicmp(lpszExtension, _T(".java")) == 0)
288+
if (_tcsicmp(lpszExtension, _T(".groovy")) == 0)
277289
{
278290
// Create the C++ Lexer
279291
#pragma warning(suppress: 26429)
@@ -283,11 +295,11 @@ BOOL CViewTextFileDlg::OnInitDialog()
283295

284296
// Setup the C++ Lexer
285297
m_ctrlTextFile.SetILexer(m_pLexer);
286-
m_ctrlTextFile.SetKeyWords(0, g_javaKeywords);
298+
m_ctrlTextFile.SetKeyWords(0, g_groovyKeywords);
287299
}
288300
else
289301
{
290-
if (_tcsicmp(lpszExtension, _T(".js")) == 0)
302+
if (_tcsicmp(lpszExtension, _T(".java")) == 0)
291303
{
292304
// Create the C++ Lexer
293305
#pragma warning(suppress: 26429)
@@ -297,164 +309,179 @@ BOOL CViewTextFileDlg::OnInitDialog()
297309

298310
// Setup the C++ Lexer
299311
m_ctrlTextFile.SetILexer(m_pLexer);
300-
m_ctrlTextFile.SetKeyWords(0, g_jsKeywords);
312+
m_ctrlTextFile.SetKeyWords(0, g_javaKeywords);
301313
}
302314
else
303315
{
304-
if ((_tcsicmp(lpszExtension, _T(".htm")) == 0) ||
305-
(_tcsicmp(lpszExtension, _T(".html")) == 0) ||
306-
(_tcsicmp(lpszExtension, _T(".asp")) == 0) ||
307-
(_tcsicmp(lpszExtension, _T(".aspx")) == 0) ||
308-
(_tcsicmp(lpszExtension, _T(".php")) == 0))
316+
if (_tcsicmp(lpszExtension, _T(".js")) == 0)
309317
{
310-
// Create the HTML Lexer
318+
// Create the C++ Lexer
311319
#pragma warning(suppress: 26429)
312-
m_pLexer = theApp.m_pCreateLexer("hypertext");
320+
m_pLexer = theApp.m_pCreateLexer("cpp");
313321
if (m_pLexer == nullptr)
314322
return FALSE;
315323

316-
// Setup the HTML Lexer
324+
// Setup the C++ Lexer
317325
m_ctrlTextFile.SetILexer(m_pLexer);
326+
m_ctrlTextFile.SetKeyWords(0, g_jsKeywords);
318327
}
319328
else
320329
{
321-
if (_tcsicmp(lpszExtension, _T(".json")) == 0)
330+
if ((_tcsicmp(lpszExtension, _T(".htm")) == 0) ||
331+
(_tcsicmp(lpszExtension, _T(".html")) == 0) ||
332+
(_tcsicmp(lpszExtension, _T(".asp")) == 0) ||
333+
(_tcsicmp(lpszExtension, _T(".aspx")) == 0) ||
334+
(_tcsicmp(lpszExtension, _T(".php")) == 0))
322335
{
323-
// Create the JSON Lexer
336+
// Create the HTML Lexer
324337
#pragma warning(suppress: 26429)
325-
m_pLexer = theApp.m_pCreateLexer("json");
338+
m_pLexer = theApp.m_pCreateLexer("hypertext");
326339
if (m_pLexer == nullptr)
327340
return FALSE;
328341

329-
// Setup the JSON Lexer
342+
// Setup the HTML Lexer
330343
m_ctrlTextFile.SetILexer(m_pLexer);
331344
}
332345
else
333346
{
334-
if (_tcsicmp(lpszExtension, _T(".m")) == 0)
347+
if (_tcsicmp(lpszExtension, _T(".json")) == 0)
335348
{
336-
// Create the Matlab Lexer
349+
// Create the JSON Lexer
337350
#pragma warning(suppress: 26429)
338-
m_pLexer = theApp.m_pCreateLexer("matlab");
351+
m_pLexer = theApp.m_pCreateLexer("json");
339352
if (m_pLexer == nullptr)
340353
return FALSE;
341354

342-
// Setup the Matlab Lexer
355+
// Setup the JSON Lexer
343356
m_ctrlTextFile.SetILexer(m_pLexer);
344-
m_ctrlTextFile.SetKeyWords(0, g_matlabKeywords);
345357
}
346358
else
347359
{
348-
if (_tcsicmp(lpszExtension, _T(".mak")) == 0)
360+
if (_tcsicmp(lpszExtension, _T(".m")) == 0)
349361
{
350-
// Create the Makefile Lexer
362+
// Create the Matlab Lexer
351363
#pragma warning(suppress: 26429)
352-
m_pLexer = theApp.m_pCreateLexer("makefile");
364+
m_pLexer = theApp.m_pCreateLexer("matlab");
353365
if (m_pLexer == nullptr)
354366
return FALSE;
355367

356-
// Setup the Makefile Lexer
368+
// Setup the Matlab Lexer
357369
m_ctrlTextFile.SetILexer(m_pLexer);
370+
m_ctrlTextFile.SetKeyWords(0, g_matlabKeywords);
358371
}
359372
else
360373
{
361-
if (_tcsicmp(lpszExtension, _T(".md")) == 0)
374+
if (_tcsicmp(lpszExtension, _T(".mak")) == 0)
362375
{
363-
// Create the MD Lexer
376+
// Create the Makefile Lexer
364377
#pragma warning(suppress: 26429)
365-
m_pLexer = theApp.m_pCreateLexer("markdown");
378+
m_pLexer = theApp.m_pCreateLexer("makefile");
366379
if (m_pLexer == nullptr)
367380
return FALSE;
368381

369-
// Setup the MD Lexer
382+
// Setup the Makefile Lexer
370383
m_ctrlTextFile.SetILexer(m_pLexer);
371384
}
372385
else
373386
{
374-
if (_tcsicmp(lpszExtension, _T(".py")) == 0)
387+
if (_tcsicmp(lpszExtension, _T(".md")) == 0)
375388
{
376-
// Create the Python Lexer
389+
// Create the MD Lexer
377390
#pragma warning(suppress: 26429)
378-
m_pLexer = theApp.m_pCreateLexer("python");
391+
m_pLexer = theApp.m_pCreateLexer("markdown");
379392
if (m_pLexer == nullptr)
380393
return FALSE;
381394

382-
// Setup the Python Lexer
395+
// Setup the MD Lexer
383396
m_ctrlTextFile.SetILexer(m_pLexer);
384-
m_ctrlTextFile.SetKeyWords(0, g_pyKeywords);
385397
}
386398
else
387399
{
388-
if (_tcsicmp(lpszExtension, _T(".r")) == 0)
400+
if (_tcsicmp(lpszExtension, _T(".py")) == 0)
389401
{
390-
// Create the R Lexer
402+
// Create the Python Lexer
391403
#pragma warning(suppress: 26429)
392-
m_pLexer = theApp.m_pCreateLexer("r");
404+
m_pLexer = theApp.m_pCreateLexer("python");
393405
if (m_pLexer == nullptr)
394406
return FALSE;
395407

396-
// Setup the R Lexer
408+
// Setup the Python Lexer
397409
m_ctrlTextFile.SetILexer(m_pLexer);
398-
m_ctrlTextFile.SetKeyWords(0, g_rKeywords);
410+
m_ctrlTextFile.SetKeyWords(0, g_pyKeywords);
399411
}
400412
else
401413
{
402-
if (_tcsicmp(lpszExtension, _T(".rs")) == 0)
414+
if (_tcsicmp(lpszExtension, _T(".r")) == 0)
403415
{
404-
// Create the Rust Lexer
416+
// Create the R Lexer
405417
#pragma warning(suppress: 26429)
406-
m_pLexer = theApp.m_pCreateLexer("rust");
418+
m_pLexer = theApp.m_pCreateLexer("r");
407419
if (m_pLexer == nullptr)
408420
return FALSE;
409421

410-
// Setup the Rust Lexer
422+
// Setup the R Lexer
411423
m_ctrlTextFile.SetILexer(m_pLexer);
412-
m_ctrlTextFile.SetKeyWords(0, g_rsKeywords);
424+
m_ctrlTextFile.SetKeyWords(0, g_rKeywords);
413425
}
414426
else
415427
{
416-
if (_tcsicmp(lpszExtension, _T(".sh")) == 0)
428+
if (_tcsicmp(lpszExtension, _T(".rs")) == 0)
417429
{
418-
// Create the Shell Lexer
430+
// Create the Rust Lexer
419431
#pragma warning(suppress: 26429)
420-
m_pLexer = theApp.m_pCreateLexer("bash");
432+
m_pLexer = theApp.m_pCreateLexer("rust");
421433
if (m_pLexer == nullptr)
422434
return FALSE;
423435

424-
// Setup the Shell Lexer
436+
// Setup the Rust Lexer
425437
m_ctrlTextFile.SetILexer(m_pLexer);
438+
m_ctrlTextFile.SetKeyWords(0, g_rsKeywords);
426439
}
427440
else
428441
{
429-
if (_tcsicmp(lpszExtension, _T(".sql")) == 0)
442+
if (_tcsicmp(lpszExtension, _T(".sh")) == 0)
430443
{
431-
// Create the SQL Lexer
444+
// Create the Shell Lexer
432445
#pragma warning(suppress: 26429)
433-
m_pLexer = theApp.m_pCreateLexer("sql");
446+
m_pLexer = theApp.m_pCreateLexer("bash");
434447
if (m_pLexer == nullptr)
435448
return FALSE;
436449

437-
// Setup the SQL Lexer
450+
// Setup the Shell Lexer
438451
m_ctrlTextFile.SetILexer(m_pLexer);
439-
m_ctrlTextFile.SetKeyWords(0, g_sqlKeywords);
440452
}
441453
else
442454
{
443-
if (_tcsicmp(lpszExtension, _T(".xml")) == 0)
455+
if (_tcsicmp(lpszExtension, _T(".sql")) == 0)
444456
{
445-
// Create the XML Lexer
457+
// Create the SQL Lexer
446458
#pragma warning(suppress: 26429)
447-
m_pLexer = theApp.m_pCreateLexer("xml");
459+
m_pLexer = theApp.m_pCreateLexer("sql");
448460
if (m_pLexer == nullptr)
449461
return FALSE;
450462

451-
// Setup the XML Lexer
463+
// Setup the SQL Lexer
452464
m_ctrlTextFile.SetILexer(m_pLexer);
465+
m_ctrlTextFile.SetKeyWords(0, g_sqlKeywords);
453466
}
454467
else
455468
{
456-
m_ctrlTextFile.SetupDirectAccess();
457-
m_ctrlTextFile.SetILexer(nullptr);
469+
if (_tcsicmp(lpszExtension, _T(".xml")) == 0)
470+
{
471+
// Create the XML Lexer
472+
#pragma warning(suppress: 26429)
473+
m_pLexer = theApp.m_pCreateLexer("xml");
474+
if (m_pLexer == nullptr)
475+
return FALSE;
476+
477+
// Setup the XML Lexer
478+
m_ctrlTextFile.SetILexer(m_pLexer);
479+
}
480+
else
481+
{
482+
m_ctrlTextFile.SetupDirectAccess();
483+
m_ctrlTextFile.SetILexer(nullptr);
484+
}
458485
}
459486
}
460487
}

hlp/IntelliFile.chm

6 Bytes
Binary file not shown.

x64/Release/IntelliFile.chm

0 Bytes
Binary file not shown.

x64/Release/IntelliFile.exe

512 Bytes
Binary file not shown.

x64/Release/Lexilla.dll

0 Bytes
Binary file not shown.

x64/Release/Scintilla.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)