PyCharm3 Live template not working at all - python

I just switched from Eclipse/PyDev to PyCharm 3 CE. I can't get the live templates working any ways. Followed every documentation I can find online like this:
http://www.jetbrains.com/pycharm/webhelp/live-templates.html
And the builtin python template super(Generates a 'super' call) does not work either.
By "not working", I meant that when editing a python file in PyCharm and typing the abbreviation, the popup snippets list does not include the live templates, even though they are under the Python template group.
Am I missing something?

I am using PyCharm 3.1 Professional (evaluation version) and am having the same issue.
However, using Ctrl+J will bring up templates as will Code -> Insert Live Template. It is also possible to start typing a code snippet and then press Ctrl+J to see a filtered list of templates.

Don't forget to also select the "context"...

Related

Why is Pycharm not highlighting TODO's?

In my settings, I have the TODO bound to highlight in yellow, yet in the actual code it does not highlight. Here is a screenshot of my settings: Editor -> TODO
Does anyone know how to fix this?
EDIT: I even tried re-installing Pycharm and I still have the issue.
EDIT 2: In the TODO Window, it is saying "0 TODO items found in 0 files". I believe this means it is looking in the wrong files to check for TODO items. However, when I try to find TODO items in "this file" it still doesn't work. Does anyone know why this is?
Go to Preferences (or Settings), Project Structure, and make sure the folder with your files is not in the "Excluded" tab's list.
Click the folder you want to include and click on the "Sources" tab. Click Apply, then OK!
It should work.
I recently updated PyCharm Professional and my TODOs no longer worked. I went into settings and changed the alert icon, then saved, and retyped them and they worked. I imagine for my case, there was a delay in the new version picking them up. Might just need to retype them to get them working again, though the reboot should have addressed this.
Not sure if your pattern is causing this, but mine is set up like so, with two separate patterns:
\btodo\b.*
\bfixme\b.*
Neither is case sensitive, BTW...
Perhaps try some other patterns to see if you can get those to work.
I think the problem for me was the same as explained by #theBrownCoder but I couldn't find the project structure settings.
Apart from not showing TODO's another symptom was impossibility to go to function definitions defined in other files and inability to rename python files with the error: "Selected element is used from non-project files. These usages won't be renamed."
Googling for this the solution that worked for me was to delete the .idea folder (make sure to back it up just in case, you will lose the configurations).
I had the exact same problem, and the solution suggested by theBrownCoder worked perfectly.
For those who cannot find which menu theBrownCoder is referring to, go to File > Settings > Project: "Title of Project" > Project Structure.
It is in the dropdown of Project in Settings where you can also select your Python interpreter.
It might be the file type.
Right click, Override File Type.
I had this issue with a text file and it's copy, only the first one would use #TODO

How do you create a live template in Intellij with a variable name inside the abbreviation?

I am trying to create a live template in Intellij by using an abbreviation like:
for$index_name$
to create the template text:
for $index_name$ in
For example, I want the abbreviation forj to produce for j in. I have not found anything regarding this in Intellij's live template documentation. If such a thing is possible how would it be done?
Somebody from JetBrains has said that
"Such functionality is currently not available and not very likely to
be added in near future, sorry."

Bottle Template Support?

I'm using PyCharm 3.4.1 and learning MongoDB from Mongo University. In the code, they have us using Python to create html pages using the MVC pattern with bottle.
When I add a file of type .tpl to the editor in PyCharm, there is no "intellisense" or support for the model in the code. Changing it to be in the list of html file types helps some, but no python support in the editor.
Is there a plugin or some other change i can make to support editing better? Seems someone else asked something similar earlier in the year at How to get tpl files highlighted in pycharm?
Bottle comes with a built-in template engine called SimpleTemplate which is not currently supported by PyCharm.
There is a relevant feature request: Bottle microframework support, but it doesn't explicitly state about .tpl syntax support.
I'd go and create a feature request in PyCharm's issue tracker asking about SimpleTemplate syntax support or, at least, vote up and comment in the existing issue.
For example, there is the similar feature-request for tornado template engine:
Add Tornado Template Support
It has currently 56 votes up which is probably increasing the possibility of seeing it happen.
As a workaround, you can configure .tpl file type under Settings -> File Types. It is possible to set highlighting rules there.

Make viewcode show module sources

I am trying to make a cookbook out of some Python snippets using Sphinx. Each snippet is a self-contained Python script and has a tutorial-type doctsring.
I want to have a source link in the generated documentation to display the script contents. But viewcode does not seem to create this link for the module, but only for a function or a class with a docstring. Is there a way to coax sphinx.ext.viewcode to display the script code without having any class/function in it?
I hope you haven't sat for two years waiting for an answer, but try using the literal include tag. You can play around with what gets displayed.
See the sphinx docs for more details.

Navigate to a specific module in PyCharm

I use PyCharm as my IDE for working with Django. So far, it's navigation shortcuts have proven very useful. I can go to a specific (project) file with Ctrl+Shift+N, I can go to any class definition with Ctrl+N and can go to any symbol with Ctrl+Shift+Alt+N.
This is great, but lately I've seen that it would be very useful too to have a shortcut to move to a specific external (or project) module.
Is there any shortcut where I can pass for example: django.contrib and show the modules for inside django.contrib package or base64 and show me the modules match for base64, just as easy as I can go to a specific, symbol, class, file?
I feel your problem. All you have to do is Ctrl + CLICK on the definition. Please note, however that this does not provide the actual files. What I mean by this is that it does not re-direct you to the actual function, but rather a skeleton of the function.
If you want to go to the actual function, you will need to go it it my clicking on external libraries on your sidebar and do a search.

Categories

Resources