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

Issue with Auto Complete adding extra words and characters #8

Closed
StevenDStanton opened this issue Dec 25, 2014 · 5 comments
Closed
Labels

Comments

@StevenDStanton
Copy link

In Mono and using unityvs for Visual Studio when you go to auto complete a line such as Input.GetkeyU and hit tab it just fills in to the end which allows you to continue working

This is the result of doing it in Visual Studio

if(Input.GetKeyUp)

The cursor is possitioned right after the p so I can add in my (KeyCode.X)

In Sublime Unity Completions there are several issues

What I get is this

if(Input.Input.GetKeyUp(KeyCode key);)

It is adding an additional Input command at the top

It Higghlights the entire KeyCode key area where it should just place a cursor after KeyCode. as that will be the useage of this command 99% of the time

Also it adds a comma at the end not detecting that it is in an if statement

@oferei oferei added the bug label Dec 25, 2014
@oferei
Copy link
Owner

oferei commented Dec 25, 2014

hey, thanks for the input.

It is adding an additional Input command at the top

this is a limitation of Sublime Text's auto-completions, as I've explained here.
I cannot change the way it works. the way I work around this is by starting to write InputGetKeyUp - without the period.

It Higghlights the entire KeyCode key area where it should just place a cursor after KeyCode. as that will be the useage of this command 99% of the time

that is how the auto-completions work in Sublime Text. but it kinda makes sense. the highlighted area is the function parameter (name and type) which should be replaced by your argument. yes, 99% of the time you'd want to pass KeyCode.X to GetKeyUp, but that is only right for GetKeyUp and other functions that receive an enum value.

Also it adds a comma at the end not detecting that it is in an if statement

you're right. I'll change it so it doesn't add a semicolon. I cannot tell how the function call is used (condition of if statement or nor) so I'll just change it so it never adds the semicolon.

@oferei oferei closed this as completed Dec 25, 2014
@StevenDStanton
Copy link
Author

Your welcome,

I have never written a plugin like this. However, I know in snippets you can specify where you want the cursor to be placed.

for example as a snippet I would do something like

Input.GetKeyUp(KeyCode.${1:A})

@oferei
Copy link
Owner

oferei commented Dec 25, 2014

I think you're right about the technical side. but how should I determine that GetKeyUp's argument begins with "KeyCode."?
and is that even true? many games' keyboard setup is configurable. instead of Input.GetKeyUp(KeyCode.LeftShift) you'll see Input.GetKeyUp(runKey).

@StevenDStanton
Copy link
Author

Ah very true, good point I had not thought of the other GetKeyUp options.

@oferei
Copy link
Owner

oferei commented Dec 25, 2014

I've removed the semicolons.

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

No branches or pull requests

2 participants