szabototo89 / CodeSharper

Refactoring tool, written in C# and using TDD for developing
1 stars 0 forks source link

[bug][core] Refactor TextRange and TextDocument classes #25

Closed szabototo89 closed 9 years ago

szabototo89 commented 9 years ago

We should refactor TextDocument and TextRange classes according to design ideas.

TextRange should not have Text property (or should not pass it), just Start, Stop and Length.

szabototo89 commented 9 years ago

TextDocument should have the following properties:

interface ITextDocument {
  String Text { get; }
  TextRange TextRange { get; }  // returns TextRange of whole TextDocument
}

TextRange should have the following properties:

interface ITextRange {
  TextDocument TextDocument; // reference to original text document
  Int32 Start, Stop, Length;  // some information about the text
  String Text; // returns TextDocument.Text.SubString(Start, Stop);
  IEnumerable<ITextRange> Children  // Shouldn't be observable?
}
szabototo89 commented 9 years ago

It is done.