{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/6649","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/6649/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/6649/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/6649/events","html_url":"https://github.com/dotnet/roslyn/issues/6649","id":115916079,"number":6649,"title":"Diagnostic issues with locations in non-code files do not appear in VS's error list","user":{"login":"mjrousos","id":10077254,"avatar_url":"https://avatars.githubusercontent.com/u/10077254?v=3","gravatar_id":"","url":"https://api.github.com/users/mjrousos","html_url":"https://github.com/mjrousos","followers_url":"https://api.github.com/users/mjrousos/followers","following_url":"https://api.github.com/users/mjrousos/following{/other_user}","gists_url":"https://api.github.com/users/mjrousos/gists{/gist_id}","starred_url":"https://api.github.com/users/mjrousos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjrousos/subscriptions","organizations_url":"https://api.github.com/users/mjrousos/orgs","repos_url":"https://api.github.com/users/mjrousos/repos","events_url":"https://api.github.com/users/mjrousos/events{/privacy}","received_events_url":"https://api.github.com/users/mjrousos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-09T16:43:58Z","updated_at":"2015-11-09T22:10:50Z","closed_at":null,"body":"I have some analyzers which work on non-code files. Everything works as expected except that the reported diagnostics don’t show up in VS’s error list if they have a location in a non-code file.\r\n\r\nHere’s a quick sample. Make sure you have at least one ‘additional file’ in any project opened with this analyzer running. Notice that the diagnostic without a location shows up in the error list, but the one with a location in a non-code file does not.\r\n\r\n```C#\r\nusing System.Collections.Immutable;\r\nusing System.Linq;\r\nusing Microsoft.CodeAnalysis;\r\nusing Microsoft.CodeAnalysis.Diagnostics;\r\nusing Microsoft.CodeAnalysis.Text;\r\n\r\nnamespace Analyzer1\r\n{\r\n    [DiagnosticAnalyzer(LanguageNames.CSharp)]\r\n    public class Analyzer1Analyzer : DiagnosticAnalyzer\r\n    {\r\n        public const string DiagnosticId = \"TestCompilationAnalyzer\";\r\n\r\n        private static readonly LocalizableString Title = \"TestAnalyzer\";\r\n        private static readonly LocalizableString MessageFormat = \"This message should always appear {0}\";\r\n        private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, \"Test\", DiagnosticSeverity.Warning, isEnabledByDefault: true);\r\n        public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get { return ImmutableArray.Create(Rule); } }\r\n\r\n        public override void Initialize(AnalysisContext context)\r\n        {\r\n            context.RegisterCompilationAction(cxt =>\r\n            {\r\n                var file = cxt.Options.AdditionalFiles.FirstOrDefault();\r\n                Location loc = (file?.Path != null) ? Location.Create(file.Path, new TextSpan(0, 1), new LinePositionSpan(new LinePosition(0,0), new LinePosition(0,1))) : Location.None;\r\n\r\n                // This does NOT show in VS's error list (but I think it should)\r\n                cxt.ReportDiagnostic(Diagnostic.Create(Rule, loc, \"A\"));\r\n\r\n                // This DOES show in VS's error list (as expected)\r\n                cxt.ReportDiagnostic(Diagnostic.Create(Rule, Location.None, $\"B - {loc.ToString()}\"));\r\n            });\r\n        }\r\n\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/155215086","html_url":"https://github.com/dotnet/roslyn/issues/6649#issuecomment-155215086","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/6649","id":155215086,"user":{"login":"heejaechang","id":1333179,"avatar_url":"https://avatars.githubusercontent.com/u/1333179?v=3","gravatar_id":"","url":"https://api.github.com/users/heejaechang","html_url":"https://github.com/heejaechang","followers_url":"https://api.github.com/users/heejaechang/followers","following_url":"https://api.github.com/users/heejaechang/following{/other_user}","gists_url":"https://api.github.com/users/heejaechang/gists{/gist_id}","starred_url":"https://api.github.com/users/heejaechang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heejaechang/subscriptions","organizations_url":"https://api.github.com/users/heejaechang/orgs","repos_url":"https://api.github.com/users/heejaechang/repos","events_url":"https://api.github.com/users/heejaechang/events{/privacy}","received_events_url":"https://api.github.com/users/heejaechang/received_events","type":"User","site_admin":false},"created_at":"2015-11-09T22:10:50Z","updated_at":"2015-11-09T22:10:50Z","body":"@paul1956 @mjrousos so I just tested. it looks like we wired up text tracking so opened and closed file text change tracking seems working with additional files. I remember this didn't work before, but I guess since then we fixed those. so now all those working. sorry for confusion.\r\n\r\nbut, still different part of system seems not fully aligned to support this scenario (where errors showing up in additional files)"}}