简体   繁体   中英

When writing TypeScript in Sublime the autocompletion doesn't add brackets

When I write TypeScript in SublimeText and I let Sublime autocomplete a method, Sublime doesn't add the brackets.

For example when I write:

this.

And I let the autocomplete do his work, I get:

this.getHeroes

Instead of:

this.getHeroes()

I have been searching for a solution but this seems like default behavior that can't be adjusted. Has anyone found a solution for this?

Has anyone found a solution for this

Does not exist. You will have to write your own.

Note that its not trivial because autocomplete generally only inserts text. If you want to get this.getHeroes() you would probably need to move the cursor too this.getHeroes(/*here*/) . Also think you want to give this function to someone eg setTimeout(this.getHeroes) you probably didn't mean to call the function but just want a function reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM