omnisharp-emacs
                                
                                 omnisharp-emacs copied to clipboard
                                
                                    omnisharp-emacs copied to clipboard
                            
                            
                            
                        We need a company-mode interface to autocompletions with import statements
Hey guys, good news.
I implemented completing stuff from non-imported namespaces, and it works great.
But I only did this for the popup and ido display functions. We
need someone to implement the functionality for company-mode as
well.
Here's the gist of it:
- there is a new setting called
omnisharp-auto-complete-want-importable-typeswhich holds the user's preference on including them on normal, "everyday" completions
- when the setting is t, the server will respond with a new RequiredNamespaceImport property in the AutoCompleteResponse. This needs to be put to the beginning of the current file so imports stay in sync.
- for that purpose I made a new function,
omnisharp--insert-namespace-importwhich takes the value of the RequiredNamespaceImport property (typically e.g. "System.IO") and inserts "using System.IO;" at the very first line of the file. There is even a test for this =)
I'm happy with the result. Inserting the namespace doesn't disrupt the user in any way since point doesn't move at all. It's completely transparent. Friday evening well spent!
@bbbscarter @nosami
Also, boring maintaining tasks:
- update README.mdwhencompany-modestuff is ready
- promo pic!
- increment version number when merging
Oh wow! That sounds very cool :)
I'll try and see if I can get it working some time over the weekend unless @bbbscarter beats me to it! I suspect that he could do it much more quickly than I could ...... but I like a challenge :)
Did you know that there is an NRefactory helper method to add a using statement (and keep them in the correct order) ?
https://github.com/nosami/OmniSharpServer/blob/master/OmniSharp/CodeActions/FixUsingsHandler.cs#L249
fyi - I'm very unlikely to look at this over the weekend. Maybe, one night during the week, but don't count on it.
Don't stress it :)
Nobody will ask their money back.
On 17.08.2014 14:26, Jason Imison wrote:
fyi - I'm very unlikely to look at this over the weekend. Maybe, one night during the week, but don't count on it.
— Reply to this email directly or view it on GitHub https://github.com/sp3ctum/omnisharp-emacs/issues/101#issuecomment-52419431.
As company-mode completes automatically without pressing a keybinding, I propose that a separate function is created that applies the inverse of omnisharp-auto-complete-want-importable-types.
Does that make sense?
Sorry for not chiming in earlier, busy week.
I’ll try and get some time this week to look at both of these!
On 17 August 2014 at 22:18:04, Jason Imison ([email protected]) wrote:
As company-mode completes automatically without pressing a keybinding, I propose that a separate function is created that applies the inverse of omnisharp-auto-complete-want-importable-types.
Does that make sense?
— Reply to this email directly or view it on GitHub.
@nosami Yeah, good idea.
2014-08-18 0:35 GMT+03:00 bbbscarter [email protected]:
Sorry for not chiming in earlier, busy week.
I’ll try and get some time this week to look at both of these!
On 17 August 2014 at 22:18:04, Jason Imison ([email protected]) wrote:
As company-mode completes automatically without pressing a keybinding, I propose that a separate function is created that applies the inverse of omnisharp-auto-complete-want-importable-types.
Does that make sense?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub https://github.com/sp3ctum/omnisharp-emacs/issues/101#issuecomment-52435940 .
not available on the roslyn server, WantImportableTypes is ignored.. postponing