Exemplo n.º 1
0
        private LibClang.Cursor GetCursorAt(CppCodeBrowser.ICodeLocation loc)
        {
            CppCodeBrowser.Symbols.ISymbol symbol = _index.FileSymbolMaps.Lookup(_path, ViewModel.CaretOffset);
            if (symbol == null) return null;

            return symbol.Cursor;
        }
Exemplo n.º 2
0
        private UInt64 _docVersion; //this is the version number at the time of job creation, when the job executes the version number may be greater

        public ParseJob(FilePath path, UInt64 version, string[] compilerArgs, CppCodeBrowser.IProjectIndex index)
        {
            _path = path;
            _docVersion = version;
            _compilerArgs = compilerArgs;
            _index = index;
        }
Exemplo n.º 3
0
 public FindAllReferences(DocumentViewModel vm, FilePath path, CppCodeBrowser.IProjectIndex index)
     : base(vm)
 {
     ViewModel.CaretOffsetChanged += ViewModelCaretOffsetChanged;
     _path = path;
     _index = index;            
 }
Exemplo n.º 4
0
 public InspectCursorCommand(DocumentViewModel vm, FilePath path, CppCodeBrowser.IProjectIndex index)
     : base(vm)
 {
     ViewModel.CaretOffsetChanged += ViewModelCaretOffsetChanged;
     _path = path;
     _index = index;
     RaiseCanExecuteChangedEvent();
 }
Exemplo n.º 5
0
        //private CppCodeBrowser.IProjectFile _indexItem;

        public SourceFileJumpToCommand(DocumentViewModel vm, FilePath path, CppCodeBrowser.IProjectIndex index)
            : base(vm)
        {
            ViewModel.CaretOffsetChanged += ViewModelCaretOffsetChanged;

            _path = path;
            _index = index;
            _jumpToBrowser = new CppCodeBrowser.JumpToBrowser(_index);
           // _indexItem = _index.FindProjectItem(_path);
            RaiseCanExecuteChangedEvent();
        }
Exemplo n.º 6
0
        private void OnCppParserTranslationUnitIndexed(CppCodeBrowser.ParseResult result)
        {
            if (result.Path != Document.File.Path) return;

            //highlight the symbol mappings
            if (_fileMap == null)
            {
                _fileMap = result.Index.FileSymbolMaps.GetMap(Document.File.Path);
                if (_fileMap != null)
                {
                    _indexHighlighter.SetMap(_fileMap);
                }
            }
            /*

            CppCodeBrowser.IProjectFile fileIndex = result.Index.FindProjectItem(Document.File.Path);

            //highlight diagnostics
            List<LibClang.Diagnostic> diags = new List<Diagnostic>(fileIndex.Diagnostics);
            DiagnosticOutputWriter.UpdateOutput(diags);
             * */
        }
Exemplo n.º 7
0
 private void OnCppParserTranslationUnitIndexed(CppCodeBrowser.ParseResult result)
 {
     UpdateTree(result.Index);
 }
Exemplo n.º 8
0
        private void UpdateTree(CppCodeBrowser.IProjectIndex index)
        {
            ISymbolTable symbols = index.Symbols;
            ISet<FilePath> files = JadeCore.Services.Provider.WorkspaceController.CurrentWorkspace.Files;

            foreach(NamespaceDecl ns in symbols.Namespaces)
            {
                if (FilterDeclaration(ns, files))
                    FindOrAddNamespaceNode(ns);
            }

            foreach(ClassDecl c in symbols.Classes)
            {
                if (FilterDeclaration(c, files))
                    FindOrAddClassNode(c);
            }

            foreach(MethodDecl m in symbols.Methods)
            {
                if (FilterDeclaration(m, files))
                {
                    DeclarationViewModel parentClass = FindOrAddClassNode(m.Class);
                    parentClass.FindOrAddChildDecl(m);
                }
            }

            foreach(FieldDecl f in symbols.Fields)
            {
                if (FilterDeclaration(f, files))
                {
                    DeclarationViewModel parentClass = FindOrAddClassNode(f.Class);
                    parentClass.FindOrAddChildDecl(f);
                }
            }

            foreach(ConstructorDecl c in symbols.Constructors)
            {
                if (FilterDeclaration(c, files))
                {
                    if (c.Class != null)
                    {
                        DeclarationViewModel parentClass = FindOrAddClassNode(c.Class);
                        parentClass.FindOrAddChildDecl(c);
                    }
                }
            }

            foreach (DestructorDecl d in symbols.Destructors)
            {
                if (FilterDeclaration(d, files))
                {
                    if (d.Class != null)
                    {
                        DeclarationViewModel parentClass = FindOrAddClassNode(d.Class);
                        parentClass.FindOrAddChildDecl(d);
                    }
                }
            }

            foreach(EnumDecl e in symbols.Enums)
            {
                if (FilterDeclaration(e, files))
                    FindOrAddEnumNode(e);
            }

            foreach (EnumConstantDecl c in symbols.EnumConstants)
            {
                if (FilterDeclaration(c, files))
                    FindOrAddEnumConstantNode(c);
            }

            foreach(FunctionDecl f in symbols.Functions)
            {
                if (FilterDeclaration(f, files))
                    FindOrAddFunctionNode(f);
            }
            OnPropertyChanged("RootItems");
            OnPropertyChanged("FileNames");
        }
Exemplo n.º 9
0
 public ResultProvider(FilePath sourceFile, CppCodeBrowser.IProjectIndex index, CppCodeBrowser.IUnsavedFileProvider unsavedFiles)
 {
     _index = index;
     _sourceFile = sourceFile;
     _unsavedFiles = unsavedFiles;
 }
Exemplo n.º 10
0
 public DisplayCodeLocationCommandParams(CppCodeBrowser.ICodeLocation location, bool setFocus, bool scroll)
 {
     Location = location;
     SetFocus = setFocus;
     Scroll = scroll;
 }
Exemplo n.º 11
0
 public void OnDisplaySymbolInspector(CppCodeBrowser.Symbols.IDeclaration declaration)
 {
     _symbolInspectorViewModel.Declaration = declaration;
     _symbolInspectorViewModel.IsSelected = true;
     _symbolInspectorViewModel.IsVisible = true;
 }
Exemplo n.º 12
0
 public DocChangeTracker(IEditorDoc document, CppCodeBrowser.IProjectIndex index)
 {
     _doc = document;
     _index = index;
     _doc.TextDocument.Changed += TextDocument_Changed;
 }