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

Implement DocumentHighlightsService #1943

Merged
merged 14 commits into from
Dec 16, 2016

Conversation

vasily-kirichenko
Copy link
Contributor

@vasily-kirichenko vasily-kirichenko commented Dec 5, 2016

It ignores documentsToSearch parameter as I'm not sure what it's for, maybe look at it in the future.

@vasily-kirichenko
Copy link
Contributor Author

OK, it was a wrong ImportingConstructorAttribute. It now works:

image

@cartermp
Copy link
Contributor

cartermp commented Dec 5, 2016

Awesome

@vasily-kirichenko
Copy link
Contributor Author

It's ready

1

@forki
Copy link
Contributor

forki commented Dec 5, 2016

💋

@dsyme
Copy link
Contributor

dsyme commented Dec 6, 2016

This whole change looks great

  1. I'm concerned that we need to get a measure on how adding new FCS requests like this is changing the overall quality of the tools. Every new request that goes into the FCS queue means a change in the status quo, though it feels really hard to get a grip on the impact of the change
  • There is a risk of placing too much "stress" on the FCS queue, particularly if these requests are never cancelled. While this request is running, the FCS queue is unavailable to serve other requests.

  • If those other requests were effectively the same request anyway, then that's not such a big deal. Indeed the request can actually help fill the caches for the current document, so that when you're moving he cursor around, the cache gets populated for the current document. This might mean the next press of "." or goto-definition or whatever responds more quickly.

One specific thing is to understand whether Roslyn issues a cancellation for the request if the cursor moves into a different area, or if the user changes visible files. If it does, that helps make sure the FCS queue is not being choked up with useless work.

Perhaps @vladima has experience w.r.t. performance testing for the typescript implementation, which also uses a single workqueue.

@vasily-kirichenko
Copy link
Contributor Author

@dsyme

@dsyme
Copy link
Contributor

dsyme commented Dec 6, 2016

We have such a tagger implemented in VFPT without cancellation and it works totally OK

Yep, I use it all the time. I think it's actually a help because of the warm-the-cache-when-the-user-interacts effect

But what I'd really like is a methodology where we actually knew the effects of these changes through automation. Really we want to replay 100 typical editing sessions on small and big projects and take some statistics (e.g. longest UI pause, average reaction time etc.). But that's essentially impossible to do in an automated way.

@vasily-kirichenko
Copy link
Contributor Author

AFAIK there should not be any UI pauses at all (unless there is a GC pressure), because all Roslyn API is asynchronous. It does not matter what we do in background threads, the UI should stay responsive and it's guaranteed by core Roslyn code we plugged into. The fact that it's used by C#/VB editors as well makes some confidence that it interacts with UI thread carefully and it's battle tested since VS 2015. So I think this PR brings a better tagger than we have in VFPT.

@dsyme
Copy link
Contributor

dsyme commented Dec 8, 2016

AFAIK there should not be any UI pauses at all (unless there is a GC pressure), because all Roslyn API is asynchronous. It does not matter what we do in background threads, the UI should stay responsive and it's guaranteed by core Roslyn code we plugged into.

My experience in using VS2017 RC (master or bleeding-edge) is that there are a lot of UI blocks (at least when using a large solution which might indicate GC pressure). One known one seems to have been Ctrl-Space, though that's being fixed. But I'm seeing lots of non-responsiveness.

But I agree that this PR should generally be OK.

@dsyme dsyme closed this Dec 8, 2016
@dsyme dsyme reopened this Dec 8, 2016
@cartermp
Copy link
Contributor

cartermp commented Dec 8, 2016

@dsyme Could you try and enumerate some of these cases in an issue? I think it would be really helpful to have some of these tracked. I've noticed some related to msbuild blocking the UI thread when f5'ing, but generally my issues have more been related to things like typechecking not being complete.

fix tryClassifyAtPosition
@vasily-kirichenko
Copy link
Contributor Author

@KevinRansom please merge it, it includes tryClassifyAtPosition (good) fix.

@KevinRansom
Copy link
Member

@vasily-kirichenko
can you take care of the merge issue please, then I will pull

Thanks

Kevin

@vasily-kirichenko
Copy link
Contributor Author

Done.

@KevinRansom KevinRansom merged commit 6dd77c7 into dotnet:master Dec 16, 2016
@vasily-kirichenko
Copy link
Contributor Author

It was broken, I've committed fix.

nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
* implement DocumentHighlightsService

* use the right ImportingConstructor attribute

* tolerate being on the right of the identifier

* add a DocumentHighlightsService test

* fix erroneous qualified symbol ranges (wip)

* fix `fixInvalidSymbolSpans`

* fix after merge

* update Microsoft.CodeAnalysis.xxx packages to 2.0.0-rc

* remove double try to find symbol

* fix after merge

fix tryClassifyAtPosition
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

Successfully merging this pull request may close these issues.

6 participants