TAB completion what it returns - canopy

my apologies for being stupid, but I am new to Canopy.
What does completion return?
when I type
print(), I get a list of %%??? items.
I am looking for info about the print() function or other functions.
I am sure it's in that manual but I can't find it.
Steve

Tab completion tries to show you a list of everything that might complete what you are typing.
print is unusual because it is both a python 2.7 keyword and a python-3-compatible function. IPython doesn't know what you want to print so it shows you the beginning of a list of every name it knows.
In contrast, if you type plot? you will see good help for matplotlib's plot function, etc.

Related

Gosublime:How does it can show me the function's params informations when it works

It can work good with sublime text 2,now i want to know the function's params count and type,it only show me the function's return type. The plugin can't do the thing,is there any methods can solve the problem ? or we can modify the code to reach it
When you start typing, the auto-completion will indeed show you only the return type.
But as soon as you select one (and remember, with Go, you will have only one method with a given name), you will see the function parameters directly in the code.
To get more out of the tooltip presented by GoSublime, you would have to modify the gosubl/mg9.py script.

Xcode auto completion to replace function call name - how to drop placeholders?

Xcode's auto-completion is often getting in my way by giving me argument placeholders when I already have them. Here's an example:
I want to change that second MoveToPoint to AddLineToPoint, so I delete part of the name, and hit control + space for the Show Completions command. I get something like:
You see the annoyance. I tab complete the name, but now I have to delete the 3 arguments, the commas, and the parentheses. This kind of thing annoys me and throws off my flow when writing code.
Ideally I'd like a way to delete these placeholders with one command, or have a separate auto-complete command, so along with Show Completions (control + space), I could bind something like Show Completions without Placeholders. Does anyone know how to do that?
XCode does support this actually. They call it "Select Previous Completion". Check it out here (under Code Sense).
You essentially just hit ⌃> (hold control and press >) for XCode to choose your previous completion. It think it only works well though if the new method you're calling takes the same number of arguments as the previous one.
Hope this helps

Error calling similar() in Sikuli

l = find("Start_menu.png").similar(0.5).anyColor()
click(l)
The above is an excerpt from my code. "Start_menu.png" refers to an image of the Windows Start Menu. I got the following error when I executed this:
File "C:\Users\VPRAVE~1.TSI\AppData\Local\Temp\sikuli-tmp8636618870597770744.py", line 1, in
l = find("1368426219510.png").similar(0.5).anyColor().anySize()
AttributeError: 'org.sikuli.script.Match' object has no attribute 'similar'
Could some one help me out with this? And could some one tell me how to use anyColor() and anySize()?
find attempts to find something when it's called. So what your code says, in prose, is "find something that looks like 'Start_menu', then make the thing you found 0.5 similar, then make that any color"
This is wrong--you can't set the similarity threshold after the fact. Instead, call it as seen in the Sikuli docs.
Instead, say
l = find(Pattern("Start_menu.png").similar(0.5))
Here's the same code arranged vertically:
pattern = Pattern("Start_menu.png")
pattern.similar(0.5)
l = find(pattern)
The other problem is your reference to the anyColor() function, which doesn't exist. I see the code you're trying to run is from "Sikuli: Using GUI Screenshots for Search and Automation" (linked from the Sikuli docs), but this function (and the syntax used in that paper) don't exist in any extant version of Sikuli. You can see an open feature request for it on the Sikuli launchpad page.
This doesn't help you now, though. I don't know of another visual automation package that can do anyColor. If you wanted to use that feature for something, I suggest asking a new question where you describe the problem you're trying to solve, and someone may be able to suggest a work-around for that specific case.

can I edit Xcode code completion suggestions?

I love the code completion in Xcode, it saves me a lot of typing work. Also, it confirms my code is probably error-free in real time. However, to me, some code suggestions are disturbing. For example, when I type else after an if-statement, Xcode suggests this:
else {
statement
}
I'd like to change this to just:
else
statement
Because, I quite often just want to use one line of code there, and adding curled brackets goes much faster than removing them. The other annoying thing is the fact that using such a suggestion takes the return key, while a new line does as well. So, if I would want to use my preferred way as shown above, I would first have to press the escape key in order to stop Xcode suggesting it, and then press the return key. Not a real pain, but I think it's unnecessary.
There are some other code suggestions which I would like to change, but I think I have made my point already. Is there a way to change these code suggestions? I know Apple doesn't provide an easy way within Xcode itself, but I'm willing to dive into the finder for the file with suggestions and change it manually. Thanks!
in your example, it would work to add a space after typing else. Doing that removes the brace suggestion and you can just hit enter.

few vim autoinserts for ruby needed

I want to try the following things in vim insert mode:
to have closing bracket/parenthesis inserted (after the cursor) every time I type the opening one
to have #{} inserted whenever I type # inside "" (optionally, inside %() too)
I know it is possible, but my competence in this part of vim does not even reach the self-starter level.
This script will do the first one (auto inserting the closing bracket and placing the cursor between the brackets.)
lh-brackets helps define brackets related mappings. It also provides a few functions aimed at defining context-sensitive mappings and abbreviations (see Map4TheseContext).
If in ruby %() is associated to a syntax highlighting, Map4TheseContext will also solve your last request. If not, you'll have to play with searchpair() to detect the current context. Let me know if you have troubles to come up with a working solution.

Resources