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

Remove unused type #73352

Merged
merged 1 commit into from
May 6, 2024
Merged

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner May 6, 2024 18:57
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 6, 2024
@@ -138,7 +137,6 @@ protected virtual void GetServices()
this.EditorOptionsService = this.Package.ComponentModel.GetService<EditorOptionsService>();
this.Workspace = this.Package.ComponentModel.GetService<VisualStudioWorkspaceImpl>();
this.EditorAdaptersFactoryService = this.Package.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();
this.AnalyzerFileWatcherService = this.Package.ComponentModel.GetService<AnalyzerFileWatcherService>();
Copy link
Member Author

Choose a reason for hiding this comment

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

we would create the instance her.e HOwever:

  1. nothing ever read this feild in this type.
  2. the constructor for that type does nothing.

Copy link
Member Author

Choose a reason for hiding this comment

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

i noticed this as i wanted to move these calls into the constructor of AbstractLangService, and i wanted to make sure none of them were doing anything wonky.

[method: Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
internal sealed class AnalyzerFileWatcherService(SVsServiceProvider serviceProvider)
{
private readonly IVsFileChangeEx _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));
Copy link
Member Author

Choose a reason for hiding this comment

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

the constructor of this type does nothing except grab a service, which it places in a field, but never uses.

}
}

internal void TrackFilePathAndReportErrorIfChanged(string filePath)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the only thing that could cause this type to do anything interesting. but it has no callers in roslyn. so this entire type is pointless.

removing. if someone can find a scenario where this is needed, we can return it. but we've clearly never noticed that it was doing nothing up till now.

@CyrusNajmabadi
Copy link
Member Author

@ToddGrun ptal.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants