LuaLS / LuaLS/lua-language-server

Generated doc JSON is invalid utf-8

未關閉
#2,983 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

--doc 呼叫的文件匯出入口開始,接著重新執行匯出並檢查產生的 JSON 開頭幾個位元組。當匯出的文件能在所回報的 Ruby/Jekyll 網站建置器中作為標準 UTF-8 成功解析時,該 issue 即完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
lua
領域
documentation
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。