LSP Falsely Calls "unused require"
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
从被引用的提交开始,检查 LSP 如何分析所示模块中的 require 和 begin-for-syntax 形式。在存在和不存在 for-syntax 导入的情况下分别重现该诊断。当在编译时引用 parse-verse-line 时,所需的绑定不会被报告为未使用,即表示完成。
由索引模型根据 Issue 内容生成。
描述
In this file (at this commit https://github.com/veqqq/verse-reader/commit/9d85176d956927f1423d5066b034ad9c882680fd#diff-03ff549a899d4177544a2571db77418a19e57495987c3bfc80d618d8a200ee48 ) the following code occurs:
(module verse-struct racket/base
(require racket/string)
; Changed to prefab for compile-time support
(struct bible-verse (
[abbrev #:mutable]
[chapter #:mutable]
[verse #:mutable]
[text #:mutable])
#:prefab)
; Parse string to extract verse
(define (parse-verse-line line)
(define parts (string-split line "\t"))
(if (= (length parts) 5)
(bible-verse
;; note, no book
(string-downcase (list-ref parts 1)) ; abbreviation
(string->number (list-ref parts 2)) ; chapter
(string->number (list-ref parts 3)) ; verse
(list-ref parts 4)) ; text
(begin
(printf "Skipping non-verse line: ~a\n" line)
#f)))
(provide bible-verse bible-verse? parse-verse-line
bible-verse-abbrev
bible-verse-chapter bible-verse-verse
bible-verse-text))
(require 'verse-struct
(for-syntax 'verse-struct))
; Compile-time parse
(begin-for-syntax
(define-runtime-path kjv-path "kjv.tsv")
(define kjv-verses
(filter values
(for/list ([line (in-list (with-input-from-file kjv-path port->lines))])
(parse-verse-line line)))))
If you remove the for-syntax require, the begin-for-syntax of course won't have the parse-verse-line function identifier...
- 主要语言
- Racket
- 星标
- 516
- 派生
- 103
- 平均合并
- 8 小时 52 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
racket/drracket 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 62/100
-
check-syntax
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 84/100
NVIDIA/DeepStream#78 ·
-
documentation good first issue help wanted
难度 1/5 1-3 小时 新手友好度 85/100
zmo2s/agent-toolbox#23 ·
-
raised-by:worker
难度 2/5 1-3 小时 新手友好度 68/100
medici-finance/assay#2486 ·
维护者通常 1 天内回复
-
bug traffic
难度 2/5 1 小时以内 新手友好度 74/100
-
enhancement good first issue Stellar Wave trivial
难度 2/5 1-3 小时 新手友好度 75/100
StellarCanary/ProtocolCanary-Fixtures#258 ·
维护者通常 1 天内回复