ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
801 stars 54 forks source link

Cursor inside bracket after tab autocomplete #86

Closed PixelT closed 9 years ago

PixelT commented 9 years ago

For example: I have a code:

var x = 'example string';

now I write the:

x.

and select one of existing method, using autocomplete by tab (for example I select slice) after using tab, I get the cursor after the parenthesis ( | is cursor )

x.slice()|

I should / would like to receive the cursor inside parenthesis (+ automatically open tooltip / popup with hint):

x.slice(|)

EDIT Or if I have:

"tern_argument_completion": false

and select from autocomplete the method (fn), the parenthesis shouldby added automatically

marijnh commented 9 years ago

I don't know if we can instruct Sublime Text to put the cursor in a given position after completion. If you know of a way, a patch would be welcome.

The argument completion was added in 3bfe80e993f1 by @MANGO1234. Maybe they can take a look?

MANGO1234 commented 9 years ago

Using ${1} will place cursor there, tooltip will display automatically

PixelT commented 9 years ago

@MANGO1234 I quickly tested your patch - works brilliant. Thanks!

marijnh commented 9 years ago

Solved via #89