diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dd78fa11..c9e9859a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Your submission must also include some Unit Test information, similar to the [Fu 0. Make sure that your UDL and FunctionList definition are working in your local Notepad++, showing the right functions (and classes) in the Function List panel for your sample file. 1. Run `notepad++ -multiInst -nosession -export=functionList -udl="" ""` , which will create `unitTest.result.json` in the same directory as your example file 2. Create `Test\functionList\\` in your repo, where `` must match the `id-name` from the JSON, exactly. -3. Copy `unitTest.result.json` to `Test\functionList\unitTest.expected.result` +3. Copy `unitTest.result.json` to `Test\functionList\\unitTest.expected.result` ## HOW TO Submit Pull Request diff --git a/Test/functionList/STL-3dObject-ASCII.byPryrt/unitTest.expected.result b/Test/functionList/STL-3dObject-ASCII.byPryrt/unitTest.expected.result new file mode 100644 index 00000000..3fa36817 --- /dev/null +++ b/Test/functionList/STL-3dObject-ASCII.byPryrt/unitTest.expected.result @@ -0,0 +1 @@ +{"leaves":["solid cube"],"root":"unitTest"} diff --git a/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result b/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result new file mode 100644 index 00000000..9fd2f856 --- /dev/null +++ b/Test/functionList/Vimscript_by_rdipardo/unitTest.expected.result @@ -0,0 +1 @@ +{"leaves":["build_go_files"],"root":"unitTest"} \ No newline at end of file diff --git a/Test/localUnitTestLauncher.ps1 b/Test/localUnitTestLauncher.ps1 index 30aa2112..7a52d910 100644 --- a/Test/localUnitTestLauncher.ps1 +++ b/Test/localUnitTestLauncher.ps1 @@ -3,12 +3,13 @@ cd Test $PowerEditorSource = "c:\Program Files\Notepad++\" $PowerEditorLocal = ".\PowerEditor" -if ( Test-Path $PowerEditorLocal ) { - Remove-Item -Recurse -Force $PowerEditorLocal +if ( !(Test-Path $PowerEditorLocal) ) { + # to be more efficient, only copy from PowerEditorSource if we + # don't already have the PowerEditorLocal hierarchy + # (that also lets me keep a customized local + Copy-Item "$PowerEditorSource" -Destination "$PowerEditorLocal\bin" -Recurse -Force } - -Copy-Item "$PowerEditorSource" -Destination "$PowerEditorLocal\bin" -Recurse -Force -New-Item "$PowerEditorLocal\bin\doLocalConf.xml" > $nul +New-Item "$PowerEditorLocal\bin\doLocalConf.xml" -ea 0 > $nul New-Item "$PowerEditorLocal\bin\userDefineLangs" -ItemType Directory -ea 0 > $nul python doUnitTests.py $PowerEditorLocal\bin diff --git a/Test/overrideMap.xml b/Test/overrideMap.xml deleted file mode 100644 index 8b32cb52..00000000 --- a/Test/overrideMap.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/Test/unitTest.ps1 b/Test/unitTest.ps1 deleted file mode 100644 index 3705436c..00000000 --- a/Test/unitTest.ps1 +++ /dev/null @@ -1,63 +0,0 @@ -# This script does 1 unit-test on given relative dir path and on given language. -# Here's its syntax: -# .\unit-test.ps1 RELATIVE_PATH LANG -# It return 0 if result is OK -# -1 if result is KO -# -2 if exception -# 1 if unitTest file not found - - -$testRoot = ".\functionList\" -$PowerEditorLocal = ".\PowerEditor" - -$dirName=$args[0] -$langName=$args[1] - -Write-Debug "unitTest: root=$testRoot local=$PowerEditorLocal dir=$dirName lang=$langName" - -Try { - if ((Get-Item $testRoot$dirName) -is [System.IO.DirectoryInfo]) - { - if (-Not (Test-Path $testRoot$dirName\unitTest)) - { - return 1 - } - if ($langName.StartsWith("udl-")) - { - $langName = $langName.Replace("udl-", "") - Write-Debug ":: $PowerEditorLocal\bin\notepad++.exe -multiInst -nosession -export=functionList -udl='$langName' $testRoot$dirName\unitTest | Out-Null" - & "$PowerEditorLocal\bin\notepad++.exe" -multiInst -nosession -export=functionList -udl="$langName" $testRoot$dirName\unitTest | Out-Null - & "$PowerEditorLocal\bin\notepad++.exe" -multiInst -nosession -udl="$langName" $testRoot$dirName\unitTest | Out-Null - } - else - { - Write-Debug "$PowerEditorLocal\bin\notepad++.exe -multiInst -nosession -export=functionList -l'$langName' $testRoot$dirName\unitTest | Out-Null" - & "$PowerEditorLocal\bin\notepad++.exe" -multiInst -nosession -export=functionList -l"$langName" $testRoot$dirName\unitTest | Out-Null - } - - $expectedRes = Get-Content $testRoot$dirName\unitTest.expected.result - $generatedRes = Get-Content $testRoot$dirName\unitTest.result.json - - # Some parser results contain CRLF or LF (\r\n or \n) dependent of file EOL format - # In order to make tests pass in any environment, all the CRLF turning into LF (if any) in both strings - $expectedRes = $expectedRes.replace('\r\n','\n') - $generatedRes = $generatedRes.replace('\r\n','\n') - - if ($generatedRes -eq $expectedRes) - { - Remove-Item $testRoot$dirName\unitTest.result.json - return 0 - } - else - { - $expectedRes - "`nvs`n" - $generatedRes - return -1 - } - } -} -Catch -{ - return -2 -} diff --git a/functionList/.readme.md b/functionList/.readme.md deleted file mode 100644 index be04b1fd..00000000 --- a/functionList/.readme.md +++ /dev/null @@ -1,3 +0,0 @@ -dummy placeholder file - -eventually this folder will have functionList XML files submitted for a given UDL, but until there is one, this file will keep the directory existing... diff --git a/Test/regexGlobalTest.xml b/functionList/STL-3dObject-ASCII.byPryrt.xml similarity index 50% rename from Test/regexGlobalTest.xml rename to functionList/STL-3dObject-ASCII.byPryrt.xml index 5a66ee2b..1c971753 100644 --- a/Test/regexGlobalTest.xml +++ b/functionList/STL-3dObject-ASCII.byPryrt.xml @@ -8,16 +8,21 @@ \=========================================================================== --> - - + + + + mainExpr="^\h*solid\h+\w+" + > + + + + diff --git a/functionList/Vimscript_by_rdipardo.xml b/functionList/Vimscript_by_rdipardo.xml new file mode 100644 index 00000000..367c9009 --- /dev/null +++ b/functionList/Vimscript_by_rdipardo.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + diff --git a/udl-list.json b/udl-list.json index cbf9c430..1e996082 100644 --- a/udl-list.json +++ b/udl-list.json @@ -46,6 +46,7 @@ "id-name": "ABAQUS_6.13-5_ObsidianTheme", "display-name": "ABAQUS_6.13-5", "version": "2020-Dez-09", + "sample": "ABAQUS_6.13-5_ObsidianTheme.inp", "repository": "", "description": "ABAQUS CAE engineering simulation software", "author": "https://github.com/dfens83" @@ -88,6 +89,7 @@ "display-name": "Amiga_E", "autoCompletion": true, "version": "Fri, 2 Sep 2022 15:53:00 GMT", + "sample": "Amiga_E_bydmcoles.e", "repository": "https://raw.githubusercontent.com/dmcoles/userDefinedLanguages/master/autoCompletions/Amiga_E_bydmcoles.xml", "description": "Amiga E syntax highlighting", "author": "dmcoles", @@ -98,6 +100,7 @@ "display-name": "Amiga_E_dark", "autoCompletion": true, "version": "Fri, 2 Sep 2022 15:53:00 GMT", + "sample": "Amiga_E_dark_bydmcoles.e", "repository": "https://raw.githubusercontent.com/dmcoles/userDefinedLanguages/master/autoCompletions/Amiga_E_dark_bydmcoles.xml", "description": "Amiga E syntax highlighting (dark version)", "author": "dmcoles", @@ -271,6 +274,7 @@ "id-name": "AsmForMIPS-R2000_byJoaoRicardoRosa", "display-name": "ASM for MIPS R2000", "version": "Thu, 26 Jan 2012 08:32:54 GMT", + "sample": "AsmForMIPS-R2000_byJoãoRicardoRosa.s", "repository": "", "description": "ASM for MIPS R2000", "author": "Jooo Ricardo Rosa " @@ -335,6 +339,7 @@ "id-name": "AutoCAD-LPSS.udl", "display-name": "AutoCAD-LPSS", "version": "2020-Jan-21", + "sample": "AutoCAD-LPSS.udl.lin", "repository": "", "description": "User Defined Lang for AutoCAD Linetype (*.lin), Hatch Pattern (*.pat), Script (*.scr) and Shape (*.shp) files. Can be used with the AutoCAD-LPSS.xml file for Auto-Completion.", "author": "Rusi Dimitrov", @@ -760,6 +765,7 @@ "display-name": "ExcelFormula", "version": "v1.00", "repository": "", + "sample": "ExcelFormula_ThemeDark_byOlivierMarche.txt", "description": "Excel Formulas syntax highlight", "author": "OlivierMarche", "homepage": "https://github.com/OlivierMarche" @@ -819,6 +825,7 @@ "id-name": "Fobagraph_Script_(.bia)_DarkMode_by_HelloWorldFR", "display-name": "Fobagraph Script DarkMode", "version": "18/10/2023 17:40:00 GMT", + "sample": "Fobagraph_Script_by_HelloWorldFR.bia", "repository": "https://github.com/HelloWorldFR/userDefinedLanguages/blob/master/UDLs/Fobagraph_Script_(.bia)_DarkMode_by_HelloWorldFR.xml", "description": "Fobagraph Script for laser machine", "author": "HelloWorldFR", @@ -829,6 +836,7 @@ "display-name": "Fobagraph Script LightMode", "autoCompletion": "fobagraph", "version": "18/10/2023 17:40:00 GMT", + "sample": "Fobagraph_Script_by_HelloWorldFR.bia", "repository": "https://github.com/HelloWorldFR/userDefinedLanguages/blob/master/UDLs/Fobagraph_Script_(.bia)_LightMode_by_HelloWorldFR.xml", "description": "Fobagraph Script for laser machine", "author": "HelloWorldFR", @@ -925,6 +933,7 @@ { "id-name": "GCODE-Sinumerik_bySergioGU", "display-name": "GCODE-Sinumerik", + "sample": "GCODE-Sinumerik_bySergioGU.SPF", "version": "1.0.0", "repository": "", "description": "Siemens Sinumerik CNC GCode syntax highlighting", @@ -1093,6 +1102,7 @@ "display-name": "HLASM", "version": "z16", "repository": "", + "sample": "HLASM_byAbeKornelis.mac", "description": "HLASM", "author": "Abe Kornelis", "homepage": "https://bixoft.com/english/opcd00.htm" @@ -1149,6 +1159,7 @@ "id-name": "Icinga_DSL_by_robweber", "display-name": "Icinga DSL", "version": "2024-03-25", + "sample": "Icinga_DSL_by_robweber.conf", "repository": "", "description": "Icinga DSL for use with Icinga2 monitoring solution", "author": "robweber", @@ -1330,6 +1341,7 @@ "id-name": "Log_darkMode_byS0UGATA", "display-name": "Log_darkMode", "version": "Wed, 02 Mar 2022 11:20:19 CET", + "sample": "Log_darkMode_byS0UGATA.stl", "repository": "", "description": "Log syntax highlighter for Dark Mode", "author": "Sougata Bhattacharya ", @@ -1602,6 +1614,7 @@ "id-name": "NC-DSTV_NC1_byJeffMiller", "display-name": "DSTV", "version": "Tuesday, 16 Nov 2021 19:30:00 GMT", + "sample": "NC-DSTV_NC1_byJeffMiller.nc1", "repository": "", "description": "NC-DSTV (NC1)", "author": "Jeff Miller ", @@ -1676,6 +1689,7 @@ "id-name": "NppExec_themeDefault_byAndreasHeim", "display-name": "NppExec", "version": "2023-04-01", + "sample": "NppExec_byAndreasHeim.exec", "repository": "", "description": "NppExec plugin scripting language", "author": "Andreas Heim (dinkumoil on GitHub and SourceForge)", @@ -1685,6 +1699,7 @@ "id-name": "NppExec_themeMaterial_byAndreasHeim", "display-name": "NppExec (Material theme)", "version": "2023-04-01", + "sample": "NppExec_byAndreasHeim.exec", "repository": "", "description": "NppExec plugin scripting language", "author": "Andreas Heim (dinkumoil on GitHub and SourceForge)", @@ -2203,6 +2218,7 @@ { "id-name": "SBI Mapper", "display-name": "IBM SBI Mapper Extended Rules", + "sample": "IBM_SBI_mapper_example.txt", "version": "20240527", "repository": "", "description": "IBM Sterling B2B Integrator Mapper for Extended Rules", @@ -2212,6 +2228,7 @@ "id-name": "SBI Mapper (Dark Mode)", "display-name": "IBM SBI Mapper Extended Rules (Dark Mode)", "version": "20240527", + "sample": "IBM_SBI_mapper_example.txt", "repository": "", "description": "IBM Sterling B2B Integrator Mapper for Extended Rules (Dark Mode)", "author": "Mayot" @@ -2290,6 +2307,7 @@ "display-name": "SIL", "version": "2023-10-19", "repository": "", + "sample": "SIL-Power-Scripts-for-Jira_byHaydenSingleton.sil", "description": "Syntax Highlighting for Simple Issue Language from Power Scripts for Jira by Appfire.", "author": "Hayden Singleton", "homepage": "https://github.com/HaydenSingleton" @@ -2389,6 +2407,7 @@ "display-name": "SQL/9", "version": "Wed, 05 Oct 2022 20:38:00 GMT", "repository": "", + "sample": "SQL_Manifold9_byRKolka.sql", "description": "SQL of Manifold 9", "author": "Riivo Kolka " }, @@ -2413,6 +2432,8 @@ "display-name": "STL 3dObject", "version": "2020-Jan-12", "repository": "", + "functionList": true, + "sample": "STL-3dObject-ASCII.byPryrt.stl", "description": "3d Stereolithography ASCII file (STL)", "author": "Pryrt", "homepage": "https://github.com/pryrt/" @@ -2688,6 +2709,9 @@ "id-name": "Vimscript_by_rdipardo", "display-name": "Vim script", "autoCompletion": true, + "functionList": true, + "functionListAuthor": "Pryrt", + "sample": "Vimscript_by_rdipardo.vimrc", "version": "2023-09-06", "repository": "https://gist.github.com/0b78f62e1ce481ff0d8f8e80cc298ced.git", "description": "User Defined Language for Vim script", @@ -2758,6 +2782,7 @@ "display-name": "Robotframework v0.1", "autoCompletion": "vkosuri-robotframework", "version": "v0.1", + "sample": "vkosuri_resource.robot", "repository": "", "description": "Notepad++ syntax highlighting for Robotframework", "author": "https://github.com/vkosuri", @@ -2841,6 +2866,7 @@ "id-name": "yang_by-gribok", "display-name": "YANG", "version": "Tue Mar 10 2020 19:16:31 GMT", + "sample": "yang_by-gribok.yang", "repository": "https://raw.githubusercontent.com/gribok/notepad-plus-plus-yang-language/master/yang_by-gribok.xml", "description": "YANG Data Modeling Language", "author": "gribok", @@ -2850,6 +2876,7 @@ "id-name": "YARA_byM0N4", "display-name": "YARA", "version": "v1.00", + "sample": "YARA_byM0N4.yar", "repository": "", "description": "YARA syntax highlighting for Notepad++.", "author": "m0n4", diff --git a/udl-list.md b/udl-list.md index b880808a..c048bd7e 100644 --- a/udl-list.md +++ b/udl-list.md @@ -375,3 +375,5 @@ | Name | Author | Description | |-----|--------|-------------| | [LSL](./functionList/LSL_byKimpaTammas.xml) | [Kimpa Tammas](mailto:kimpa.tammas@free.fr) | Linden Script Language (dark theme version) | +| [STL 3dObject](./functionList/STL-3dObject-ASCII.byPryrt.xml) | [Pryrt](https://github.com/pryrt/) | 3d Stereolithography ASCII file (STL) | +| [Vim script](./functionList/Vimscript_by_rdipardo.xml) | Pryrt | User Defined Language for Vim script |