Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving scoring: post unexpected results here #40

Open
slazyk opened this issue May 2, 2014 · 11 comments
Open

Improving scoring: post unexpected results here #40

slazyk opened this issue May 2, 2014 · 11 comments

Comments

@slazyk
Copy link
Member

slazyk commented May 2, 2014

Post here the cases when the default choice is not what you'd expect.

Usually such cases can be resolved by adjusting scoring function parameters (available in plugin settings under Advanced). But I try to gather such cases myself because it might be worth to tweak the plugin's default parameters or scoring function based on common cases.

Before posting, make sure you're using the newest plugin version (can be seen in settings), and the default scoring parameters (can be reset in settings).

If your expected completion is missing from the list, Xcode isn't indexing, and it's there with plugin disabled then report a separate bug.

Most of relevant information can be presented in form of a screenshot, so this is the preferred way. Make sure you have following options enabled in plugin settings (or you provide the same information in text):

  • Basic > Sort By Score (few best completions in order)
  • Basic > Show List Header (actual query in original letter case)
  • Advanced > Show Scores (the scores of the completions)

And indicate which completion you'd expect to be selected by default. Wether you are using iOS or OS X SDK and mention third-party frameworks if relevant.

Xcode (with or without the plugin) remembers recent completions, and learns to score them higher. Therefore indicate wether the problem occurs all the time or goes away (after you choose once or a few tmes).

Example

Here I actually had to choose NSOSF1OperatingSystem once just before the screenshot, so it's score is fairly high. But I do sporadically experience this one even without choosing it.

screen shot 2014-05-02 at 13 27 59
It happens when using OS X SDK, I would expect NO to be selected by default, the problem usually goes away after just once choosing NO.

@slazyk
Copy link
Member Author

slazyk commented May 2, 2014

Reported in #34, both iOS and OS X, lowercase ns, expected NSArray/NSString/..., does not go away.
screen shot 2014-05-02 at 14 49 26
Can be resolved by decreasing Context and increasing Learning parameter (e.g. to 0.25, 0.75).

@wookiee
Copy link

wookiee commented May 26, 2014

When typing if (to begin an if/else statement), I get these results:
screenshot

@slazyk
Copy link
Member Author

slazyk commented May 27, 2014

@wookiee I cannot see neither if nor ifelse on your list. If that is the case, it is not a matter of scoring (as mentioned in the first post).

Please open a separate issue with more details (on when and where in the code it happens) if with plugin disabled you get if and ifelse on the list, and with plugin enabled you don't.

If the if and ifelse are still missing after disabling the plugin (e.g. you get 'No completions') then Xcode does not think you can insert an if statement there. This happens for me when I type if inside [] where it does not make sense. Xcode might also be confused for some reason (e.g. indexing, runaway brace, syntax or other error in the same file). Please confirm wether the issue actually persists.

@jshier
Copy link

jshier commented Aug 4, 2014

I see the issue with the literal BOOLs almost always. Usually it's NO that isn't marked appropriately (I've never used NSOSF10OperatingSystem, except perhaps by accident), but sometimes YES gets marked down as well. While I can deal with this fairly easily, it seems to annoy some of my coworkers enough they've stopped using the plugin.

(Weird. As soon as I was done writing this I turned the visible scoring on to see if I could get some better data, and now it completes YES/NO correctly every time. NSOSF10OperatingSystem still scores absurdly high for something that has never been used. Perhaps I've gotten used to manually correcting the BOOL literals and the appropriate values now score higher.)

@haaakon
Copy link
Contributor

haaakon commented Jan 8, 2015

I often have problems writing numbers. In 99% of the cases i just want the number and not a random function that has a number in its name. Suggested fix: Maybe have just the number as the default autocomplete, then functions under it.

screen shot 2015-01-08 at 10 33 59
screen shot 2015-01-08 at 10 32 07
screen shot 2015-01-08 at 10 31 28

screen shot 2015-01-08 at 10 36 55
screen shot 2015-01-08 at 10 36 42

@akolov
Copy link

akolov commented Jan 22, 2015

Swift booleans are always a problem, both "true" and "false" get replaced with DYLD_BOOL types "TRUE" and "FALSE"
screen shot 2015-01-22 at 4 45 28 pm

@alem0lars
Copy link

Same problem of @akolov .. Booleans are really annoying.

Why there aren't language builtins in completions?

Ty ;)

@jshier
Copy link

jshier commented Jan 26, 2015

Other Swift issues include parameter names (doesn't seem to recognize that I'm typing a name and tries to complete for everything) and closure capture parameters (same issues). Really annoying to have to escape out of the completion menu.

@alem0lars
Copy link

Are there any news on this issue (booleans in particular) ?

@slazyk
Copy link
Member Author

slazyk commented May 4, 2015

Are you actually missing the Bool true/false from the completion list? Is it also the case with plugin turned off?

Without importing Foundation I get only Bool true and false.
With Foundation I also get (among other things) Int32 true and false, and the DYLD_BOOL uppercase TRUE and FALSE but those loose in terms of scoring with case matching lowercase versions (unless I actually type it uppercase).

@meilbn
Copy link

meilbn commented Jul 5, 2015

I have same suggestion with @haaakon , @slazyk can you improve it? please.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants