You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jdneo
Thanks. Nice!
I've looked into the code about this issue since it really bothers me.
This issue is caused by the params we passed into the show API of leetcode-cli which will generate a new source code file every time. And i haven't seen a param for existence checking in show API.
So here may be some plans:
A: We could genearte the file name by ourself and by which we could do the existence checking to determine whether to use the local code or get the remote template by show API from leetcode-cli.
This could solve this problem but we may meet some new problems too:
generating file name by id and slug which should be compatible with the present
mapping the file extension with language
B: We could use show API to generate source file in a temp path and by which we could get the file name. Then do the existence checking.
It's a little bit simple solution but may cost more time since we will always call the API.
So, what's your option about this? I prefer the plan A and i feel free for any ideas. :)
Activity
jdneo commentedon Aug 15, 2018
不太确定我有没有正确理解的你的问题。
你可以试试在VS Code里,点击
File
>Open Folder...
, 然后选择目标文件夹(默认情况下所有题目会存储在$HOME/.leetcode/
),这个时候你就可以在VS Code里看到所有文件了。twchn commentedon Oct 9, 2018
我觉得在点击show problem时先判断一下本地有没有文件再来决定打开本地文件(如果本地有)或者拉取题目(如果本地没有)这样好一点,因为这样可以看到之前的草稿或者提交的答案
jdneo commentedon Oct 10, 2018
@taoweicn This is a good suggestion.
@SkyLin0909 Do you mean to make the extension work as @taoweicn said?
evan-lin9 commentedon Oct 10, 2018
@jdneo yes
poppinlp commentedon Feb 21, 2019
@jdneo Hi,请问这是一个 PR-welcomed 的 issue 么?
jdneo commentedon Feb 21, 2019
@poppinlp All the issues are PR welcomed. Just remember to discuss the implementation in the issue before sending out the PR.
Thanks
poppinlp commentedon Feb 21, 2019
@jdneo
Thanks. Nice!
I've looked into the code about this issue since it really bothers me.
This issue is caused by the params we passed into the
show
API ofleetcode-cli
which will generate a new source code file every time. And i haven't seen a param for existence checking inshow
API.So here may be some plans:
A: We could genearte the file name by ourself and by which we could do the existence checking to determine whether to use the local code or get the remote template by
show
API fromleetcode-cli
.This could solve this problem but we may meet some new problems too:
B: We could use
show
API to generate source file in a temp path and by which we could get the file name. Then do the existence checking.It's a little bit simple solution but may cost more time since we will always call the API.
So, what's your option about this? I prefer the plan A and i feel free for any ideas. :)
jdneo commentedon Feb 22, 2019
@poppinlp Plan A sounds good to me. Would you like to make a PR for it?
poppinlp commentedon Feb 22, 2019
Of course. I'll send it this weekend. :)
5 remaining items