Description
There are few tech debts we have surrounding file management in RD.
-
We had copy'n'pasted method for building the root path to the
%APPDATA%\Rubberduck\*
folders for various things. With PR Adds Add Predeclared Class Module Command #4225 aIPersistancePathProvider
was introduced to abstract the root path and thus make it easy for various subsystems to get their own folder for persisting their data. -
We have TEMP_PATH constant scattered around and the files are not controlled in any manner. Ideally, there should be a method that allows a
using (var tempFile = MakeSomeTempFile(source))
block to explicitly scope the lifetime of a temporary file, while allowing the calling code to perform its work with the file. -
We are not currently using
System.IO.Abstractions
; some subsystems has a direct dependency on theSystem.IO
, hampering its testability, while other has their handrolled interfaces that wraps the IO operations. We need to make this consistent, as to keepSystem.IO
out of those subsystems.
In the end, we need to ensure that we have an uniform system for accessing files (both permanent and temporary) that do not harm the testability and is predictable (e.g. doesn't write a file to a random location and then forget about it).