leetcode.vim icon indicating copy to clipboard operation
leetcode.vim copied to clipboard

Cannot list leetcode problems

Open gur-sin opened this issue 1 year ago • 6 comments

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'

gur-sin avatar Jul 18 '24 15:07 gur-sin

+1 same issue

kagzgenius avatar Jul 25 '24 16:07 kagzgenius

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

sgouda0412 avatar Sep 07 '24 10:09 sgouda0412

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

gur-sin avatar Sep 09 '24 21:09 gur-sin

same issue

lyctw avatar Sep 15 '24 06:09 lyctw

please help with vimplug and key bindings

sgouda0412 avatar Sep 15 '24 08:09 sgouda0412

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': []
    }

Caesar723 avatar Sep 27 '24 22:09 Caesar723