Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installed knockoutjs intellisense stops working #26

Open
nunofilipecosta opened this issue Apr 3, 2014 · 4 comments
Open

When installed knockoutjs intellisense stops working #26

nunofilipecosta opened this issue Apr 3, 2014 · 4 comments

Comments

@nunofilipecosta
Copy link

When this extension is active, visual studio's / web essentials intellisense support for knockoutjs stops working..

Is it possible to create a resharper-knockoutjs extension ? I would gladly start it but I have no previous experience in creating resharper extensions...

Thanks

@citizenmatt
Copy link
Member

This extension shouldn't affect the VS/Web Essentials intellisense, at least not directly - ReSharper itself takes over the code completion for JavaScript. This can be disabled in the ReSharper -> Options -> IntelliSense -> General options page (select Limited ReSharper IntelliSense and check the languages you want ReSharper to handle and uncheck the languages for VS)

That said, of course it's possible to create a Knockout extension. I don't know Knockout well enough to know what features to add, but from what I can see, it's mostly about a mini-DSL in the data-bind attributes. So that would require parsing the mini-DSL and providing code completion - and it would have to know the scope of the objects. These are similar to the issues I'm working on with parsing AngularJS expressions.

I think this extension would be a good place to start if you want to try and start your own, and I'm more than happy to help (with pointers to the right thing, if I can't contribute code). But in my opinion, the best place to start is a feature list! Write out the things you'd like to see in a ReSharper extension, and we can see what it would take to get them implemented.

@nunofilipecosta
Copy link
Author

If i Limited ReSharper IntelliSense because for javascript of KnockoutJS it will not show AngularJS IntelliSense , if I enable it it does not show KnockoutJS , I don't think anyone will ever mix both libraries but I don't think it's reasonable to keep changing settings when changing project I will be coding ...

But I'm really interested in creating the Knockout extension and the features should be very simple, I think you are right " it's mostly about a mini-DSL in the data-bind attributes"

IntelliSense on the data-bind attribute for
Built in bindings
Custom binding
View model members

like in this blog Jonh Papa wrote
http://www.johnpapa.net/knockout-intellisense-in-visual-studio-2012/

@citizenmatt
Copy link
Member

Cool post - I didn't realise VS did all this! I'm in grave danger of being nerd sniped on this.

The mini-DSL bit is one of the most interesting parts of ReSharper extensibility, but also one of the most under-documented - it's not for the faint of heart, sadly. That said, if you're interested, it's the code here: https://github.com/JetBrains/resharper-angularjs/tree/master/src/resharper-angularjs/Psi/AngularJs.

Interestingly, I think the Knockout syntax could be easier to handle than angular - the binding syntax seems to be quite simple - binding: member, binding: member. Angular has custom expressions.

Right now, I'm thinking about starting a new repo for knockout support. But I need to read up on knockout and better understand what it's doing and how it could work in ReSharper first...

@nunofilipecosta
Copy link
Author

I will read the resharper extension documentation in order to get the basic stuff ready ( coding, building, debug , testing ), and try to make some modification of some kind in a fork of angulajs extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants