~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/VariableCompletionData.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
namespace MonoDevelop.CSharp.Completion
33
33
{
34
 
        public class VariableCompletionData : CompletionData, IVariableCompletionData
 
34
        class VariableCompletionData : CompletionData, IVariableCompletionData
35
35
        {
 
36
                readonly CSharpCompletionTextEditorExtension ext;
 
37
 
36
38
                public IVariable Variable {
37
39
                        get;
38
40
                        private set;
39
41
                }
40
 
                
41
 
                public VariableCompletionData (IVariable variable) : base (variable.Name, variable.GetStockIcon ())
42
 
                {
 
42
 
 
43
                public override TooltipInformation CreateTooltipInformation (bool smartWrap)
 
44
                {
 
45
                        var tooltipInfo = new TooltipInformation ();
 
46
                        var resolver = ext.CSharpUnresolvedFile.GetResolver (ext.Compilation, ext.Document.Editor.Caret.Location);
 
47
                        var sig = new SignatureMarkupCreator (resolver, ext.FormattingPolicy.CreateOptions ());
 
48
                        sig.BreakLineAfterReturnType = smartWrap;
 
49
                        tooltipInfo.SignatureMarkup = sig.GetLocalVariableMarkup (Variable);
 
50
                        return tooltipInfo;
 
51
                }
 
52
 
 
53
                public VariableCompletionData (CSharpCompletionTextEditorExtension ext, IVariable variable) : base (variable.Name, variable.GetStockIcon ())
 
54
                {
 
55
                        this.ext = ext;
43
56
                        this.Variable = variable;
44
57
                }
45
58
        }