Closed
Bug 1221137
Opened 9 years ago
Closed 9 years ago
`callers` needles in the Python plugin point to the calling function's header
Categories
(Webtools Graveyard :: DXR, defect)
Webtools Graveyard
DXR
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jeff.bradberry, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1
Build ID: 20150828090403
Steps to reproduce:
Created the test case:
class UnicodeOffsetTests(PythonSingleFileTestCase):
source = dedent(u"""
# -*- coding: utf-8 -*-
def kilroy():
return "Mr. Roboto"
def main():
# domo arigato
print u"どうもありがとう " + kilroy()
""")
def test_call_offsets(self):
# Check that the offset of the function call is calculated in
# unicode characters, not bytes.
self.found_line_eq('callers:kilroy', u' print u"どうもありがとう " + <b>kilroy()</b>', 9)
Actual results:
The test failed:
AssertionError: [(u'def <b>main</b>():', 7)] != [(u' print u"\u3069\u3046\u3082\u3042\u308a\u304c\u3068\u3046 " + <b>kilroy()</b>', 9)]
i.e. the needle in question was pointing to the header of `main`, instead of to the call location of `kilroy`.
Expected results:
The test should have succeeded, if the behavior of the `callers` needles in the Python plugin was consistent with that of the clang plugin.
Comment 1•9 years ago
|
||
It could be that the Python plugin copied the behavior of the old clang plugin, before I made it actually point to the callsites. We should indeed fix this.
Comment 2•9 years ago
|
||
Commit pushed to master at https://github.com/mozilla/dxr
https://github.com/mozilla/dxr/commit/348026a6bdea921e6f5e4e6ba0bf7c4103ea65a6
Fix parsing of Python "coding cookies", and make caller searches find callsites rather than containing functions. Fixes bug #1221137. Close #487. Close #476.
Updated•9 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•4 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•