Library mode or breaking-change-awareness

Next thing I would like to discuss is "library mode". I mean maintaining
existing (and fixed) API during refactorings. In this mode, Resharper should
never break any existing code. Instead, refactorings that affects public
API should produce new code and mark old code as , with meaningful
description. Consider examples:

  • Rename member. Memeber is renamed, and another member with old name is

created with [Obsolete("Use ]]> instead")] and call to new name.

  • Rename type. Type is renamed and another type with old name is created,

which derives from type with new name. If type is sealed rename refactoring
is disabled for this type or message is displayed with the reason and option
to unseal and rename.

  • Change signature. If "proxy method" is checked, it just works as before.

If not, proxy method is still created, but marked obsolete.

Some refactorings cannot be executed in such compatibility mode, for example
rename enum member. In this case warning should be displayed or refactoring
blocked.

This should be per-project setting, and probably tri-state: Normal mode,
Library mode and Strict library mode. The two latter differs in the way that
"Library mode" allows refactorings that breaks existing code after a warning,
and the "Strict library mode" simply disables all such refactorings.

In either mode, it would be useful to put icons for refactorings, which depicts
compatibility-safety.

What do you think?

Sincerely,
Ilya Ryzhenkov


Please sign in to leave a comment.