// Called in a macro context public void Refresh() { if (_intelliSense != null) { return; // Already done } try { // Parse first var xml = _xmlIntelliSense; if (xml == null) { xml = File.ReadAllText(_fileName); } _intelliSense = XmlIntelliSense.Parse(xml, _fileName); if (_intelliSense?.XmlFunctionInfo?.FunctionsList != null) { // Fix up SourcePath (is this used?) and HelpTopic foreach (var func in _intelliSense.XmlFunctionInfo.FunctionsList) { func.SourcePath = _fileName; func.Name = func.Name.Trim(); func.HelpTopic = FunctionInfo.ExpandHelpTopic(_path, func.HelpTopic); } } } catch (Exception ex) { Logger.Provider.Warn($"XmlIntelliSenseProvider - Loading IntelliSense from file {_fileName} failed:\r\n\t{ex.Message}"); _intelliSense = XmlIntelliSense.Empty; } }
// Called in a macro context public void Refresh() { if (_intelliSense != null) return; // Already done try { // Parse first var xml = _xmlIntelliSense; if (xml == null) { xml = File.ReadAllText(_fileName); } _intelliSense = XmlIntelliSense.Parse(xml, _fileName); if (_intelliSense?.XmlFunctionInfo?.FunctionsList != null) { // Fix up SourcePath (is this used?) and HelpTopic foreach (var func in _intelliSense.XmlFunctionInfo.FunctionsList) { func.SourcePath = _fileName; func.Name = func.Name.Trim(); func.HelpTopic = FunctionInfo.ExpandHelpTopic(_path, func.HelpTopic); } } } catch (Exception ex) { Logger.Provider.Warn($"XmlIntelliSenseProvider - Loading IntelliSense from file {_fileName} failed:\r\n\t{ex.Message}"); _intelliSense = XmlIntelliSense.Empty; } }