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

SparkSense suggested completions only to first level #5

Open
mysterd429 opened this issue Mar 28, 2012 · 4 comments
Open

SparkSense suggested completions only to first level #5

mysterd429 opened this issue Mar 28, 2012 · 4 comments

Comments

@mysterd429
Copy link

I installed SparkSense
(from http://www.google.com/url?sa=D&q=http://visualstudiogallery.msdn.microsoft.com/ef944259-fc8a-42e0-838e-f397957e1d11&usg=AFQjCNHHnbLnNGiY0_1Ya2OX5QfMcw1ogA),
and I get suggested completions when I type "${", but then I can't get
suggestions past the first identifier I type.

As in, if I type "${Ht", I get a suggestion for Html, but if I type "$
{Html.", I get nothing. Pressing control-space from there just gets
me the HTML tags (a, div, p). Code completion for "${Html.NameFor(m
=> m." would be very useful, as it would be for "${ViewData.Model.".

@mysterd429
Copy link
Author

I started looking at the code. Is there a guideline to the structure or what particular methods do? I haven't worked with OLE or the VS SDK before. It seems that the VSIX code is entered through SparkSense.StatementComplection.KeyPressInterceptor.Exec. Is that a good place to start investigating?

Right now, when I run project, it launches the experimental instance of Visual Studio, and it stops at breakpoints that I set, but when I turn off all of the breakpoints, I don't get any code completion at all.

@RobertTheGrey
Copy link
Member

Best place to start I would say is CompletionSource.cs specifically the AugmentCompletionSession method. There you will be able to generate completion sets for the context of where the trigger point is.

Make sense?

@mysterd429
Copy link
Author

Is there documentation about how SparkSense is structured? The learning curve for the SDK seems pretty steep, and I thought I might back my way into it by learning SparkSense first.

I see how AugmentCompletionSet can be used to add to completionSet, but I'm not sure how to get that code to execute. I've opened a .spark file in the experimental instance, but only the Exec method I mentioned earlier gets executed.

@RobertTheGrey
Copy link
Member

I structure SparkSense based on the very thin guidance and examples that were available at the time a few years ago, so it might be that can change to something else if there is a better way, but there's no documentation other than to say that's what I found on MSDN and a few other projects out there at the time.

The Exec is the first place to get hit since it captures the keystroke, and then it attempts to figure out the trigger point I think. Once it's done that, I believe the second part comes in to build up the completion list and it should hit break points there. If it's not hitting yours then I'm not sure what's up

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