Provide non editor-centric APIs
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 2.2k
- 分支
- 197
- 平均合併
- 1 天 20 小時
- 30 天內合併 PR
- 7
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-rope/rope 的其他 Issue
-
難度 1/5 1-3 小時 新手友好度 88/100
python-rope/rope#927 ·
維護者通常 2 天內回覆
-
Extract raises IndexError or ModuleSyntaxError instead of RefactoringError for an empty or whitespace-only region可能已有人在做 @aliassar 於 2 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
python-rope/rope#926 ·
維護者通常 2 天內回覆
-
simplify.real_code blanks t-strings, so renames inside them edit the wrong offset可能已有人在做 @sean0407 於 12 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
python-rope/rope#913 ·
維護者通常 2 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 48/100
python-rope/rope#935 ·
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 30/100
python-rope/rope#925 ·
維護者通常 2 天內回覆
相似的 Issue
-
follow-up needs-triage S3: minor
難度 2/5 1-3 小時 新手友好度 72/100
manaflow-ai/cmux#36856 · 1 則留言 ·
維護者通常 1 天內回覆
-
documentation good first issue help wanted
難度 1/5 1-3 小時 新手友好度 90/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 73/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
-
Shell framework build fails at "copy the shader libraries": the iOS shader libraries are now one file b-<chain>.img可能已有人在做 @xiaofeng-han 今天認領。 未關閉build ios
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆