-
Notifications
You must be signed in to change notification settings - Fork 786
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
Don't suggest names for errors in normal IDE usage #6063
Conversation
This comment has been minimized.
This comment has been minimized.
I don' really think disabling it is the way to go. |
I captured my thoughts on that PR but I'll restate the important bit here:
Disabling this by default while we are still in the VS process for this sort of work is the right thing to do. |
With the same logic you basically need to disable almost every useful
feature. There is always some cost and recalculation involved.
I mean I understand that this is something that we need to balance - that's
why I really wanted to know the impact of that other PR.
Am Mo., 7. Jan. 2019, 19:12 hat Phillip Carter <notifications@github.com>
geschrieben:
… I captured my thoughts on that PR but I'll restate the important bit here:
Fundamentally, this feature is simply *not* built with IDE tooling in
mind. It's great for a batch compile job/command line builds, but for a
long-running process like a language server it's simply calculating and
re-calculating too many things. The feature needs two "modes":
- The current one for batch compile jobs
- An out-of-process spellchecker routine that uses a tree (such as Roslyn's
which uses a BKTree
<http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces/Utilities/SpellChecker.cs>)
to traverse a populated set of symbols independently of the in-proc work
The latter is not something that FCS can do yet. We're going to pursue
this sort of architecture in the future, but not right now.
Disabling this by default while we are still in the VS process for this
sort of work is the right thing to do.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6063 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNMYQi0Lc45sfKvbOWXraeydTuN-xks5vA44YgaJpZM4Zuupn>
.
|
That's a false equivalence. |
Excellent, but I think fsc.exe should not generate suggestions by default either. It should be a pure-IDE, optional feature. |
Yes, this looks like the proper way to deal with it. This way the impact should be so low that I don't see the need to disable this feature at all. |
It'll be heinous to decouple the logic that generates candidates: I'm not particularly keen on doing that but I suppose it's possible. Lots and lots of plumbing values to/from NameResolution if we want the code fix to be able to get the same fidelity of results. A different way could be picked, but something basic like checking matches against all symbols is going to be expensive (I've tested it and it is SLOW), and may not give the same results. If that were crippled to just be within the current document it wouldn't be bad, but then the feature would be inconsistent with using the IDE build. I'm also not in favor of ripping out this feature for fsc/normal build. It's a valuable feature that I wouldn't be pressing on if it weren't affecting CPU and memory so much in the IDE. |
I've noticed this feature to be useful in the IDE. But I've also noticed the computation to be oddly expensive. |
Even if I disagree with disabling this feature by default: I want to thank you folks for working so hard on perf. I think the community really appreciates that kudos! Also big thanks to @davkean for profiling work. |
vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs
Outdated
Show resolved
Hide resolved
@forki Thanks 🙂 - I've actually now changed the code fix to be on by default, but I'd like to play with it a bit more to see what the impact is. This means the code is run differently, so it could mean that the algorithm isn't triggered as much. |
As of the current state of this PR (code fix on by default), the allocations in #6044 are practically gone: And CPU usage doesn't even register. So I think this PR solves the problem. However, suggestions are generated differently than with Build. It is equivalent to invoking completion. Is that considered fine? |
Cool. So ctrl+shift b would still trigger it? How about saving a file? |
@forki So unfortunately due to #6036 you won't see ctrl+B unless you toggle "Build Only": We really need to fix that bug for reasons beyond this, but when it is fixed you should probably see both in the error list. Saving a file does not show it, nor is it in the QuickInfo tooltip (we don't control that, unfortunately). But the fixer icon is in the tooltip area: And of course |
@TIHan @KevinRansom this is ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Not a fan of booleans as arguments, but we can clean that stuff up later. This is worth having to get rid of allocations.
* Don't suggest names for errors in normal IDE usage * Remove flag from parsing and project opens * Move flag into FSharpChecker * Suggest names based on symbols in the current document * Cleanup and turn on code fix by default * Use declarationlistinfo as a source for suggesting names * Reduce diff
Fixes #6044
This turns off name suggestion for errors in the IDE except for Build, instead using Completion as a source of names for suggesting errors in a Roslyn code fix.
The following will still generate suggestions on build errors:
However, names will not be continuously generated when editing code in the IDE and triggering this logic due to having typed an unresolved identifier. This should resolve the current (as of latest dev16.0 branch) biggest source of CPU and memory usage in normal IDE usage for larger solutions.