Provide non editor-centric APIs

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

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

Đá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
25/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ệ
python
Lĩnh vực
api

Hướng nghiên cứu

Start with the constructors of MoveMethod and MoveGlobal, where the symbol is currently identified by a byte offset into a resource. The request is for an alternative identification by resource plus name, possibly through a factory function that resolves the offset. Read how offset is used to fill the object fields before changing anything. Done means a CLI-friendly constructor path exists and tests cover it, but the maintainers have not yet agreed on the API shape, so confirm the design in the thread first.

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

Mô tả

Is your feature request related to a problem? Please describe.
I would like to write a CLI wrapper for the rope library that is easy to use as a command line user. On the other hand, many Rope's APIs are tailored to be easy to use in the context of editors. In particular, the constructor of the Move objects identify symbols within a python file using the byte offset of the symbol within that file, which is an information that is easy to retrieve by inspecting the cursor of the editor, but awkward to provide as a CLI user. This editor-centric API makes it especially challenging to develop a CLI wrapper for Rope.

Describe the solution you'd like
It would be great if MoveMethod and MoveGlobal offered an alternative way to identify the symbol to move with something easy to input from the CLI instead of offset (for example, they could use resource + name). This change should be feasible, as the offset is not stored as a field in the Move object, but instead only used to retrieve other object fields. Perhaps it could make sense to lift the logic handling the offset in a factory function outside of __init__ and allow the user to inject all object fields in the constructor for finer control if needed.

Describe alternatives you've considered
I researched other attempts at wrapping rope in a CLI and stumbled upon ropecli. By looking at the code, it looks like the author encountered the same problem and had to implement several layer of reverse engineering to retrieve the offset starting from the name of the symbol to move. Moreover, it is not clear whether the implemented retrieval of the offset is precise or best-effort.

Additional context
I am writing ropify, a CLI wrapper for Rope. It would be cool to make this CLI viable for command line users as well.

Ngôn ngữ chính
Python
Star
2.2k
Fork
197
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
5

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 python-rope/rope

Tất cả issue của python-rope/rope

Issue tương tự

Thêm issue về Python

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.