LSP hover emits literal \n in Markdown code fences

Đã đóng Phù hợp với người mới
#1,998 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c

Hướng nghiên cứu

Bắt đầu trong src/eigenlsp.c tại handle_hover, nơi các chuỗi fence " eigenscript\\n" và "\\n " được thêm vào trước khi được JSON-escape lần thứ hai; lần theo đường escape để xem backslash+n literal được tạo ra ở đâu. Tái hiện bằng make lsp và driver briefs/out/r1-8/drivers/hover_format_gap.py, so sánh với hover-format-gap.json. Hoàn tất khi contents.value đã giải mã chứa newline thật quanh fence và các test JSON-RPC bao phủ hover builtin/symbol cùng cả literal số int và float mà không thay đổi các phân loại hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:lint-tooling kind:bug

The LSP hover formatter emits the two characters backslash + n inside its Markdown code fences instead of newline characters. This is inherited by the numeric literal hover added during #1758 R1.8; the formatter already affected builtin/symbol hover on the base.

src/eigenlsp.c:handle_hover appends C strings "```eigenscript\\n" and "\\n```", then JSON-escapes them again. A real JSON-RPC hover over 3.0 returns a contents.value whose Python representation is '```eigenscript\\nfloat\\n```', with zero actual newline characters. Markdown consumers therefore do not receive a fenced code block.

Reproducer: build make lsp, initialize a JSON-RPC session, didOpen print of 3.0\n, request textDocument/hover at line 0, character 9, and inspect the decoded contents.value. The read-only reproduction driver and result are in the R1.8 handoff: briefs/out/r1-8/drivers/hover_format_gap.py and hover-format-gap.json.

Done when:

  • Hover content contains actual newlines around the code block, without literal backslash+n in their place.
  • Real JSON-RPC tests cover a builtin/symbol hover and both numeric literal kinds.
  • Existing hover text and numeric int/float classifications remain correct.

Principle: No silent wrong answers. This is a formatting gap outside R1.8's numeric semantics and is surfaced separately rather than silently broadening that round.

Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
6 giờ 28 phút
Pull request đã merge (30 ngày)
312

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.