LuaLS / LuaLS/lua-language-server

Generated doc JSON is invalid utf-8

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

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

主要言語
Lua
スター
4.4k
フォーク
442
PR マージ指標
30日以内にマージされた PR はありません

説明

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows WSL

What is the issue affecting?

Other

Expected Behaviour

JSON document output from --doc is standard utf-8 encoding.

Actual Behaviour

When trying to parse the JSON with our site builder, Ruby fails with:

jekyll 3.9.3 | Error:  (/home/rhys/spring/doc/site/_data/doc.json): invalid leading UTF-8 octet at line 1 column 1
/usr/share/rvm/rubies/ruby-3.2.3/lib/ruby/3.2.0/psych/parser.rb:62:in `_native_parse': (/home/rhys/spring/doc/site/_data/doc.json): invalid leading UTF-8 octet at line 1 column 1 (Psych::SyntaxError)
        from /usr/share/rvm/rubies/ruby-3.2.3/lib/ruby/3.2.0/psych/parser.rb:62:in `parse'
        from /usr/share/rvm/gems/ruby-3.2.3/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb:143:in `load'

Opening the file in VSCode suggests that it is indeed utf-8, but clicking UTF-8 in the footer and then "Save with encoding > UTF-8" reserializes the file and the parser error is cleared.

Sorry I'm not more specific with the error, I don't know a great deal about file formats.

Reproduction steps
  1. Export docs
  2. Somehow check if they are properly encoded?
Additional Notes

No response

Log File

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

--doc によって呼び出されるドキュメントエクスポートのエントリーポイントから始め、次にエクスポートを再現して、生成された JSON の先頭バイトを調べます。報告された Ruby/Jekyll サイトビルダーで、エクスポートされたドキュメントを標準 UTF-8 として正常にパースできれば、issue は完了です。

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

評価

技術スタック
lua
領域
documentation
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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