Skip to content

refactor diagnostic analyzer service v1 state management code - #930

Merged
heejaechang merged 8 commits into
dotnet:masterfrom
heejaechang:stateRefactor
Feb 28, 2015
Merged

refactor diagnostic analyzer service v1 state management code#930
heejaechang merged 8 commits into
dotnet:masterfrom
heejaechang:stateRefactor

Conversation

@heejaechang

Copy link
Copy Markdown
Contributor

refactored diagnostic analyzer service v1 state management code.

removed all AnalyzerAndState types and split its responsibilities to HostAnalyzerManager and StateManager.

now StateManager owns everything related to state and it now has 4 APIs that will either move state forward, remove state, get cached data or get latest data.

@heejaechang

Copy link
Copy Markdown
Contributor Author

@srivatsn @mavasani @shyamnamboodiripad can you take a look?

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.

Why? I'd thought we explicitly want to de-duplicate. Is the suggestion here that situation is too contrived to be assumed realistic?
I could accidentally come up in a situation with duplicate analyzer references. A project nuget reference might be pulling in analyzer and it might also be installed in the box on some machine which wants specific analyzer enabled for all development. I don't want to remove project nuget reference if not all of machines on which project is developed on has VSIX or host analyzer.
Is it non-trivial to de-duplicate here? Else, we should just do it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mavasani that de-duplication will work. so, having same analyzer reference (basically same file) in multiple places regardless of layer (host, project) works.

the one I removed is same instance of diagnostic analyzer in two different analyzer reference. for this to happen, people has to do what the test did. create custom analyzer references and put same instance of diagnostic analyzer in multiple references.

I don't think that is something we need to care.

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.

Agreed, thanks for the explanation.

some code clean up - rename and such

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.

Your point 2. is not possible in VS scenario with just analyzer file references, but possible through our Workspace APIs creating AnalyzerImageReferences. Probably can ignore it, but I presume it broke some tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ya, the test you have put some comment above about de-duplication. I think if a user deliberately did that, they will get duplicated diagnostic.

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.

Why was this requireUpToDateDocumentDiagnostic check removed? did it move somewhere else? diff view is not enabling me to figure out what happened here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

since state can't never be null now.

@srivatsn

Copy link
Copy Markdown
Contributor

Looks fine to me.

@heejaechang

Copy link
Copy Markdown
Contributor Author

@mavasani manish?

@mavasani

Copy link
Copy Markdown
Contributor

Looks good to me too. Do you want to go first or let me go first? :)

@heejaechang

Copy link
Copy Markdown
Contributor Author

Hmm. I thought you already did. How I got merge conflict…

  •      Heejae
    

From: Manish Vasani [mailto:notifications@github.com]
Sent: Friday, February 27, 2015 4:58 PM
To: dotnet/roslyn
Cc: HeeJae Chang
Subject: Re: [roslyn] refactor diagnostic analyzer service v1 state management code (#930)

Looks good to me too. Do you want to go first or let me go first? :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/930#issuecomment-76500262.

@mavasani

Copy link
Copy Markdown
Contributor

Nope, probably from previous checkin. I am just running final test.cmd after addressing review feedback.

heejaechang pushed a commit that referenced this pull request Feb 28, 2015
refactor diagnostic analyzer service v1 state management code
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.

5 participants