-
Notifications
You must be signed in to change notification settings - Fork 229
Remove LocateOwner usage from CodeActions #9037
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
Changes from 1 commit
ddcee04
9b123af
e28a3b8
0f8a378
6edc7da
ef14e95
811fa65
82ebb8d
7008d16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,14 +52,14 @@ public ExtractToCodeBehindCodeActionProvider(ILoggerFactory loggerFactory) | |
| return s_emptyResult; | ||
| } | ||
|
|
||
| var change = new SourceChange(context.Location.AbsoluteIndex, length: 0, newText: string.Empty); | ||
| var syntaxTree = context.CodeDocument.GetSyntaxTree(); | ||
| if (syntaxTree?.Root is null) | ||
| { | ||
| return s_emptyResult; | ||
| } | ||
|
|
||
| var owner = syntaxTree.Root.LocateOwner(change); | ||
| var token = syntaxTree.Root.FindToken(context.Location.AbsoluteIndex); | ||
| var owner = token?.Parent; | ||
|
||
| if (owner is null) | ||
| { | ||
| _logger.LogWarning("Owner should never be null."); | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.