Ejemplo n.º 1
0
 public AnalysisEntry(string path)
 {
     _analyzer = null;
     _path     = path;
     _fileId   = 0;
     _parser   = new Parser(LuaGrammar.Instance);
     InitModel();
 }
Ejemplo n.º 2
0
 public AnalysisEntry(ProjectAnalyzer analyzer, string path, int fileId)
 {
     _analyzer = analyzer;
     _path     = path;
     _fileId   = fileId;
     _parser   = new Parser(LuaGrammar.Instance);
     InitModel();
 }
Ejemplo n.º 3
0
        public void SetAnalyzer(ITextBuffer textBuffer, ProjectAnalyzer analyzer)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException(nameof(textBuffer));
            }

            if (analyzer == null)
            {
                textBuffer.Properties.RemoveProperty(typeof(ProjectAnalyzer));
                return;
            }

            textBuffer.Properties[typeof(ProjectAnalyzer)] = analyzer;
        }
Ejemplo n.º 4
0
        public bool TryGetAnalyzer(ITextView textView, out ProjectAnalyzer analyzer, out string filename)
        {
            if (textView == null)
            {
                throw new ArgumentNullException(nameof(textView));
            }

            // Try to get the analyzer from the main text buffer
            if (TryGetAnalyzer(textView.TextBuffer, out analyzer, out filename))
            {
                return(true);
            }

            analyzer = null;
            filename = null;
            return(false);
        }
Ejemplo n.º 5
0
        public bool TryGetAnalyzer(ITextBuffer textBuffer, out ProjectAnalyzer analyzer, out string filename)
        {
            if (textBuffer == null)
            {
                throw new ArgumentNullException(nameof(textBuffer));
            }

            // If we have set an analyzer explicitly, return that
            analyzer = null;
            if (textBuffer.Properties.TryGetProperty(typeof(ProjectAnalyzer), out analyzer))
            {
                filename = textBuffer.GetFilePath();
                return(analyzer != null);
            }

            analyzer = null;
            filename = null;
            return(false);
        }