Beispiel #1
0
        public void UpdateError()
        {
            if (m_file == null)
            {
                return;
            }

            m_file.ClearCheckError();
            m_file.ClearAnalysisError();
            m_file.UpdateError();

            // 解析ALanguageErrorInfo
            {
                var info_list = new List <ALanguageErrorInfo>();
                var error_map = m_file.GetAnalysisErrorMap();
                foreach (var pair in error_map)
                {
                    var info = new ALanguageErrorInfo();
                    info.line  = pair.Key.GetStartLine();
                    info.start = pair.Key.GetStart();
                    info.end   = pair.Key.GetEnd();
                    info.error = pair.Value;
                    info_list.Add(info);
                }
                error_map = m_file.GetCheckErrorMap();
                foreach (var pair in error_map)
                {
                    var info = new ALanguageErrorInfo();
                    info.line  = pair.Key.GetStartLine();
                    info.start = pair.Key.GetStart();
                    info.end   = pair.Key.GetEnd();
                    info.error = pair.Value;
                    info_list.Add(info);
                }

                try
                {
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        if (m_view.Properties.TryGetProperty(nameof(ALanguageErrorTagger), out ALanguageErrorTagger tagger))
                        {
                            tagger.Refresh(m_version, info_list);
                        }
                    });
                }
                catch (System.Exception)
                {
                }
            }
        }
Beispiel #2
0
 public void UpdateError()
 {
     m_file.UpdateError();
 }