Open goyalyashpal opened 6 months ago
previous issues in this lineage:
I wanted this feature as well and created a fork and added the feature myself. You can check it out here : https://github.com/hitarth-gg/cph-personal-edition
It does not add "underscores" but rather adds whitespaces in between, resulting in a file name like this : 144C - Anagram Search.cpp
.
but rather adds whitespaces in between
hi! thanks a lot for making the fork.
but whitespaces are super bad - they complicate the CLI use and require needless escapes, it's the naive & dumbed down windows os environment which doesnt expose the users to how bad whitespace is in filenames.
and whitespace wont work for java files either, as java files require the name to match the classname i.e. follow the rules of identifiers.
but rather adds whitespaces in between
hi! thanks a lot for making the fork.
but whitespaces are super bad - they complicate the CLI use and require needless escapes, it's the naive & dumbed down windows os environment which doesnt expose the users to how bad whitespace is in filenames.
and whitespace wont work for java files either, as java files require the name to match the classname i.e. follow the rules of identifiers.
I agree with that, that is why I've added a warning in the repo's readme about the whitespaces. I only made this for myself since I rarely have issues with whitespaces on my machine and I don't use CLI that much.
You can change the logic in companion.ts
file and replace the whitespace with an underscore at line 155 : const secondPart = words?.join(' ');
.
I don't use CLI that much
i would guess that u tried using cmd
or powershell
shells.
try using bash
from msys2 on windows, u will love it.
my affection for cli can be apparent in the issue descriptioy itself, where even the version info is shared via bash
lol 😂
@agrawal-d Hi, if you're fine with having this as a feature then I can try working on it o7
hi!
problem solution
cph.general.useShortCodeForcesName
does "instead of" i.e. either144C
orC_Anagram_Search
144C_Anagram_Search
implementation details
it can be implemented in 2 ways:
(preferred imo) changing the option
cph.general.useShortCodeForcesName
to be multivalued instead of boolean so, smth like:cph.generatl.fileName
:short
,full
,both
,custom
(bad UX imo:) giving different boolean options for each field (shortcode, fullname) and picking some default (like fullname) when all (both for now) are disabled. the format will be:
short_full
environment & versions
Extension Version: see above VS Code Version: see above Operating System: see above
Browser Version: Vivaldi 6.7.3329.31 (Stable channel) (64-bit) Chrome/124.0.0.0