microsoft / microsoft/TypeScript

JSDoc property name is not parsed as expected when non-alphanumeric characters are present and intellisense not showing properties

Đang mở
#36,047 3 bình luận 1 reaction 0 người được giao Xem trên GitHub

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

Needs Proposal Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

TS Template added by @mjbvz

TypeScript Version: 3.8.0-dev.20200104

Search terms:

  • jsdoc / jsdocs
  • completionInfo

  • VSCode Version: 1.41.1 (user setup)
  • OS Version: Windows_NT x64 10.0.17134

Origin of this discovery:
I was trying to document my types which translate to XML classes. The syntax for which includes the "@class" as a property name of my object. This is not possible given the current syntax parsing in VSCode.

Steps to Reproduce:

  1. Place this code in the editor with the language as Javascript
    Code:
/**
 * @typedef Foo
 * @property {string} bar Property shows in intellisense
 * @property {string} @baz Property should show in intellisense but does not
 * @property {string} test Property should show in intellisense but does not
 * @property {string} @class Property name "@class" should be a possible property name that
 * does not get interpreted as a JSDoc instruction.
 * @property {string} even#ThisShouldBeAValidName! But the name is not parsed as expeted
 */

/**
 * @type {Foo}
 */
const fooInstance = {
	
}
  1. Prompt the intellisense to show within the "fooInstance" object.
    1. Expected: The properties @ baz and @ class should be highlighted like normal property names
      1. Actual: The properties are shown as if they were JSDoc instructions
    2. Expected: The property "even#ThisShouldBeAValidName!" should be highlighted like a normal property name
      1. Actual: The property is highlighted as expected until the "#" symbol and then it seems to be treated like a comment
    3. Expected: Intellisense should show all the properties
      1. Actual: Only the first property "bar" is shown. An empty string "" is shown as if it were another property name.

Does this issue occur when all extensions are disabled?: Yes

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi của JSDoc typedef và completionInfo trong trình soạn thảo JavaScript bằng mẫu mã trong issue này. Theo dõi cách phân tích tên @property và cách tạo các mục hoàn thành; hoàn tất khi các tên chứa @, # và ! được giữ nguyên và mọi thuộc tính được liệt kê đều xuất hiện trong IntelliSense.

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

Đánh giá

Công nghệ
javascript, typescript
Lĩnh vực
compilers, devtools
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

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.