Giter VIP home page Giter VIP logo

Comments (2)

lieryan avatar lieryan commented on May 28, 2024

Hi @niqodea, thanks for writing this issue. Having a non-editor-centric API is a fairly common request, so I'd be open to pull requests implementing this. Would you like to take a stab at implementing this? I think you probably have a better idea of how a non-editor centric API should work than I do anyway.

If I understand correctly, this should be possible by exposing create_move(..., name: PyName) in the API as well as the class constructors. Currently, create_move() uses eval_location() to get the pyname, but for a non-editor API, you'll need get a PyName by name, which can be done by using the module/scope interface like so:

In [22]: eval_location(mod, 6425 + 10) # offset of `class Project()` inside the file
Out[22]: <rope.base.pynamesdef.DefinedName at 0x7f730b1e3050>

In [26]: dn = proj.get_module("rope.base.project")["Project"]
Out[26]: <rope.base.pynamesdef.DefinedName at 0x7f730b1e3050>

So once the pyname parameter is exposed, you will be able to do something like so:

create_move(proj, proj.get_module("rope.base.project").resource, name=proj.get_module("rope.base.project")["Project"])

This will require changing the create_move(), MoveGlobal, and MoveMethod.

Aside, do you want to add ropify to the Wiki page?

from rope.

niqodea avatar niqodea commented on May 28, 2024

Thank you for the guidance! I will be happy to contribute when I have time.

Aside, do you want to add ropify to the Wiki page?

With pleasure!

from rope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.