microsoft / microsoft/TypeScript

Respect Node's `--loader` for VS Code Intellisense

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

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

Awaiting More Feedback Suggestion
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

I would like VS Code to be able to use a custom Node.js loader for Intellisense.

For example, if I remove the .mjs extension from my code, I can no longer see the Intellisense for mime-types.mjs.

But my custom loader does not require the extension.

Here is what I am hoping to see: (without the .mjs extension on the import)

image

I can see the .html reference in the Intellisense drop down.

image

But here is what I actually see:

image

I think that now Node.js loaders are going through the normalization process - heading out of experimental, it is a good time for VS Code to start working on respecting loaders.

Perhaps this could live in .vscode/settings.json:

// .vscode/settings.json
{
    "loader": "./loader.mjs"
}

It would be important to provide different loaders for different directories for more complex projects/monorepos, etc:

// .vscode/settings.json
{
    "loader": {
        "./app-one": "./loaders/my-custom-loader-1.mjs",
        "./app-two": "./loaders/my-custom-loader-2.mjs",
        "./app-three": "react-loader"  // <-- Uses a package as a loader
    }
}

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 việc xem xét cấu hình loader được đề xuất trong .vscode/settings.json và hành vi của Node.js --loader được mô tả trong issue. Xác định cách Intellisense hiện đang phân giải các import không có phần mở rộng, sau đó xác định các tiêu chí hoàn thành cho việc sử dụng một loader hoặc các loader khác nhau theo từng thư mục, bao gồm cả các loader dựa trên package.

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, node.js, vscode
Lĩnh vực
developer-experience, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
25/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.