highlight word under caret occurrences

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

11 comments
Comment actions Permalink

Hello Chris,

Please make sure you have "Highlight usages of identifier at caret" enabled

in Settings | Editor.

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.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

1
Comment actions Permalink

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.

0
Comment actions Permalink

I have the same problem, the highlighliting sometimes doesn't work.

0
Comment actions Permalink

Hello Jakub,

We'd appreciate code samples on which this problem can be reproduced.

I have the same problem, the highlighliting sometimes doesn't work.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

That was it. I knew there was some other option I just couldn't find it... :-)

0
Comment actions Permalink

Same here.

IDEA 10.0.2. Mac, installed today.

Highlighting is Java is gone :-(, see screenshots

worked like a charm since 7.0...Screen shot 2011-03-11 at 12.34.03 AM.pngScreen shot 2011-03-11 at 12.34.16 AM.png

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
0
Comment actions Permalink

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.

highlight_usage.jpg

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.

highlight_usage_working.jpg

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
0
Comment actions Permalink

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.

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.

Image:highlight_usage.jpg 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.

Image:highlight_usage_working.jpg

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.

---

Original message URL:

http://devnet.jetbrains.net/message/5297976#5297976

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0
Comment actions Permalink

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.

proj_structure.jpg

interpreter_paths.jpg

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
0
Comment actions Permalink

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.

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.

Image:proj_structure.jpg

Image:interpreter_paths.jpg

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?

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Please sign in to leave a comment.