public AnalysisEntry(string path) { _analyzer = null; _path = path; _fileId = 0; _parser = new Parser(LuaGrammar.Instance); InitModel(); }
public AnalysisEntry(ProjectAnalyzer analyzer, string path, int fileId) { _analyzer = analyzer; _path = path; _fileId = fileId; _parser = new Parser(LuaGrammar.Instance); InitModel(); }
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; }
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); }
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); }