This repository has been archived by the owner. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 118
Fixes #301. Fix up ConvertAutoPropertyToPropertyTest #304
Open
ceddlyburge
wants to merge
34
commits into
icsharpcode:master
Choose a base branch
from
ceddlyburge:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…o-implemented property (VB)
Trim symbol searching to the containing type.
Delay grabbing the symbols until they're actually needed, cutting down 625->47 calls on Expression.cs from mcs project. Also, trim symbol search to the containing type.
Reduce the number of DFA per method to once per method from N per method, where N is the number of parameters. Also, delay DFa until really needed
Do not query the semantic model for type information, use ObjectCreationExpression's built-in type information.
Use the syntax tree to trim down possible usages of Equals instead of going to the typesystem directly.
Shortcircuit logic so heavy code is run last.
Shortcircuit logic so heavy code is run last.
Before doing const value evaluation and propagation, do basic AST checks to ensure we're not hitting the typesystem for nothing.
Add a fastpath for object creation.
Was in the wrong spot.
formatting and creating an adhoc workspace are costly operations. Do basic AST checks.
TODO: Check unit test.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi There
This PR only fixes one test, but I though it would be good to discuss some things now. This should avoid the situation where I spend a lot of time fixing up, but I do it in a way that you are unhappy with and then I have to do it again!
I added codescene to the readme for my own benefit, and have just noticed that this made its way in to this commit. I'm happy to take it out again if you would like.
I have done a bigger job than is necessary fixing up ConvertAutoPropertyToPropertyTest, and this is mainly so that we can talk through the kinds of changes I might make later.
CodeRefactoringStatementSyntax
is a wrapper around the Roslyn StatementSyntax that allows me to write fluent syntax. If you ask me to remove this class I wouldn't be too offended.DocumentManipulator
is a base class that allows me to group related code in the same place and avoid the passing of some parameters and other such things. It has aSystemDot
property, which is the bit that works around the Roslyn simplifier bug (that used to simplifySystem.NotImplementedException
toNotImplementedException
if the using statement exists, but no longer does). I am quite attached to this class, as I think I can group all the Roslyn workarounds in it, which will make it easy to remove them once the Roslyn bugs are fixed, or to add new workarounds if there are other problems.ConvertAutoPropertyToPropertyManipulater
descends fromDocumentManipulator
. It is a part of the plan to group all the Roslyn workarounds together, and is quite a neat singly responsible class in my opinion. It also helps cut down on parameter use / passing.PropertyDeclarationContext
andPropertyDeclarationContextFinder
encapsulate a useful bit of code in my opinion, and will be used by other refactorings. They are incidental to the fixing of this test.There was a typo in the test (
using Sytem
instead ofusing System
), which I initially thought was the problem (as opposed to the bug in Roslyn), but I checked for this and the Rosyln problem remained after I fixed the typo.Cheers
Cedd