thecocce / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Wrong scope being displayed when hovering over global variable #421

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
checker = 3

def sub():
  global checker
  checker = 0

sub()
print checker

What is the expected output? What do you see instead?
Hover over the checker variable in function sub(): the pyScripter editor claims 
that checker is a local variable of function sub. The print statement confirms 
that in fact the variable is global as one would expect

What version of the product are you using? On what operating system?
Version 2.1.1.0 running on Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by pdaif...@nvidia.com on 23 Sep 2010 at 4:32

GoogleCodeExporter commented 9 years ago
I already used command file and simple example above works. However the 
attached file will demonstrate issue I got.

Original comment by chanh.q....@gtempaccount.com on 23 Sep 2010 at 4:49

Attachments:

GoogleCodeExporter commented 9 years ago
To fix this issue I need to parse the global statements.  This is easy to 
implement but it would add to the overhead of parsing source files.  I am 
pondering whether the gain is worth the overhead.

Original comment by pyscripter on 8 Oct 2010 at 10:01

GoogleCodeExporter commented 9 years ago
I would argue that this is worth fixing, because in a real-world situation, you 
could be looking at several hundreds of lines of code between the global 
declaration and the use of the variable that you're hovering over, meaning 
there is no obvious way to see that the information being displayed is 
incorrect.

Original comment by pdaif...@nvidia.com on 11 Oct 2010 at 8:36

GoogleCodeExporter commented 9 years ago
Fixed in version control

Original comment by pyscripter on 12 Oct 2010 at 3:11