CFML: tag `<cfinclude template="…">` creates no edge; included functions are not attached to the component (mixins)

Đang mở
#2,651 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.

  • #2886 của @johnhldiver-beep — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
devtools

Hướng nghiên cứu

Start by locating how script-style CFML includes create imports edges, then trace component parsing and member resolution. Compare that path with tag-form cfinclude handling for component-level includes. Done means literal tag includes create an edge and component-level included functions resolve as members of the component and its subclasses.

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

Mô tả

Summary

Script-style include "x.cfm"; produces an imports edge. The tag form does not.

Our project has 246 <cfinclude template="…"> with a literal path, and none of them appears in the graph. All 9 imports edges in the index come from script includes.

Example

<!--- contens/core/baseform.cfc --->
<cfcomponent output="false">
	...
	<!--- shared parts of forms, lists and exports --->
	<cfinclude template="formlistshared.cfm">
</cfcomponent>
  • formlistshared.cfm is indexed, and its functions (checkRightsPartPrepare, checkRightsPartRecords, …) appear as top-level function nodes.
  • There is no edge from baseform.cfc to formlistshared.cfm.
  • The functions are not members of baseform or its subclasses.

A component-level include is the common CFML mixin pattern: the included functions become methods of the including component and of every component that extends it.

Path styles seen (all literal)

Style Count
relative to the current file (../x/y.cfm) 128
same directory (formlistshared.cfm) 67
mapping-rooted (/contenscms/..., depends on mapping support, see the dotted extends issue) 46

Expected

  1. An imports (or includes) edge for <cfinclude template="…">, the same as for the script form.
  2. When the include sits at component level (outside <cffunction>), the included file's functions count as members of the component. Calls such as this.checkRightsPartPrepare() or unqualified calls in subclasses then resolve.
Ngôn ngữ chính
C
Star
73.2k
Fork
4.7k
Merge trung bình
3 giờ 37 phút
Pull request đã merge (30 ngày)
533

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 colbymchenry/codegraph

Tất cả issue của colbymchenry/codegraph

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.