DFRefactor 2026
This release contains the changes made since the 2024.0 rewrite of the program's architecture.
New refactoring functions
Legacy-grid to CodeJock conversions. A group of functions that modernize legacy grid and list objects, also when they span several files:
- RefactorDbGridTocDbCJGrid — data-aware DbGrid → cDbCJGrid, with individual column objects.
- RefactorGridToCJGrid — non-data-aware Grid → cCJGrid (property translation; columns completed manually).
- RefactorDbListTocDbCJGridPromptList — dbList selection lists → cDbCJGridPromptList prompt lists.
The data-aware and non-data-aware paths are implemented as separate classes, for clarity and testability.
Additional line-by-line functions:
- ChangeIfNotCommandToExpression
- ChangeLeftCommandToFunction
- ChangeRightCommandToFunction
- ChangeSquareBracketsIndicators
- NormalizeArrayNotation
- ChangeIndexNumber
A new report function:
- UnusedUseStatements — flags Use statements whose imported classes are never instantiated; a companion to UnusedSourceFiles.
Architecture
- The function-library class chain was restructured into focused, single-responsibility layers: cRefactorUtilities → cRefactorLexer → cRefactorExpressionParser → cBaseFuncLib → cRefactorFuncLib → oRefactorFuncLib.
- Global handles shortened: ghoRefactorEngine → ghoEngine, ghoRefactorFuncLib → ghoFuncLib.
- Calling conventions unified between locally and globally defined functions.
DataFlex 2026 compatibility
- The cFilesystem git submodule was removed. File I/O moved to a new cRefactorFileIO.pkg of DF26-compatible global functions — some of cFilesystem's ANSI Win32 file calls crashed the DF26 debugger. cRefactorFileIO also absorbed DUF's channel-based file I/O, so the engine no longer routes routine file I/O through DUF; DUF remains only for database migrations.
- Encoding-aware file read/write was centralized in cEncodingHelpers.pkg; its global functions are prefixed RF to avoid name clashes.
- Improved handling of DF26 .sws workspace-file reading.
- The earlier Studio Code Explorer / Code Completion issue with triple-quote { Description } meta-tags is resolved in DF26.
Command-line and continuous integration
- DFRefactor now supports unattended and batch operation — workspace, single-file, folder and batch flags, plus an ini-file mode. The current configuration can be written from Export to ini-file for repeatable runs. See Command-Line Usage.
- DFUnit_TestRunner gained a headless console mode (-c / --console) that runs the full suite and exits with code 0 (all pass) or -1 (any fail), suitable for gating a CI build.
Testing and packaging
- Substantially expanded unit-test coverage, including the grid and list conversions and the encoding helpers. Each test fixture now lives in its own file, Used into oUnit_Tests.pkg, so the suite stays maintainable.
- JSON Export/Import was reworked to match the new test structure. Functions in UserDefinedRefactorFunctions.pkg can be marked { Private = True } to exclude them from JSON Export/Import.