Re: [Builder] Function and class fuzzy search for Python source code?



On 05/24/2019 08:41 AM, Pierre Equoy wrote:
Yes, I should be able to do this. Actually, I've already something
functional that can return a list of functions and classes from
python files in a given directory (along with their line number and
in what file they are located), but I need to know what data
structure is needed exactly.

As I said, I currently search for:

- functions - classes

And I can return:

- function or class name - path to the file they are located in -
line in that file where they are located

Is that enough?

Actually, maybe all of my questions could be answered with: is there
a documentation for that IdeCodeIndexer interface?:)

The complicating factor is that we almost certainly want to run the
python script to extract symbols from the build container which may look
very different from the host, or Builder's mount namespace, and has all
of the application dependencies.

Having a self-contained python script (that can do py2 and py3 if
possible) would allow us to copy it into the build environment and
execute there. The in-process plugin for Builder could consume that
and implement the appropriate indexer interface.

Implementing the IdeCodeIndexer interface from Python isn't as friendly
as I'd like because doing async tasks in Python is rather cumbersome
and the API is designed for performance, not flexibility. But the NPM
plugin does implement it in Python and can serve as an example.

-- Christian


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]