Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Snippet Injection for Function Autocompletion #114

Closed
wants to merge 1 commit into from
Closed

Snippet Injection for Function Autocompletion #114

wants to merge 1 commit into from

Conversation

yoo
Copy link
Contributor

@yoo yoo commented Dec 23, 2014

Functions are completet as snippets with its parameters as tabstops.
Exampels:
func foo(bar string) -> foo(${1:bar string})
Fuctions as parameters are allowed too:
func foo(f func(bar int), baz int) ->
foo(${1:f func(${2:bar int})}, ${3:baz int})

@yoo
Copy link
Contributor Author

yoo commented Dec 23, 2014

The interface{} type is not selected properly, the '}' is not selected. I think because of atom/snippets#60

@joefitzgerald
Copy link
Owner

Thank you for your contribution! This inspired me during the rewrite of autocomplete-plus, such that the ability to insert snippets will be handled by autocomplete-plus directly. Thanks so much for thinking out of the box on this.

The gocodeprovider gets a new method to extract function parameters
and provide completion of the parameters with the help of snippets.
@yoo
Copy link
Contributor Author

yoo commented Mar 9, 2015

I rebased my changes and cleaned up the commit history.
The function completion now uses the build in snippet magic of autocomplete-plus

joefitzgerald added a commit that referenced this pull request Mar 10, 2015
- Partially based on #114
- Need to fix tests
- Switched approach for matching to regex, will allow for us emitting function results also
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants