Browse Source

Merged some changes from SharpDevelop to NRefactory.

Daniel Grunwald 14 years ago
parent
commit
980a367bad
  1. 5
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
  2. 4
      ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs
  3. 4
      ICSharpCode.NRefactory.Tests/CSharp/CodeActions/DeclareLocalVariableTests.cs
  4. 17
      ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs
  5. 2
      ICSharpCode.NRefactory/Editor/StringBuilderDocument.cs

5
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

@ -2942,6 +2942,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -2942,6 +2942,11 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
"Includes comments from a external file",
"include file=\"|\" path=\"\">"
);
yield return factory.CreateLiteralCompletionData(
"inheritdoc",
"Inherit documentation from a base class or interface",
"inheritdoc/"
);
yield return factory.CreateLiteralCompletionData(
"list",
"Create a list or table",

4
ICSharpCode.NRefactory.CSharp/Completion/ICompletionDataFactory.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
//
//
// ICompletionDataFactory.cs
//
// Author:
@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion @@ -40,7 +40,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
/// <summary>
/// Creates a generic completion data.
/// </summary>
/// <returns>
/// <param name='title'>
/// The title of the completion data
/// </param>
/// <param name='description'>

4
ICSharpCode.NRefactory.Tests/CSharp/CodeActions/DeclareLocalVariableTests.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
//
//
// DeclareLocalVariableTests.cs
//
// Author:
@ -206,7 +206,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions @@ -206,7 +206,7 @@ namespace ICSharpCode.NRefactory.CSharp.CodeActions
void DoStuff()
{
System.Func<int> getInt = GetInt;
if (getInt () == 0) {
if (getInt() == 0) {
}
}

17
ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs

@ -36,13 +36,12 @@ namespace ICSharpCode.NRefactory.Editor @@ -36,13 +36,12 @@ namespace ICSharpCode.NRefactory.Editor
/// <summary>
/// Creates a new ReadOnlyDocument from the given text source.
/// </summary>
public ReadOnlyDocument(ITextSource textSource, string fileName = null)
public ReadOnlyDocument(ITextSource textSource)
{
if (textSource == null)
throw new ArgumentNullException("textSource");
// ensure that underlying buffer is immutable
this.textSource = textSource.CreateSnapshot();
this.fileName = fileName;
List<int> lines = new List<int>();
lines.Add(0);
int offset = 0;
@ -60,11 +59,21 @@ namespace ICSharpCode.NRefactory.Editor @@ -60,11 +59,21 @@ namespace ICSharpCode.NRefactory.Editor
/// <summary>
/// Creates a new ReadOnlyDocument from the given string.
/// </summary>
public ReadOnlyDocument(string text, string fileName = null)
: this(new StringTextSource(text), fileName)
public ReadOnlyDocument(string text)
: this(new StringTextSource(text))
{
}
/// <summary>
/// Creates a new ReadOnlyDocument from the given text source;
/// and sets IDocument.FileName to the specified file name.
/// </summary>
public ReadOnlyDocument(ITextSource textSource, string fileName)
: this(textSource)
{
this.fileName = fileName;
}
/// <inheritdoc/>
public IDocumentLine GetLineByNumber(int lineNumber)
{

2
ICSharpCode.NRefactory/Editor/StringBuilderDocument.cs

@ -262,7 +262,7 @@ namespace ICSharpCode.NRefactory.Editor @@ -262,7 +262,7 @@ namespace ICSharpCode.NRefactory.Editor
public IDocument CreateDocumentSnapshot()
{
if (documentSnapshot == null)
documentSnapshot = new ReadOnlyDocument(this);
documentSnapshot = new ReadOnlyDocument(this, this.FileName);
return documentSnapshot;
}

Loading…
Cancel
Save