-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Smart Rename: Provide additional context for renamed symbol #73873
Smart Rename: Provide additional context for renamed symbol #73873
Conversation
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
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.
Needs to be reworked to be async. needs to work for any roslyn language.
src/EditorFeatures/CSharp/InlineRename/CSharpEditorInlineRenameService.cs
Outdated
Show resolved
Hide resolved
Even though there might be a few places need to be refactored, the general status LGTM, |
src/EditorFeatures/CSharp/InlineRename/CSharpEditorInlineRenameService.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
src/EditorFeatures/CSharp/InlineRename/CSharpEditorInlineRenameService.cs
Show resolved
Hide resolved
src/EditorFeatures/CSharp/InlineRename/CSharpEditorInlineRenameService.cs
Show resolved
Hide resolved
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Show resolved
Hide resolved
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.
tentatively signing off to unblock. though i'm a bit wary about a few things. also, we'venoticed the rename dialog automatically dismissing when brought up when people type. i worry that the complex mix of sync/async processing will add to that issue.
src/EditorFeatures/Core.Wpf/InlineRename/UI/SmartRename/SmartRenameViewModel.cs
Outdated
Show resolved
Hide resolved
@Cosifne it's ready, can you please complete the PR? |
…3873) * work in progress on getting context and almost passing it to smart rename * pass context to SmartRenameSession * attempt to set PromptOverride through Lightup * reflection refinement * Fix CreatePropertySetter in LightupHelpers * Find definitions and references and add them to the context * also capture snippet of surrounding method * simplify * fix GetRequiredLanguageService * undo code cleanup artifacts * use ImmutableArray throughout Roslyn's interfaces * fixup * refactor to get context only if smart rename is active * revert the now unnecessary change * restore CreateFunctionAccessor with 2 parameters * Dont duplicate work of getting rename locations * use interface in the method declarations * fix warning * remove IInlineRenameSession from the API * cleanup * refactor getting doccomments * fixup * PR feedback * Add IEditorInlineRenameService.IsRenameContextSupported * revert unnecessary change * remove unnecessary changes * doc comments * expose TriggerDocument instead of creating a property that returns a field * add feature flag to control whether we're getting context * improve event handler name * fix Correctness_Analyzers warnings * update Feature Flag look * fix Freeing Twice assert * add 'requires restart' to the FF name * cleanup usings * extract constants * remove unused code * NumberOfContextLines const * GetRenameContextCoreAsync doc comments * pr feedback on CSharpEditorInlineRenameService * override fixes * enforce hard limits on amount of symbols we traverse * Get context off UI thread, respond to property changed on UI thread * undo unwanted file * Remove CSharpRenameContextHelper; improve the provided context * modifiers and doc comments * remove never taken branch * Remove IsRenameContextSupported * PR feedback to move TryGetSurroundingNodeSpanAsync to parent class * use CompletesAsyncOperation pattern for SessionPropertyChanged * Create IAsynchronousOperationListener in the constructor * improve algorithm that provides context snippet --------- Co-authored-by: Shen Chen <shech@microsoft.com>
…text Cherry (#73873) into 17.11
Provide references, definitions and documentation of renamed symbol in Smart Rename. The purpose is to improve quality of suggestions, and ultimately remove the need to provide the entire document.
The feature is gated behind a feature flag, visible to MSFT internal users:

When feature flag is set, additional data is collected and attached to the prompt, for example: