Open Ayman161803 opened 2 years ago
Hi @Ayman161803, can you elaborate on this issue a little more?
loadFileContents
and loadFileBuffer
options? Which setting will they configure?Hey @mehmettokgoz!
Apologies for the lack of clarity.
Currently, the logic written for loading templates from a VSCode workspace here and the logic written here is the same. The only difference is the way in which they load file contents. Where cicero-core uses fs
, VSCode extension uses vscode.workspace.fs
. Sometime in the future, if the logic to load templates from directories changes in cicero-core here, the same should be reflected in the logic written within VSCode extension code here.
loadFileBuffer
and loadFileContents
parameter into fromDirectory
method here which will let us use the same fromDirectory
method from cicero-core but with different logic to read and write files. fromDirectory
method in cicero-core that the logic is duplicated here. So that whenever something changes in cicero-core, the same is reflected in the code for vscode-extension. I am not sure if the same can be achieved with the current core library itself. It would be great if you have any inputs @mttrbrts.
Feature Request 🛍️
Provide custom loadfilecontents and loadfilebuffer options in
Template.fromDirectory()
Use Case
Loading template directories from a virtual file system where
fs
module cannot be used. Example: VSCode-WebPossible Solution
The options dictionary can accept option parameter
loadFileContents
andloadFileBuffer
to alter the way in which file content is read from memory.Context
A simple fix to this can be help us load Templates in VSCode Extension where only file reading logic is to be altered
without
altering the way in which the contents of these files are used to create theTemplate
object.Would you like to work on this?
Yes