mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
a73d7ba Added async/await support to the resolver. d0e9ce0 CodeDomConvertVisitor: choose between CodeIndexerExpression and CodeArrayIndexerExpression. DefaultParameter: fixed bug in interning - two parameters with different names were considered equal for interning. 7ff012f Fixed some issues in the CodeDomConvertVisitor. fd8f8cf Adjust AST for async/await. e4d1f54 Add CodeDomConvertVisitor. af5ae57 Added type case for resolvenode at location. 770b5c6 fixed possible null ref. ddaaaaf added some more attributed nodes. abd8372 fixed some attributed node formattings. 6ef3944 Implemented attribute section formatting. 2e67d54 Now all formatting tests are green! a1a80b6 Fix StackOverflowException when subtyping does not terminate due to expansive inheritance. a48acf0 put variable initializer assign into the right node. cc9cea0 Fixed missing commas. a9bae21 fixed 'params' location. 84135f5 Fixed lambda parameter commas. 9e909e1 Found wrong indexer pos. 994f931 fixed dot location. fbb77b7 fixed indexer locations. 8d630fd Fixed array initializer brace position. bb59175 Fixed constraint commas. 8680670 Fixed endif position. 9d55421 Fixed attribute argument commas. f6de4e3 improved error msg. c133a2a Handled #if values. 72b2ff1 Added labeled statement colon. 7f141c0 fixed goto location. d63f1fa Fixed named argument expression. 6043039 Fixed base type comma order. 618cb98 Fixed initializer comma locations. aee84bd Fixed nullable position. 3147a3a Fixed enum positions. 0fb1105 Fixed attribute section locations. 2ba4a18 Location of global attributes was wrong. Fixed for tests - should be inserted like the comments for the real fix. e07b8fa Fixed some dot locations. 0dd3117 Fixed empty statement end location. 7ed3af2 Updated mcs (fixed char posititions). cff7997 Fixed some declarator assign token locations. 8fb218b Handled pre processor directives - fist approach. 9d3c076 Fixed some issues with comment insertion. d683689 added serializable attributes. 61c9894 removed debug message. 22a97b5 Added 'default' section keywords. a2a077f added enum member assign token & case label colon token. 71f47a6 Added more debug output. 2cad4e3 fixed location bug. 50f95d3 Updated mcs. d1db72b Added missing "new" keyword. 382f695 Fixed some locations in array create expression. 14d0638 Fixed implicit/explicit operator locations. 03babc6 Corrected constructor locations. 0d6d9ac Added type parameter variances & tokens. 76249ec Added explicit interface dot. babe656 Fixed some dot locations inside member type names. c671230 Fixed type argument commas. 1b21681 Fixed literal values of bools. 99b1a32 Added debug message. 42e49ce Fixed operator declaration operator location. 15b30e9 Corrected comma locations. 2e6b746 Improved error messages a bit. a1a649e Remove ITextEditorAdapter and use IDocument instead. 0413ce9 Added completion engine stub. eb6c399 Moved to completion namespace. c82538e Added basic code completion interfaces. 42aa01a Improved error message. 74bc8b2 Fixed chevron & constraints locations. 64b7dff Removed more target framework profiles. 20ba899 Improved error message. 3303c99 Corrected constraint locations. 2fc0c7c Fixed bug with class keyword. 5e8e124 Removed client target framework profile. 65d8773 added dots in using declaration. eddd015 Fixed enum member commas. b1fa379 Fixed location bug. ea6e15c Fixed method/operator semicolons. ab28842 Added base type comma tokens. 9b28b28 Fixed colon / optional commas in type delcarations. 96195ac fixed +-1 issue. 0ee8198 * Log.cs: * ICSharpCode.NRefactory.csproj: * CSharpParser.cs: bd01cad Fixed parameter comma locations. f302311 Fixed positioning error. 9de8c14 Fixed resolving event declarations. dfc9860 Move ICSharpCode.Editor into NRefactory. b7a17c2 Adjust unit tests to InvocationResolveResult changes. b5b2408 Move NRefactory.CSharp to separate assembly. e37dc4b Move ResolveResults to NR.Semantics 8e78ca4 Use path combine. 447558f Fixed parser test set up for non windows systems. 611c310 Change IConstantValue API to use ResolveResult. 6bc485f Merge NRefactory changes from SharpDevelop into NRefactory repository. ea42e63 Fix bug that caused the wrong part to be removed from a compound class. e73c078 Make Find References multi-threaded. e7d9bf6 Fixed attribute section tests. 957c48e Fixed query expression tests. 02fe3e3 Fixed array create expression tests. e926745 Fixed resolver bugs that caused unit test errors. bb03113 Allow recursive synchronization (e.g. for calling GetTypes() on a single project content while a composite project content is synchronized) 683d353 Implemented "Find references" a06110c Rename ParsedFile to CSharpParsedFile. 8885484 Add IndexOf() method to ITextSource. be53547 Merge branch '4.1' into newNR 558e158 Fix resolver crashes 46676a4 Add GetInterestingFileNames to FindReferences. Fixed a few resolver issues related to find references. 7f11fe3 Fixed bugs that caused some nodes not to be resolved in a "resolve all" run. 42bc87b Change ResolveVisitor to report the location of conversions. 4cc64bb Fixed resolving LINQ group joins. 5b17740 Use explicit interface implementation in ResolveVisitor to make it clear what the public API is supposed to be. f807e61 TypeSystemAstBuilder: when a type reference cannot be resolved but is a C# type reference, output the original C# code that was used to created the type reference. 023e13b Merge changes from SharpDevelop into the main NRefactory repository. b193dc9 FastSerializer: Add support for 'Fixed Instances', e.g. for serializing object graphs that have references to a singleton. a5865bd Implemented "Find References". 33abc64 Replace AstNode.GetResolvableNodeAt() with the ResolveAtLocation helper class. a93fd14 Adjust unit tests and fix bugs introduced by caching. 2b3d669 Add ITypeResolveContext.GetKnownTypeDefinition() for efficiently retrieving built-in types. 8a05ada Don't keep the per-using scope and per-type definiton caches around longer than necessary. ecdf195 Cache simple name lookups more aggressively. 50f7041 Cache resolved CSharpConstantValue. 47eb183 Reuse Conversions instance across multiple files by storing it in the CacheManager. 82fad4e Use 'UsingScopeCache' instance for caching the extension methods. 2be1569 Add cache for implicit conversions for 25% performance boost. Also did some improvements to interning. 391a6bc Cache resolved SimpleTypeOrNamespaceReference/MemberTypeOrNamespaceReference, and intern those references. 3fdf0ee Implemented resolver for LINQ queries. 3bbc3f6 Fixed NullReferenceException in MethodGroupResolveResult.ResolveInvocation(). Implemented resolving local variables that are declared as 'const'. fb8d152 Fixed deserialization of XmlDocumentationProvider. dafc2c6 Add back ResolverService.Resolve(); and use it to implement tool tips. f7fe227 Add AssemblyName to IProjectContent. b1804fd Add position-checking unit test to NRefactory. 9d0e6ae Resolver: added support for collection initializers and nested object initializers. da92bc4 Fix crash when serializing SimpleProjectContent. Add failing unit test for an attribute section with two attributes. f4bd875 Initial implementation of CSharpAmbience. fa7e478 newNR: fixed build errors in AvalonEdit.AddIn and CSharpBinding. 12d7961 Add SerializationBinder-support to FastSerializer. a5c93a3 Adjust resolver to object initializer AST changes. 87992d3 Fix build for NRefactory.VB. 62b9fce Always create ArrayInitializerExpressions. 405e87e Fixed location bug. 36c412d Allow serializing SimpleProjectContent and parsed C# type references. 769c0ae Allow CecilProjectContent to be serialized. Add FastSerializer to NRefactory.Utils. abbf9d6 Used the namedexpression instead of assignment/namedargument expressions. 3e99fab Fixed object create expression tests /remove named expression lists (was an obsolete node). I tried out the node, but choosed to go with namedexpression + arrayinitializerexpression because it's semantically the same. c373100 Fixed ComplexCollectionInitializer tests. 3763397 Introduced namedexpression/namedexpressionlist to handle the collection initializers better. 0ecf1fc Fixed collection initializer parsing. c76dd64 WIP 59c4e5c WIP: new NRefactory 06b143b Member lookup: Fix IsAccessible bug for protected static members. Make CSharpResolver.ResolveMemberType() return a non-parameterized type when all type arguments are UnboundTypeArgument. ea3e312 Implemented grouping overloads by declared type. Return overrides in most-derived class (necessary for determining the correct parameter names/IsOptional value), but keep them in the group where the virtual/abstract base method was. 7a2c59a Add GetMemberOptions. f79b0a7 Resolver: array create expressions 2c49c71 Report resolve results back to the navigator. 69ae15a Add support for partial classes. c9c2044 Fix type inference and overload resolution when a class type parameter gets substituted by a method type parameter. 5c585e1 Apply license header to unit tests. Add parser unit tests for ObjectCreateExpression. a1f613e ResolveVisitor: skip tokens and comments Make the resolver's debug output more readable. 4372b61 Fixed lambda type inference for nested (curried) lambdas. b52a348 More work on lambda expressions. cd99dce Fix bugs caused by the introduction of user-defined operators. 43b5897 Add support for user-defined operators. 37626e1 Expose conversions as part of the ResolveResult. f86a014 Put MIT license into the file headers. e51e3a9 Add InvocationResolveResult. 8c8caf7 Implemented type inference for implicitly typed lambdas. 6792a0c Report which kind of conversion was found. d59fd2b C# Resolver: preparations for lambda support e17ba74 Add unit tests for TypeSystemAstBuilder. fd8050a Merge changes from SharpDevelop into the main NRefactory repository. b97543a A few small API changes for NRefactory. a9a6e16 Add ID string provider + a few resolver bugfixes 77c7d08 Implemented disambiguation for identical simple names and type names. (e.g. "public Color Color;") 21d2121 CecilLoader: add support for reading module attributes, security declarations and marshal information. 18fb49c Add TypeKind enum. bb2f93a NRefactory bug fixes: - Use IType.Equals() instead of == operator - Change handling of partially parameterized types in IType.GetNestedTypes so that we don't leak type parameters from the wrong context - Add support for unbound types to C# resolver (e.g. in attribute arguments) - C# Parser: preserve variance modifier - Ensure all interface members are marked as 'abstract' - Add support for [TypeForwardedTo] and [ComImport] to CecilLoader. 3e75554 gitignore for ICSharpCode.Editor 849ed04 Merge NRefactory changes from ILSpy into the main NRefactory repository. 89ba05f C# calls indexers "Item", not "Items". 811784e Re-implemented IType.GetMembers() to avoid redundant specialization. 877ebf8 Remove operator == from AstNodeCollection. c15615d fix bug in remove braces action. 2ce741b Keep ITextEditor in the IDE (comment out the copy in ICSharpCode.Editor) 3ba9118 fixed bug where parameter is null. 58b8d06 Visit empty expressions. 6abb0a1 IDocument now derives from IServiceProvider. cb70bce Add strong-name to NRefactory; small API changes for ICSharpCode.Editor. fa6afb2 Fix ResolveVisitor.VisitArrayCreateExpression. b0819ac Supporting installing a NuGet package into selected projects in one step. c428246 use Is/IsNot for reference equality checks; add extension attribute for extension methods 0346512 remove shared modifier from module members fbc8b85 convert static classes to modules e3a301e fix output of Inherits/Implements clauses ebeef27 convert increment/decrement operator overloads to op_Increment/op_Decrement methods 1d8a294 map true/false operator to IsTrue/IsFalse 4c8a11c improve conversion of special characters in string literals 04d816c fix bug in checked statement handling 610924e fix InvalidCastException in For-Next detection 5a00a6c Mark ICSharpCode.NRefactory.VB as AnyCPU. 1d904e1 add folding 3265ddc implement conversion of attribute targets d4eabd0 relicense NR.VB under MIT X11 license e90fa22 implement query expression AST 93cf054 Merge branch 'master' of github.com:icsharpcode/ILSpy into vb f7fcc9d implemented AnonymousObjectCreationExpression 46b5f43 add EmptyExpression conversion, improve fixed-Statement conversion e7dd90c implemented unchecked/checked expression, pointer access and so on c007a2a implemented fixed using GCHandle c431176 convert C#ˈs undocumented expressions to method calls 12eb661 convert anonymous methods to multiline sub lambdas 354aefa add conversion of DllImports to ExternalMethodDeclarations 2639711 convert dtor to Finalize Sub da4b1ba improve conversion of event declarations eab1ac6 add ContinueStatement 95db1eb added conversion to VB ForStatement d46401c Added missing predicate parameter. 2e3d9fa started implementation of QueryExpression d340669 make AddressOfExpression a UnaryOperatorExpression, move expressions to separate files, implement LambdaExpression 3d5b284 fixed bug in anonymous array create expression resolving. bf89db8 implement GoToStatement 3531735 implemented DoLoopStatement and UsingStatement 04ecdd7 Added support for anonymous arrays. a3d75db implement conversion of switch to Select Case 0a9b6c7 Implemented simple array create expression resolving. 3be8d6c Fixed bug with GetElementType. ArrayType yields System.Collections.IEnumerable as base type before the more specific System.Colloctions.Generic.IEnumerable. 5cf130c correctly implement ForEachStatement and ForStatement; add output for ForStatement fa4694e implement VB 11 Iterators 8137e58 Merge NRefactory 9675caf1e9276391f17536b488148cb668a6cc44 57d92d1 add support for OperatorDeclaration and some more statements 84b283b add ConditionalExpression and WhileStatement 1c8d2aa split Statements into single files 9ff6e73 reimplement some helper methods 024348d implement NamedArgumentExpression and FieldInitializerExpression 1bb5b83 implement conversion of AsExpression to TryCast, improve conversion of string literals, add UnaryOperatorExpression 3381b04 implement ArrayCreateExpression and CastExpression 41578d4 Merge branch '1.0' 0169874 - Reverted changes to display decimal.MinValue and decimal.MaxValue - Altered InitializerTests to use constant literals instead of decimal.MinValue and decimal.MaxValue 5c3be8f - Modified the InitializerPeepholeTransforms' Array Initializers to do a forward scan of the block instead of just checking the next instruction. The next-instruction thing breaks down under the case where you have an array-of-arrays (int[][]) - Added to the InitializerPeepholeTransforms' Array Initializers to detect the creation of a multi-dimensional array (int[,]) - Modified the ILCode.InitArray contract to take an ArrayType instead of just the element type, and passing with the ArrayType.Dimensions set accordingly. - AstMethodBodyBuilder now used the ArrayType.Dimensions info to build a tree of ArrayInitializerExpressions from the raw, element-by-element list. - Fixed OutputVisitor not calling StartNode for EmptyExpressions c1d27c7 - Made the InitializerTests pass, through three changes: * Added new-lines as needed to make the source formatting match what the actual output was. * Added code to CodeAssert to make it ignore #regions * Added code to output decimal.MinValue and decimal.MaxValue as appropriate 591d874 Merge branch 'master' of https://github.com/icsharpcode/ILSpy into Debugger a29b397 Merge branch 'master' of https://github.com/icsharpcode/ILSpy into Debugger 91c563b Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Iconbar e434783 get AST nodes locally a7f45f6 add icon margin & bookmarks 48774e4 add support for EventDeclaration and some more binary operators 1e2bce6 do not print method bodies in Interfaces d83c0e6 add support for comments 0f33774 output ThrowStatement 8cb9d38 add ArrayInitializerExpression and ObjectCreationExpression d523549 fix indentation in Accessor blocks 7ed36c0 convert default(T) to Nothing and typeof() to GetType() 032f217 implemented IfElseStatement and some more expressions 56e7557 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 82c6419 implement translation of EnumDeclaration d217418 implement PropertyDeclaration; add Inherits/Implements to TypeDeclaration; implement output for DelegateDeclaration e0bfac9 implement proper conversion of FieldDeclaration 43cf583 add MethodDeclaration, ConstructorDeclaration; EventMemberSpecifier, InterfaceMemberSpecifier for Handles and Implements clauses 3a26819 add GetTypeExpression, GetXmlNamespaceExpression, MemberAccessExpression, TypeOfIsExpression and TypeReferenceExpression b3ec92a implement AddressOfExpression, InstanceExpression, ParenthesizedExpression and SimpleNameExpression b9dc346 implement Attribute conversion 5f5a38c add support for Imports and Namespaces e8cde13 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger bcc40ee Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 7f49b56 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger bdb2c57 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger af56cbe Implement new methods in NotImplementedAstVisitor. d12f5b2 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 01a3871 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 90f8624 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger ad02254 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 044958a Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger e3471e6 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger b5d560a Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger a48634d Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger b33ddd3 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 3510129 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 2ff8e15 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger d87e40b Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 0fd4c4c Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger ac3737f Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 9f55acb Basic evaluation - first level 75a5092 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 10eb834 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 9e3e302 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 17b10a7 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger c3cbf9e Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger dc49175 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger f3a2be8 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger f187243 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 0f7ab11 Merge branch 'master' of git://github.com/icsharpcode/ILSpy into Debugger 0a54ead Port debugger libraries to use new NRefactory. 89af871 Started porting the debugger code to use new NRefactory git-subtree-dir: NRefactory git-subtree-split: a73d7ba8db559273e648e095cd4e149462b6526apull/297/head
700 changed files with 43509 additions and 15250 deletions
@ -1,72 +0,0 @@
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{F054A788-B591-4561-A8BA-AE745BBEB817}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.Editor</RootNamespace> |
||||
<AssemblyName>ICSharpCode.Editor</AssemblyName> |
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
<SignAssembly>False</SignAssembly> |
||||
<DelaySign>False</DelaySign> |
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> |
||||
<DocumentationFile>bin\Debug\ICSharpCode.Editor.xml</DocumentationFile> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<RunCodeAnalysis>False</RunCodeAnalysis> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>4194304</BaseAddress> |
||||
<FileAlignment>4096</FileAlignment> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<Optimize>False</Optimize> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<StartAction>Project</StartAction> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>bin\Release\</OutputPath> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<Optimize>True</Optimize> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Core"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Xml.Linq"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="IDocument.cs" /> |
||||
<Compile Include="IDocumentLine.cs" /> |
||||
<Compile Include="ISegment.cs" /> |
||||
<Compile Include="ITextEditor.cs" /> |
||||
<Compile Include="ITextSource.cs" /> |
||||
<Compile Include="LinkedElement.cs" /> |
||||
<Compile Include="ReadOnlyDocument.cs" /> |
||||
<Compile Include="StringTextSource.cs" /> |
||||
<Compile Include="TextLocation.cs" /> |
||||
<Compile Include="ITextAnchor.cs" /> |
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||
<Compile Include="TextChangeEventArgs.cs" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,30 +0,0 @@
@@ -1,30 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Editor |
||||
{ |
||||
/// <summary>
|
||||
/// A line inside a <see cref="IDocument"/>.
|
||||
/// </summary>
|
||||
public interface IDocumentLine : ISegment |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the length of this line, including the line delimiter.
|
||||
/// </summary>
|
||||
int TotalLength { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the line terminator.
|
||||
/// Returns 1 or 2; or 0 at the end of the document.
|
||||
/// </summary>
|
||||
int DelimiterLength { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the number of this line.
|
||||
/// The first line has the number 1.
|
||||
/// </summary>
|
||||
int LineNumber { get; } |
||||
} |
||||
} |
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Editor |
||||
{ |
||||
/// <summary>
|
||||
/// An (Offset,Length)-pair.
|
||||
/// </summary>
|
||||
public interface ISegment |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the start offset of the segment.
|
||||
/// </summary>
|
||||
int Offset { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the segment.
|
||||
/// </summary>
|
||||
/// <remarks>Must not be negative.</remarks>
|
||||
int Length { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the end offset of the segment.
|
||||
/// </summary>
|
||||
/// <remarks>EndOffset = Offset + Length;</remarks>
|
||||
int EndOffset { get; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Extension methods for <see cref="ISegment"/>.
|
||||
/// </summary>
|
||||
public static class ISegmentExtensions |
||||
{ |
||||
/// <summary>
|
||||
/// Gets whether the segment contains the offset.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// True, if offset is between segment.Start and segment.End (inclusive); otherwise, false.
|
||||
/// </returns>
|
||||
public static bool Contains (this ISegment segment, int offset) |
||||
{ |
||||
return segment.Offset <= offset && offset <= segment.EndOffset; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// True, if the segment contains the specified segment, false otherwise.
|
||||
/// </summary>
|
||||
public static bool Contains (this ISegment thisSegment, ISegment segment) |
||||
{ |
||||
return segment != null && thisSegment.Offset <= segment.Offset && segment.EndOffset <= thisSegment.EndOffset; |
||||
} |
||||
} |
||||
} |
@ -1,100 +0,0 @@
@@ -1,100 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ICSharpCode.Editor |
||||
{ |
||||
/// <summary>
|
||||
/// Interface for text editors.
|
||||
/// </summary>
|
||||
public interface ITextEditor : IServiceProvider |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the document that is being edited.
|
||||
/// </summary>
|
||||
IDocument Document { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets an object that represents the caret inside this text editor.
|
||||
/// </summary>
|
||||
ITextEditorCaret Caret { get; } |
||||
|
||||
/// <summary>
|
||||
/// Sets the caret to the specified line/column and brings the caret into view.
|
||||
/// </summary>
|
||||
void JumpTo(int line, int column); |
||||
|
||||
/// <summary>
|
||||
/// Gets the start offset of the selection.
|
||||
/// </summary>
|
||||
int SelectionStart { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the selection.
|
||||
/// </summary>
|
||||
int SelectionLength { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the selected text.
|
||||
/// </summary>
|
||||
string SelectedText { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Sets the selection.
|
||||
/// </summary>
|
||||
/// <param name="selectionStart">Start offset of the selection</param>
|
||||
/// <param name="selectionLength">Length of the selection</param>
|
||||
void Select(int selectionStart, int selectionLength); |
||||
|
||||
/// <summary>
|
||||
/// Shows the specified linked elements, and allows the user to edit them.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// Returns true when the user has finished editing the elements and pressed Return;
|
||||
/// or false when editing is aborted for any reason.
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// The user can also edit other parts of the document (or other documents) while in link mode.
|
||||
/// In case of success (true return value), this method will update the offsets of the linked elements
|
||||
/// to reflect the changes done by the user.
|
||||
/// If the text editor does not support link mode, it will immediately return false.
|
||||
/// </remarks>
|
||||
// Task<bool> ShowLinkedElements(IEnumerable<LinkedElement> linkedElements);
|
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Represents the caret in a text editor.
|
||||
/// </summary>
|
||||
public interface ITextEditorCaret |
||||
{ |
||||
/// <summary>
|
||||
/// Gets/Sets the caret offset;
|
||||
/// </summary>
|
||||
int Offset { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the caret line number.
|
||||
/// Line numbers are counted starting from 1.
|
||||
/// </summary>
|
||||
int Line { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the caret column number.
|
||||
/// Column numbers are counted starting from 1.
|
||||
/// </summary>
|
||||
int Column { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/sets the caret location.
|
||||
/// </summary>
|
||||
TextLocation Location { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Is raised whenever the location of the caret has changed.
|
||||
/// </summary>
|
||||
event EventHandler LocationChanged; |
||||
} |
||||
} |
@ -1,68 +0,0 @@
@@ -1,68 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under MIT license (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Editor |
||||
{ |
||||
// I'm not sure if we need this.
|
||||
// How about a method in the context - this method could wrap the internal representation.
|
||||
// public void StartTextLinkMode (int linkLength, IEnumerable<int> offsets)
|
||||
// and maybe then variations taking more than one link element ?
|
||||
|
||||
// /// <summary>
|
||||
// /// Represents an element in the text editor that is either editable, or bound to another editable element.
|
||||
// /// Used with <see cref="ITextEditor.ShowLinkedElements"/>
|
||||
// /// </summary>
|
||||
// public class LinkedElement
|
||||
// {
|
||||
// LinkedElement boundTo;
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Gets/Sets the start offset of this linked element.
|
||||
// /// </summary>
|
||||
// public int StartOffset { get; set; }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Gets/Sets the end offset of this linked element.
|
||||
// /// </summary>
|
||||
// public int EndOffset { get; set; }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Gets the linked element to which this element is bound.
|
||||
// /// </summary>
|
||||
// public LinkedElement BoundTo {
|
||||
// get { return boundTo; }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Gets whether this element is editable. Returns true if this element is not bound.
|
||||
// /// </summary>
|
||||
// public bool IsEditable {
|
||||
// get { return boundTo == null; }
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Creates a new editable element.
|
||||
// /// </summary>
|
||||
// public LinkedElement(int startOffset, int endOffset)
|
||||
// {
|
||||
// this.StartOffset = startOffset;
|
||||
// this.EndOffset = endOffset;
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Creates a new element that is bound to <paramref name="boundTo"/>.
|
||||
// /// </summary>
|
||||
// public LinkedElement(int startOffset, int endOffset, LinkedElement boundTo)
|
||||
// {
|
||||
// if (boundTo == null)
|
||||
// throw new ArgumentNullException("boundTo");
|
||||
// this.StartOffset = startOffset;
|
||||
// this.EndOffset = endOffset;
|
||||
// while (boundTo.boundTo != null)
|
||||
// boundTo = boundTo.boundTo;
|
||||
// this.boundTo = boundTo;
|
||||
// }
|
||||
// }
|
||||
} |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
|
||||
bin/ |
||||
obj/ |
@ -0,0 +1,86 @@
@@ -0,0 +1,86 @@
|
||||
//
|
||||
// NamedExpression.cs
|
||||
//
|
||||
// Author:
|
||||
// Mike Krüger <mkrueger@xamarin.com>
|
||||
//
|
||||
// Copyright (c) 2011 Xamarin
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
|
||||
namespace ICSharpCode.NRefactory.CSharp |
||||
{ |
||||
/// <summary>
|
||||
/// name = expression
|
||||
/// This isn't the same as 'assign' even if it has the same syntax. This expression is used in object initializers.
|
||||
/// </summary>
|
||||
public class NamedExpression : Expression |
||||
{ |
||||
public NamedExpression() |
||||
{ |
||||
} |
||||
|
||||
public NamedExpression (string identifier, Expression expression) |
||||
{ |
||||
this.Identifier = identifier; |
||||
this.Expression = expression; |
||||
} |
||||
|
||||
public string Identifier { |
||||
get { |
||||
return GetChildByRole (Roles.Identifier).Name; |
||||
} |
||||
set { |
||||
SetChildByRole(Roles.Identifier, CSharp.Identifier.Create (value, TextLocation.Empty)); |
||||
} |
||||
} |
||||
|
||||
public Identifier IdentifierToken { |
||||
get { |
||||
return GetChildByRole (Roles.Identifier); |
||||
} |
||||
set { |
||||
SetChildByRole(Roles.Identifier, value); |
||||
} |
||||
} |
||||
|
||||
public CSharpTokenNode AssignToken { |
||||
get { return GetChildByRole (Roles.Assign); } |
||||
} |
||||
|
||||
public Expression Expression { |
||||
get { return GetChildByRole (Roles.Expression); } |
||||
set { SetChildByRole (Roles.Expression, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data = default(T)) |
||||
{ |
||||
return visitor.VisitNamedExpression(this, data); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
var o = other as NamedExpression; |
||||
return o != null && MatchString(this.Identifier, o.Identifier) && this.Expression.DoMatch(o.Expression, match); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.NRefactory.CSharp |
||||
{ |
||||
/// <summary>
|
||||
/// Represents an AstType as an expression.
|
||||
/// This is used when calling a method on a primitive type: "int.Parse()"
|
||||
/// </summary>
|
||||
public class TypeReferenceExpression : Expression |
||||
{ |
||||
public AstType Type { |
||||
get { return GetChildByRole(Roles.Type); } |
||||
set { SetChildByRole(Roles.Type, value); } |
||||
} |
||||
|
||||
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data = default(T)) |
||||
{ |
||||
return visitor.VisitTypeReferenceExpression(this, data); |
||||
} |
||||
|
||||
public TypeReferenceExpression () |
||||
{ |
||||
} |
||||
|
||||
public TypeReferenceExpression (AstType type) |
||||
{ |
||||
AddChild (type, Roles.Type); |
||||
} |
||||
|
||||
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match) |
||||
{ |
||||
TypeReferenceExpression o = other as TypeReferenceExpression; |
||||
return o != null && this.Type.DoMatch(o.Type, match); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Linq; |
||||
using ICSharpCode.NRefactory.PatternMatching; |
||||
|
||||
namespace ICSharpCode.NRefactory.CSharp |
||||
{ |
||||
/// <summary>
|
||||
/// Matches identifier expressions that have the same identifier as the referenced variable/type definition/method definition.
|
||||
/// </summary>
|
||||
public class IdentifierExpressionBackreference : Pattern |
||||
{ |
||||
readonly string referencedGroupName; |
||||
|
||||
public string ReferencedGroupName { |
||||
get { return referencedGroupName; } |
||||
} |
||||
|
||||
public IdentifierExpressionBackreference(string referencedGroupName) |
||||
{ |
||||
if (referencedGroupName == null) |
||||
throw new ArgumentNullException("referencedGroupName"); |
||||
this.referencedGroupName = referencedGroupName; |
||||
} |
||||
|
||||
public override bool DoMatch(INode other, Match match) |
||||
{ |
||||
CSharp.IdentifierExpression ident = other as CSharp.IdentifierExpression; |
||||
if (ident == null || ident.TypeArguments.Any()) |
||||
return false; |
||||
CSharp.AstNode referenced = (CSharp.AstNode)match.Get(referencedGroupName).Last(); |
||||
if (referenced == null) |
||||
return false; |
||||
return ident.Identifier == referenced.GetChildByRole(CSharp.AstNode.Roles.Identifier).Name; |
||||
} |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue