Deeplink to open a theme block by its type value specified in the liquid schema

Đang mở
#631 0 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 2 ngày

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

Đánh giá

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

Hướng nghiên cứu

Bắt đầu từ phần xử lý schema của LiquidRawTag(node) được nêu trong issue và theo dõi cách các liên kết tài liệu được tạo ra. Kiểm tra các đường dẫn schema.ast và schema.validSchema, bao gồm các khối preset lồng nhau và các khối cục bộ. Được xem là hoàn tất khi nhấp vào một loại khối sẽ mở asset blocks/.liquid tương ứng.

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

Mô tả

enhancement

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
It would be good DX to allow theme developers to deeplink through theme block type in blocks and preset nested blocks

Describe the solution you'd like
A clear and concise description of what you want to happen.
Deeplink click to open the corresponding theme block asset

Checklist

  • I have checked and made sure that the proposal adheres to this plugin's principles

Additional context
Add any other context or screenshots about the feature request here.
Something like this

// {% schema %}{ "blocks": [{ "type": "█" }] }{% endschema %}
LiquidRawTag(node) {
  if (node.name !== 'schema') return;
  if (!schema || isError(schema.ast) || isError(schema.validSchema)) return;
  const offset = node.blockPositionStart.end;
  const blockDefs = schema.validSchema.blocks;
  if (!blockDefs || hasLocalBlocks(blockDefs)) return;
  return blockDefs.map((def, i) => {
    const type = def.type;
    const typeNode = nodeAtPath(schema.ast, [blocks, i, "type"]);
    return DocumentLink.create(
      Range.create(offset + locStart(typeNode), offset + locEnd(typeNode)),
      Utils.resolvePath(root, 'blocks', type + ".liquid").toString(),
    );
  });
}
Ngôn ngữ chính
TypeScript
Star
245
Fork
108
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
24

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

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 Shopify/theme-tools

Tất cả issue của Shopify/theme-tools

Issue tương tự

Thêm issue về TypeScript

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.