-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom file name template #166
Comments
I think these two issues are not the same function, maybe you didn't understand what I meant. I am suggesting to add a configuration item, just like |
like this? @jdneo |
@jdneo I've sent a PR to fix the Chinese file name issue. @jdneo @Dec-F Here maybe a plan to support the file name pattern: We could pass the whole config into the The variable in pattern could be:
|
For a certain problem, it may belong to multiple companies and tags, how to handle this scenario? @Dec-F One thing I missed is that we prefer to discussing the implementation before sending the PR, free feel to share your thoughts. |
On the one side, if we wanna support On the other side, I think the first question is what should we support BTW, there may be some risks that if the tags of a problem changed then the local source code could be missed. |
I think there are two ways to deal with it.
What do you think? |
This comment has been minimized.
This comment has been minimized.
@magic-akari This is the issue. I think the |
Does this mean that |
Yes. Make it deprecated and stop honor this setting in the future. For now, we will honor both |
I prefer the following config format
|
@magic-akari 可以简单一下,第一阶段先不考虑不同语言的命名习惯,今后可以根据不同语言生成不同样式的文件名。需要支持的变量可以有:
另一个问题,怎么比较好地区分folder和filename. 举例来说,有一个用户他只想自定义文件夹路径,但是使用了该配置项之后,他必须把文件名格式也补全。感觉似乎不是一个很好的用户体验 |
什么都不设置,会用 default 设置吧,最开始的时候生成一个。 |
不废弃 outputFolder 的话,那么setting名称就是fileName了。让我再想一想这个 experience 应该是怎么样的 |
其实我就是因为遇到了命名的问题,才来这里寻找解决办法的。 其实 snake case 之类的,这个也不难做。 |
I think that merging into a configuration may not be a good idea. Atomic configuration understanding costs may be lower. |
或者平铺这些设置,
|
I agree with @Dec-F's opinion. It makes me confused to merge outputFolder and fileName. IMO, the splitted setting |
如果分开设置 filename 和 outputFolder,为每个语言设置独立的输出就会遇到困难。 |
I don't get your point. Why splitting |
Let's have a try.
or
There is too much noise in the first one. |
@magic-akari Yes, I agree with your point. But one thing we need to figure out is how to make this setting easy to understand. Because actually we combined two settings into one. What if:
Things will become tricky during the implementation, because we have to guess which part is for folder and which part is for the file name. |
So what's the expected behavior if the user set |
Do you mean |
I mean, the user only want to set the folder path. So he set it to |
我们应该让用户输入完整的路径。而不是允许输入部分,然后猜测用户要做什么。 当用户真的有需求,要改变某个语言的输出文件夹的时候,从默认值哪里复制粘贴出 |
或许,有什么其他更方便的方法? |
要么,放弃直接在 vscode settings UI 更改设置的便利。
用户需要点击 Edit in settings.json |
This might be something worth considering. But by calling |
名字不是重要的,最后由你来拍版决定。现在需要确定这种设置的结构能否接受。 |
Hmm, please give me some time to think about it. @Dec-F Do you have any feedback? |
guaranteed atomic configuration is a very important factor. The template variables contain language information. You can customize the complete path and cover all languages. I don't think there is any problem. |
@Dec-F Thanks. @magic-akari Could you list all the variables that you want to support first? |
我有个疑问。关于 tag 和 company. 如果用户点击 code now 后,选择不同的值,就会新生成一个文件,而不是打开之前创建的。 |
这确实是一个问题。关于多tag的情况你有什么好的建议吗? |
我很需要这个功能。 我需要把文件名的改为 1-two-sum.cpp 。 因为如果是1.two-sum.cpp的话,编译输出的可执行文件是1.two-sum,tow-sum 会被当成后缀名,执行失败。 |
关于 tag 和 company 这种多 tag 的情况,我并没有什么好的想法或者解决方案。 |
Has anyone started to implement this feature? Recently I have some time to try to complete this feature, so I want to know if someone is already doing it, so as not to repeat the work. |
Hi @Dec-F, I was busy with other stuff these days. Sorry for that I did not respond to this issue in time. Actually @magic-akari has provided a PR #380 for this, which I haven't been able to take a look so far. Maybe you can take a look and provide your thoughts? |
Resolved in #380 by @magic-akari . Nice job! |
考虑支持自定义的文件名吗?
比如 中文版生成的文件名含有中文,import一个中文文件,感觉不是很靠谱,所以每次都要手动修改。
我觉得,文件名最好支持模版插值,可以取{tag}{difficulty}等几个meta信息填充,这样也可以满足不同人的需求。
The text was updated successfully, but these errors were encountered: