예제 #1
0
        private static List<DiagnosticMessage> ValueAsCompilationMessages(JsonObject obj, string key)
        {
            var messages = new List<DiagnosticMessage>();

            var arrayValue = obj.Value(key) as JsonArray;
            for (int i = 0; i < arrayValue.Length; i++)
            {
                var item = arrayValue[i] as JsonObject;

                var message = new DiagnosticMessage(
                    item.ValueAsString(nameof(DiagnosticMessage.ErrorCode)),
                    item.ValueAsString(nameof(DiagnosticMessage.Message)),
                    item.ValueAsString(nameof(DiagnosticMessage.FormattedMessage)),
                    item.ValueAsString(nameof(DiagnosticMessage.SourceFilePath)),
                    (DiagnosticMessageSeverity)item.ValueAsInt(nameof(DiagnosticMessage.Severity)),
                    item.ValueAsInt(nameof(DiagnosticMessage.StartColumn)),
                    item.ValueAsInt(nameof(DiagnosticMessage.StartLine)),
                    item.ValueAsInt(nameof(DiagnosticMessage.EndColumn)),
                    item.ValueAsInt(nameof(DiagnosticMessage.EndLine)));

                messages.Add(message);
            }

            return messages;
        }
예제 #2
0
        public void AddGlobalDiagnostics(DiagnosticMessage message)
        {
            if (_diagnostics == null)
            {
                _diagnostics = new List <DiagnosticMessage>();
            }

            _diagnostics.Add(message);
        }
예제 #3
0
        public void AddGlobalDiagnostics(DiagnosticMessage message)
        {
            if (_diagnostics == null)
            {
                _diagnostics = new List<DiagnosticMessage>();
            }

            _diagnostics.Add(message);
        }