ianding1 / leetcode.vim

Solve LeetCode problems in Vim!
MIT License
311 stars 43 forks source link

Cannot list leetcode problems #78

Open Gur-Sin opened 3 months ago

Gur-Sin commented 3 months ago

I followed the instructions in the readme, signed in to firefox (which worked fine), and added the necessary config options. However when I try to list the problems, I have a list index out of range error. I've tried both the remap and the :LeetCodeList command but get the same error regardless

image

I'm using neovim (v0.11.0-dev) on Pop!OS 22.04 LTS with a lua init file instead of vimscript. I made sure to not make any syntax errors that I could notice but i'm uploading the configuration here if in case I am just that stupid. If so, please let me know lol.

init.lua:

-- Leetcode
Plug('ianding1/leetcode.vim')

vim.keymap.set("n", "<leader>ll", ":LeetCodeList<CR>'")
vim.keymap.set("n", "<leader>lt", ":LeetCodeTest<CR>'")
vim.keymap.set("n", "<leader>ls", ":LeetCodeSubmit<CR>'")
vim.keymap.set("n", "<leader>li", ":LeetCodeSignIn<CR>'")

vim.g.leetcode_browser = 'firefox'
vim.g.leetcode_solution_filetype = 'python3'
kagzgenius commented 2 months ago

+1 same issue

sgouda0412 commented 1 month ago

cannot get topics
Error detected while processing function leetcode#ListProblems: line 31: E684: list index out of range: 0 Press ENTER or type command to continue

Gur-Sin commented 1 month ago

I fixed it by using lazyvim instead of vimplug if that's of any help.

lyctw commented 1 month ago

same issue

sgouda0412 commented 1 month ago

please help with vimplug and key bindings

Caesar723 commented 2 weeks ago

I only found a solution, but the issue still persists. In the leetcode.py file, around line 578, change the code to the following:

if res.status_code != 200:
    # _echoerr('cannot get topics')
    return {
        'topics': [],
        'companies': []
    }