discussion on #3348

24 views
Skip to first unread message

Ray Lehtiniemi

unread,
Mar 9, 2017, 1:33:30 PM3/9/17
to sphinx-dev

Hi all

Looking at how to properly fix this issue, need feedback on the general approach.

it seems pyobject filter


uses module analyser


seems like the def/class clause


needs to use the spos[0] of the first decorator it saw, rather than the underlying decorated object

so this module needs to be tracking the start position of each new
decorator stack it sees, then use that when it gets to the definition
of the underlying decorated object

does that sound correct?  will that mess up anyone else who's
currently using this module?


Thanks
Ray

Komiya Takeshi

unread,
Mar 10, 2017, 12:24:26 AM3/10/17
to sphin...@googlegroups.com
Hi,

You're right. I agree with you.

>will that mess up anyone else who's currently using this module?

As a quick look, the analyzer is used from following modules.

$ grep -lr Analyzer sphinx
sphinx/directives/code.py
sphinx/ext/autodoc.py
sphinx/ext/autosummary/__init__.py
sphinx/ext/inheritance_diagram.py
sphinx/ext/viewcode.py
sphinx/pycode/__init__.py
sphinx/websupport/search/whooshsearch.py

It seems some modules depends on the analyazer.
so we need to modify it carefully.

Thanks,
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sphinx-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ray Lehtiniemi

unread,
Mar 10, 2017, 6:57:21 PM3/10/17
to sphinx-dev


On Thursday, March 9, 2017 at 10:24:26 PM UTC-7, Komiya Takeshi wrote:
 
sphinx/directives/code.py
sphinx/ext/viewcode.py 

looks like these two are the ones that use the find_tags() method, which is the one impacted by the change
 
sphinx/ext/autodoc.py
sphinx/ext/autosummary/__init__.py
sphinx/ext/inheritance_diagram.py
sphinx/pycode/__init__.py

these guys don't seem like they will be impacted...
 
sphinx/websupport/search/whooshsearch.py

i didn't see where this one used the analyser
 

i posted a new pull request for review.  it seems to work for the literalinclude and viewcode cases, and 'make tests' still passes for me.

Thanks
Reply all
Reply to author
Forward
0 new messages