j178 / leetgo

Best LeetCode friend for geek. :snowboarder:
MIT License
539 stars 32 forks source link

[Bug] use vscode to edit will have open an empty file `{{.Files}}` #239

Closed rgbygv closed 1 year ago

rgbygv commented 1 year ago

leetgo debug

Leetgo version info :

dev
commit: HEAD
built at: unknown
goos: linux
goarch: amd64
module version: v1.3.9, checksum: h1:TysnYQWs/vVk3QPDD4TQ1iihBpwg/jfvfULjwc/5b1I=

Global config dir : /root/.config/leetgo Global config file : /root/.config/leetgo/config.yaml Project root : /root/leetcode Working dir : /root/leetcode/contest Project config file : /root/leetcode/leetgo.yaml Project configuration:

# This is the leetgo project level config, global config is at /root/.config/leetgo/config.yaml
# For more details, please refer to https://github.com/j178/leetgo
language: zh
code:
  lang: python
leetcode:
  site: https://leetcode.cn
credentials:
   from: cookies
editor:
 use: vscode

Full configuration :

author:
language: zh
code:
  lang: python
  filename_template: '{{ .Id | padWithZero 4 }}{{ if .SlugIsMeaningful }}.{{ .Slug }}{{ end }}'
  separate_description_file: true
  modifiers:
    - name: removeUselessComments
  go:
    out_dir: go
    modifiers:
      - name: removeUselessComments
      - name: changeReceiverName
      - name: addNamedReturn
      - name: addMod
  python3:
    out_dir: python
    blocks:
      - name: beforeMarker
        template: |2
          from bisect import bisect_left, bisect_right
          from collections import Counter, defaultdict, deque
          from copy import deepcopy
          from functools import cache, cmp_to_key, lru_cache, reduce
          from heapq import heapify, heappop, heappush, heappushpop, heapreplace
          from itertools import accumulate, chain, count, pairwise, zip_longest
          from math import ceil, comb, floor, gcd, inf, isqrt, log2, perm, sqrt
          from operator import xor
          from string import ascii_lowercase
          from typing import List, Optional
      - name: beforeCode
        template: |
          # from sortedcontainers import SortedList
    executable: python3
  cpp:
    out_dir: cpp
    cxx: g++
    cxxflags: -O2 -std=c++17
  rust:
    out_dir: rust
  java:
    out_dir: java
leetcode:
  site: https://leetcode.cn
  credentials:
    from: cookies
    browsers: []
contest:
  out_dir: contest
  filename_template: '{{ .ContestShortSlug }}/{{ .Id }}{{ if .SlugIsMeaningful }}.{{ .Slug }}{{ end }}'
  open_in_browser: true
editor:
  use: vscode
  command: ""
  args: ""

Debug log

No response

Description

test on windows and wsl, all have the problem. i don't know it's my vscode problem or bug of leetgo.

leetgo edit b117/2 ● opening files command=/root/.vscode-server/bin/e7e037083ff4455cf320e344325dacb480062c3c/bin/remote-cli/code

Code_rzHjhppB03

j178 commented 1 year ago

Thanks for the report! This is indeed a bug introduced in 4e673b19e6dc97cfeb5bacb0b148bb6eeeea2934. It should be fixed in https://github.com/j178/leetgo/commit/4ce4de394415a2ad731d5b2ec3f5c6d0871676c5, will release soon.