Changeset 11722 for branches/CodeEditor


Ignore:
Timestamp:
12/23/14 13:39:27 (5 years ago)
Author:
jkarder
Message:

#2077:

  • added completion image for templates
  • cleaned CSharpCodeCompletionDataFactory
  • sorted foldings by start offset
Location:
branches/CodeEditor/HeuristicLab.CodeEditor/3.4
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/CodeEditor/HeuristicLab.CodeEditor/3.4/HeuristicLab.CodeEditor-3.4.csproj

    r11700 r11722  
    192192    </Page>
    193193  </ItemGroup>
    194   <ItemGroup />
    195194  <ItemGroup>
    196195    <Resource Include="LanguageFeatures\CodeCompletion\CSharp\CompletionData\Images\Class.png" />
     
    218217    <Resource Include="LanguageFeatures\CodeCompletion\CSharp\CompletionData\Images\StaticClass.png" />
    219218    <Resource Include="LanguageFeatures\CodeCompletion\CSharp\CompletionData\Images\Struct.png" />
     219    <Resource Include="LanguageFeatures\CodeCompletion\CSharp\CompletionData\Images\Template.png" />
    220220    <Resource Include="LanguageFeatures\CodeCompletion\CSharp\CompletionData\Images\VirtualMethod.png" />
    221221  </ItemGroup>
  • branches/CodeEditor/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs

    r11700 r11722  
    7171
    7272    public ICompletionData CreateXmlDocCompletionData(string title, string description = null, string insertText = null) {
    73       return new CompletionData("TODO: xml doc creation");
     73      return new CompletionData(title) {
     74        Description = description,
     75        CompletionText = insertText ?? title,
     76        Image = CompletionImage.Template.BaseImage,
     77      };
    7478    }
    7579
     
    8791
    8892    public ICompletionData CreateEventCreationCompletionData(string varName, IType delegateType, IEvent evt, string parameterDefinition, IUnresolvedMember currentMember, IUnresolvedTypeDefinition currentType) {
    89       return new CompletionData("TODO: event creation");
     93      return new CompletionData(varName);
    9094    }
    9195
    9296    public ICompletionData CreateNewOverrideCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IMember m) {
    93       return new CompletionData("TODO: override creation");
     97      return new CompletionData(m.Name);
    9498    }
    9599
    96100    public ICompletionData CreateNewPartialCompletionData(int declarationBegin, IUnresolvedTypeDefinition type, IUnresolvedMember m) {
    97       return new CompletionData("TODO: partial creation");
     101      return new CompletionData(m.Name);
    98102    }
    99103
    100104    public ICompletionData CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation) {
    101105      var typeDef = type.GetDefinition();
    102       if (typeDef != null) return new ImportCompletionData(typeDef, context.TypeResolveContextAtCaret, useFullName);
    103       throw new InvalidOperationException("Should never happen");
     106      return new ImportCompletionData(typeDef, context.TypeResolveContextAtCaret, useFullName);
    104107    }
    105108
    106109    public IEnumerable<ICompletionData> CreateCodeTemplateCompletionData() {
    107       yield return new CompletionData("TODO: code template creation"); ;
     110      yield break;
    108111    }
    109112
    110113    public ICompletionData CreateFormatItemCompletionData(string format, string description, object example) {
    111       return new CompletionData("TODO: format item creation");
     114      return null;
    112115    }
    113116
    114117    public IEnumerable<ICompletionData> CreatePreProcessorDefinesCompletionData() {
    115       yield return new CompletionData("TODO: pre processor creation"); ;
     118      yield break;
    116119    }
    117120    #endregion
     
    131134
    132135    public IParameterDataProvider CreateIndexerParameterDataProvider(int startOffset, IType type, IEnumerable<IProperty> accessibleIndexers, ICSharpCode.NRefactory.CSharp.AstNode resolvedNode) {
    133       throw new NotImplementedException();
     136      return null;
    134137    }
    135138
  • branches/CodeEditor/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CompletionData/Images/CompletionImage.cs

    r11700 r11722  
    1 #region License
     1#region License Information
    22// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
    33// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
    4 #endregion
    5 
    6 #region License Information
     4
    75/* HeuristicLab
    86 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     
    8482    static readonly CompletionImage imageLiteral = new CompletionImage("Literal", false);
    8583    static readonly CompletionImage imageEnumValue = new CompletionImage("EnumValue", false);
     84    static readonly CompletionImage imageTemplate = new CompletionImage("Template", false);
    8685
    8786    /// <summary>Gets the image used for non-static classes.</summary>
     
    9695    /// <summary>Gets the image used for enum values.</summary>
    9796    public static CompletionImage EnumValue { get { return imageEnumValue; } }
     97
     98    /// <summary>Gets the image used for templates.</summary>
     99    public static CompletionImage Template { get { return imageTemplate; } }
    98100
    99101    static readonly CompletionImage imageMethod = new CompletionImage("Method", true);
  • branches/CodeEditor/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs

    r11700 r11722  
    4747      v.document = foldingContext.Document;
    4848      foldingContext.SyntaxTree.AcceptVisitor(v);
    49       result.FoldingData = v.foldings;
     49      result.FoldingData = v.foldings.OrderBy(x => x.StartOffset).ToList();
    5050
    5151      var firstError = foldingContext.SyntaxTree.Errors.FirstOrDefault();
Note: See TracChangeset for help on using the changeset viewer.