コード例 #1
0
        /// <summary>
        /// Buffers
        /// </summary>
        public void Visit(ParsedBuffer pars)
        {
            pars.TargetTable = FindAnyTableByName(pars.BufferFor);
            pars.Flags      |= !pars.BufferFor.Contains(".") && pars.TargetTable != null && !pars.TargetTable.IsTempTable ? ParseFlag.MissingDbName : 0;

            var subString = "?";
            var type      = CompletionType.TempTable;

            if (pars.TargetTable != null)
            {
                subString = pars.TargetTable.Name;
                type      = pars.TargetTable.IsTempTable ? CompletionType.TempTable : CompletionType.Table;

                // To code explorer, list buffers and associated tables
                var parentNode = pars.TargetTable.IsTempTable ? GetExplorerListNode("Temp-tables used", CodeExplorerIconType.TempTableUsed) : GetExplorerListNode("Tables used", CodeExplorerIconType.TableUsed);
                var newNode    = CodeItem.Factory.New(pars.TargetTable.IsTempTable ? CodeExplorerIconType.TempTable : CodeExplorerIconType.Table);
                newNode.DisplayText   = pars.Name;
                newNode.Flags         = pars.Flags;
                newNode.SubText       = null;
                newNode.DocumentOwner = pars.FilePath;
                newNode.GoToLine      = pars.Line;
                newNode.GoToColumn    = pars.Column;
                PushToCodeExplorer(parentNode, newNode);
            }

            // parameter buffer?
            if (pars.Flags.HasFlag(ParseFlag.Parameter))
            {
                PushToCodeExplorerAsParameter(pars);
            }

            // to completion data
            var curItem = CompletionItem.Factory.New(type) as TableCompletionItem;

            if (curItem != null)
            {
                if (pars.TargetTable != null)
                {
                    curItem.ChildSeparator = '.';
                    curItem.Children       = GetTableCompletionItemChildren(curItem, pars.TargetTable.Fields);
                }
                curItem.DisplayText = pars.Name;
                curItem.Flags       = pars.Flags;
                curItem.SubText     = subString;
                PushToAutoCompletion(curItem, pars);
            }
        }
コード例 #2
0
 public void Visit(ParsedBuffer pars)
 {
     AppendEverything(pars);
 }