Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

LSP reports `Unknown timer unit` for valid scalar timer units

オープン
#643 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
devtools

調査の方向性

Start by tracing the cook lsp entry point and how CookCLI invokes or pins cooklang-language-server; compare its timer-unit validation with the recipe parser that accepts the example. The report mentions related language-server issue #12, which may identify the relevant code path. Done when valid scalar timer units no longer produce an LSP diagnostic; verify against the reproduction and CLI behavior.

索引モデルが issue の本文から書いたものです。

説明

area: parser bug upstream

Problem

With CookCLI 0.36.0, the language server reports Unknown timer unit for valid scalar timers such as:

Boil for ~{25%minutes}.

The same recipe is accepted by cook recipe -f json, and cook doctor validate passes. In a collection of recipes, the LSP reported this for scalar minutes and seconds units, as well as the tested singular and abbreviated variants. This appears to be an LSP diagnostic mismatch rather than an invalid timer value.

Expected behavior

Timer units accepted by CookCLI's recipe parser should not be reported as unknown by the LSP.

Actual behavior

The LSP emits Unknown timer unit on the timer even though the CLI parses it.

Reproduction

  1. Create a .cook file containing the example above.
  2. Open it in an editor configured to run cook lsp.
  3. Observe the Unknown timer unit diagnostic.
  4. Run cook recipe -f json <file.cook>; the timer is parsed without that error.

Related: #214 covers cook doctor not reporting non-numeric timer values. That is a different case: this report uses a numeric value and concerns the LSP rejecting a unit.

I’d be interested in contributing a fix and would welcome guidance on the relevant code path.

Update: I retested with CookCLI 0.37.0 and still see the diagnostic. Neovim’s :LspInfo reports language-server version 0.2.4. The CookCLI v0.37.0 manifest pins cooklang-language-server 0.2.4, while the current CookCLI main manifest pins 0.3.0. I filed this against CookCLI because it’s the released cook lsp behavior I encountered. I also found the related cooklang-language-server issue #12. I’m happy to follow up in that repo if maintainers prefer.

主要言語
Rust
スター
1.4k
フォーク
120
平均マージ
1日 22時間
マージ済み PR(30日)
128

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cooklang/cookcli のほかの issue

cooklang/cookcli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。