highlight word under caret occurrences Follow
Hi,
I uninstalled all previous versions and installed PyCharm v1.2EAP. Everything seems to work fine (even better than before). However I can't seem to make all similar words to the word underneath the caret to highlight.
I have confugured the "identifier under caret" options in color settings to yellow so I can easily trace those occurrences but it didn't make any difference. Is there some other option I need to set? I can't remember because in my previous versions it worked.
Any help would be appreciated.
Chris
Please sign in to leave a comment.
Under Settings --> Editor --> General - have you created a new Scheme Name such as paul_1 (example name) and then make the changes to paul_1.
yes. You can check it in here
http://www.flickr.com/photos/xpantazis/5485191942/
Hello Chris,
Please make sure you have "Highlight usages of identifier at caret" enabled
in Settings | Editor.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I have the same problem, the highlighliting sometimes doesn't work.
Hello Jakub,
We'd appreciate code samples on which this problem can be reproduced.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
That was it. I knew there was some other option I just couldn't find it... :-)
Same here.
IDEA 10.0.2. Mac, installed today.
Highlighting is Java is gone :-(, see screenshots
worked like a charm since 7.0...

Alexander
Attachment(s):
Screen shot 2011-03-11 at 12.34.16 AM.png
Screen shot 2011-03-11 at 12.34.03 AM.png
Screen shot 2011-03-11 at 12.34.03 AM.png
Screen shot 2011-03-11 at 12.34.16 AM.png
I discovered an issue somewhat related issue to this. I posted it in an existing youtrack ticket. http://youtrack.jetbrains.net/issue/PY-2290#comment=27-205899
Tested in 1.2 #PY-105.36. but I've witnessed it in prior versions as well.
The file where highlight under caret does not work as expected is called stupid.py and is located in D:\SVN\QA\qa\bench\pxuat
D:\SVN\QA is in the PYTHONPATH environmental variable in windows. It's a "library home" within the project as well.
When the file is inside the library, it does not highlight the other usages.
If I move the stupid.py file to a folder OUTSIDE the library (e.g. D:\SVN\SomeOtherFolder) the "highlight usages of element at caret" works.
Exactly the same thing occurs with Rename. Place cursor on any one of the occurrences of monkey(), select 'Rename'. Change the name in the dialog box, click re-factor and only the primary function definition is renamed.
While playing around with this, I discovered that if I EXCLUDE the parent QA folder in the Project Stucture settings menu, the problem goes away, but that work-around comes with it's own set of problems. Namely the code inspection doesn't appear to function when I set that. Clearly not ideal.
Attachment(s):
highlight_usage.jpg
highlight_usage_working.jpg
Hello Marcel,
If the file is part of your project, then it should be marked as part of
project content and not libraries. You should remove it from the list of
paths in Settings | Python Interpreters and add it as a content root in Settings
| Project Structure. Then both the refactorings and code inspection will
work correctly.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Path appears in the Python Interpreter because it's also in the Windows Environmental Variable PYTHONPATH as a global library. There are scripts and modules that reside in under that path which everyone uses.
Here is what I did (based on your suggestion)
1) removed the path from PyCharm in Interpreters ( this of course meant PyCharm could not find those libraries when running or debugging)
2) Added the folder as a Source in the Project Structure window.
You were right, the editor rename and highlighting works again.
I'm relatively new at Python, so perhaps you can tell me why this works, and what is ultimately the difference between what I had before and what I just did? It seems like having to remove the interpreter path and adding it in the project path is compromise for the editor?
Attachment(s):
proj_structure.jpg
interpreter_paths.jpg
Hello Marcel,
PyCharm 1.2 adds all of the source roots of your project to PYTHONPATH when
you run or debug the project, so the modifications you did should not affect
the way scripts run from PyCharm.
The difference is semantic. PyCharm treats library code as code which is
outside of your project, which should be read-only in most cases and should
not be affected by any refactorings that you perform in the project.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"