Skip to content

Reenable the 'use auto property' lightbulb.#5743

Closed
CyrusNajmabadi wants to merge 7 commits intodotnet:masterfrom
CyrusNajmabadi:useAutoProp2
Closed

Reenable the 'use auto property' lightbulb.#5743
CyrusNajmabadi wants to merge 7 commits intodotnet:masterfrom
CyrusNajmabadi:useAutoProp2

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

A couple of changes have been made here. We no longer implement this feature as a
'compilation end' analyzer. Instead, it's a 'symbol analyzer'. This should ideally
mean that the results it produces are available much quicker since we don't have to
wait for the compiltion analysis to end.

Previously this was a compilation analyzer because we wanted to also analyze all
usages to see if switching to an auto-prop would break things. Now we eagerly
detect that you can convert to an auto prop, but we defer the conflict check
to when you try to apply the feature (like we do for "inline temp").

A couple of changes have been made here.  We no longer implement this feature as a
'compilation end' analyzer.  Instead, it's a 'symbol analyzer'.  This should ideally
mean that the results it produces are available much quicker since we don't have to
wait for the compiltion analysis to end.

Previously this was a compilation analyzer because we wanted to also analyze all
usages to see if switching to an auto-prop would break things.  Now we eagerly
detect that you can convert to an auto prop, but we defer the conflict check
to when you try to apply the feature (like we do for "inline temp").
Conflicts:
	src/Compilers/Core/Portable/DiagnosticAnalyzer/AnalyzerDriver.CompilationData.cs
@Pilchie
Copy link
Copy Markdown
Member

Pilchie commented Oct 12, 2015

What's the difference between this and #5722? Should that be closed in favor of this?

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

They're different approaches (one tries to avoid creating/calling into a semantic model). We're trying to find out why we're seeing so many perf problems. @mavasani @KevinH-MS and I are looking into things, and we're using these different PRs to investigate.

Conflicts:
	src/EditorFeatures/VisualBasic/UseAutoProperty/VisualBasicUseAutoPropertyAnalyzer.vb
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

retest this please

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

retest prtest/lin/dbg/unit32 please

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

retest prtest/lin/dbg/unit32 please

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user (spelling error)

@CyrusNajmabadi CyrusNajmabadi deleted the useAutoProp2 branch July 14, 2016 03:13
github-actions Bot pushed a commit that referenced this pull request Apr 1, 2025
jjonescz pushed a commit to jjonescz/roslyn that referenced this pull request Apr 28, 2026
* Fix HTML completion race when typing too quickly

- There was a race when typing too quickly our synchronization mechanism would try and reduce the work that was done to cancel pre-existing requests. So in the scenario when you were to type `<tr` what would happen is that 3 completion requests would fire:
    1. Triggered completion for `<`
    2. Typing completion for `t`
    3. Typing completion for `r`
    Now when we sped things up we were able to process requests in parallel which meant that we could handle simultaneous requests for `<`, `t` and `r` all at the same time; however, this in turn results in an interesting behavior where if we ask for completion at `r` while `<` and `t` are still active our synchronization mechanism would aggressively cancel the older requests. For completion this is catastrohpic because it would result in a 0 length completion list because HTML does not respect completion requests beyond trigger characters and the beginning of the word.
- To fix this issue I added a new mechanism for synchronization which takes a flag `rejectOnNewerParallelRequest` which states do not reject a synchronization request aggressively if this flag is `true`. Now this doesn't mean the requests never get rejected. If there's a batched document update or document close / open this will still reject the document; it just means that on the requesting of synchronization that older completion requests are not rejected eagerly.
- Added tests to our projection and synchronization stack to account for this
- Ensured that these changes are not breaking changes so marked some bits as virtual.

### Before

![before image](https://i.imgur.com/sZfGaub.gif)

### After

![after image](https://i.imgur.com/5EsJdDm.gif)

Fixes dotnet#5743

* Update src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/LSPDocumentSynchronizer.cs

Co-authored-by: Allison Chou <allichou@microsoft.com>

* Fix newer tests.

Co-authored-by: Allison Chou <allichou@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants