ligershark / Kulture

Sublime extension for ASP.NET vNext
Other
236 stars 30 forks source link

C# Intellisense #12

Closed shirhatti closed 10 years ago

shirhatti commented 10 years ago

C# Intellisense

Investigating using Roslyn (In-memory C# compiler) and DesignTimeHost to provide code completions in Sublime

Initial Prototype

Initial prototype lives at SublimeSharp

C# Intellisense

sayedihashimi commented 10 years ago

OK I think that should more than enough.

nosami commented 10 years ago

Mine is jasonimison1

sayedihashimi commented 10 years ago

Mine is sayed.ibrahim.hashimi

jchannon commented 10 years ago

Mine is jchannonwinplc

Mpdreamz commented 10 years ago

mine is mpdreamz

sayedihashimi commented 10 years ago

@shirhatti @jchannon @nosami @Mpdreamz @shanselman @davidfowl @glennc I have posted meeting notes from today at https://github.com/ligershark/Kulture/wiki/Initial-meeting---2014.08.03. Feel free to edit that doc as you like.

I'm really excited about this. Let's see what we can build together.

jchannon commented 10 years ago

Regarding my action point, was your thought to pull in OmniSharpSublime into the Kulture plugin ie/make it a dependency?

sayedihashimi commented 10 years ago

@jchannon I don't think that it needs to be a dependency. We can add that to the install guide for readme.md.

jchannon commented 10 years ago

Done!

Do you think its worth setting a list of items that we definitely want from OmniSharpSublime then a list of "nice to haves"?

I've done PRs for it regarding making sure it has the latest OmniSharpServer version and I've done Find Usages for it (not merged as of yet) but was going to do something else next but then thought you guys might want something specific?

bmsullivan commented 10 years ago

I saw the info added to the readme about this and tried to get it working on my Mac yesterday. I managed to get the OmniSharpSublime server running and could see requests and responses from it in the Sublime console as I typed, but the responses didn't contain anything that looked like completion options.

Is this actually supposed to work with ASP.NET vNext yet, or is there more work to do there?

e00dan commented 10 years ago

@bmsullivan I had to download latest version of OmniSharpServer instead of that one supplied with OmniSharpSublime repository and build it to got this working.

bmsullivan commented 10 years ago

@Kuzirashi Thanks, I'll try that!

jchannon commented 10 years ago

Yes there is outstanding PRs on OmniSharpSublime to make sure it uses latest OmnisharpServer. Fingers crossed it gets merged ASAP

e00dan commented 10 years ago

@bmsullivan I had also problems with running OmniSharpServer(missing symbolic link to library System.Core.Dll) on Ubuntu 14.04 so make sure that your fresh build of latest OmniSharpServer is actually runnable from command line via Mono.

bmsullivan commented 10 years ago

Updating to the latest OmniSharpServer did the trick! Thanks! I did notice that things look a bit incomplete (e.g. Tried to complete "Redirect" within a controller with no result. Not sure which isn't working: parent class methods or loading libraries). I presume that's just where things stand right now?

sayedihashimi commented 10 years ago

@jchannon thanks a lot! Regarding your question, could we discuss the prioritization of features in a new issue?

jchannon commented 10 years ago

Possibly. Check in activity monitor if mono sgen is running when you open sublime. Also check the console in sublime to see the request response info as that should show the completions.

On Tuesday, 9 September 2014, bmsullivan notifications@github.com wrote:

Updating to the latest OmniSharpServer did the trick! Thanks! I did notice that things look a bit incomplete (e.g. Tried to complete "Redirect" within a controller with no result. Not sure which isn't working: parent class methods or loading libraries). I presume that's just where things stand right now?

Reply to this email directly or view it on GitHub https://github.com/ligershark/Kulture/issues/12#issuecomment-54906147.

bmsullivan commented 10 years ago

@jchannon - To be clear: a lot of the completions work. I get context-appropriate keywords, properties of user created classes, methods for common BCL classes like String, etc. What I'm not getting, specifically, are completions for members of the Mvc Controller class within my Controller-inherited class. I've also noticed some inconsistency in completing inherited members in subclasses of my own simple objects - old base class properties that have been deleted still appear in the completion list until a new member is added to the base class.

All the sort of stuff I would expect from a work in progress, for sure. Just curious I'm the only one seeing the behavior. If there's any way I can assist with the effort, I'd be happy to.

jchannon commented 10 years ago

@bmsullivan might be worth setting a simple repro up and speaking to @nosami

ThatRendle commented 10 years ago

Anyone had any luck getting OmniSharpSublime working on Windows?

jchannon commented 10 years ago

I've not tried it

nosami commented 10 years ago

@bmsullivan If you're seeing stale completions, then the chances are that the sublime plugin isn't updating the server correctly. For example, in vim, every time a buffer switch is made, vim first updates the server with /updatebuffer to ensure it has the most update version of the previous buffer.

I don't use it, so not sure, but it sounds like a small fix on the client.

As for the Controller members, that should certainly work providing that the MVC assemblies were loaded by OmniSharp server when it started. Try starting the server manually and check the output as it does the initial solution load.

bmsullivan commented 10 years ago

@nosami Sorry to have taken so long to respond. Now that I look at what OmniSharp is loading, it makes sense. In ASP.NET vNext, NuGet references are stored globally (on my Mac, they're in ~/.kpm/packages) rather than in a packages directory alongside the solution. Is there any way to give OmniSharp an additional set of places to look for dlls?

If that's possible, it still seems like it's going to be a bit of a chore to get the right completions. If it knew where to look for the packages, it could look in all the project.json files found under the solution directory for their dependencies and versions, but those would only be top-level packages (e.g. I might have EntityFramework.InMemory in my dependencies section, but not EntityFramework), so I guess it would need to work its way through all the dependency chains by looking at the .nuspec files within the package folders.

Am I missing an easier way to do this?

Edit: After reading a bit more of the previous messages in this thread (shame on me for not doing so earlier), is that what integration with the Design Time Host is supposed to achieve?

nosami commented 10 years ago

@bmsullivan Yes, that's exactly what the DTH integration will achieve :)

https://github.com/nosami/OmniSharpServer/blob/master/OmniSharp/Solution/CSharpProject.cs#L65 <- This is pretty (very) crude, but it should automatically pick up dlls from your ~/.kpm/packages folder.

bmsullivan commented 10 years ago

@nosami Thanks! Looking at the source a bit more closely, I think the problem may be that I'm working without a solution file or a project file. It doesn't look like it will ever look for anything in the .kpm directory that's not specifically referenced in a project file. Am I seeing that right?

I think I may hack together something to handle my specific scenario since I've got a presentation on vNext coming up that I'd like to show this in.

nosami commented 10 years ago

@bmsullivan Yes, you're absolutely right. I have to confess to having not used vNext since the global package cache was introduced so didn't test that PR at all.

If you do hack something together, care to submit a PR? I get to spend very little time working on it at the moment. It only needs to be something temporary to tide people over until DTH integration.

bmsullivan commented 10 years ago

@nosami I'd be happy to! I got something working last night. It's quite naive and brute force, but it works for the simple scenario I want to demo. I'll try to make it slightly less brain-dead so that it doesn't affect non-vNext scenarios and submit a pull request this evening.

bmsullivan commented 10 years ago

@nosami Created a pull request for you (and anyone else on this thread who might be interested) at https://github.com/nosami/OmniSharpServer/pull/108. As stated, it's likely very fragile, use at your own risk. :-)

sayedihashimi commented 10 years ago

The project has moved to https://github.com/OmniSharp/Kulture. If we should continue this conversation let's open a new issue there. Closing now.