1. 05 3月, 2015 1 次提交
    • M
      Fix execution of CompilationStartActions when only analyzer options for the... · 37f0a943
      Manish Vasani 提交于
      Fix execution of CompilationStartActions when only analyzer options for the project change, but the underlying compilation is identical.
      
      Our current assumption for executing CompilationStartActions is that they should be executed exactly once per-compilation per-analyzer. We cache the registered nested actions for every compilation in AnalyzerManager to ensure this. However, if user just changes an additional document for the project, then the analyzer options change, but the underlying compilation is unchanged. Project change causes IDE diagnostic service to clear all cached diagnostics, but when re-computing diagnostics, we end up skipping execution of CompilationStartActions and directly move to nested compilation actions. This can be troublesome in couple of ways. First, we will have duplicate callbacks for all nested actions for the initially invoked compilation start action. Second, and event worse, if the analyzer is reading the contents of the additional documents in the start action and caching them for later use by the nested actions, all the nested actions get stale contents for the additional documents. Apparently, Tom is the first one to go through this agony as the DeclarePublicAPI analyzer that he implemented exactly does the latter.
      
      Fix is to ensure that we execute compilation start actions for every unique compilation start analysis context, i.e. {compilation, analyzer options} tuple for every analyzer.
      37f0a943
  2. 04 3月, 2015 35 次提交
  3. 03 3月, 2015 4 次提交
    • C
      Evaluate items asynchronously · c2c57fdf
      Charles Stoner 提交于
      c2c57fdf
    • M
      Address review feedback from Heejae: add DiagnosticDescriptor.WithOnException... · 4e120580
      Manish Vasani 提交于
      Address review feedback from Heejae: add DiagnosticDescriptor.WithOnException to create a new descriptor with hooked up exception handler for reporting exception diagnostics from LocalizableStrings, instead of mutating fields of LocalizableString implementations.
      4e120580
    • M
      This is the final change in the series of changes I have been making to ensure... · 51282e31
      Manish Vasani 提交于
      This is the final change in the series of changes I have been making to ensure that compiler and IDE are completely hardened against exceptions from analyzers.
      
      This change makes the DiagnosticDescriptor completely exception safe. Currently, DiagnosticDescriptor has lazily evaluated LocalizableString fields for Title, MessageFormat and Description. These have public extension points at ToString, Equals and GetHashCode methods, all of which can throw. These callbacks have now been wrapped within a try-catch for our LocalizableResourceString implementation of LocalizableString. For custom user implementations of LocalizableString (which should hopefully be rare), we wrap these within an ExceptionSafeLocalizableString which calls into the inner localizable string wrapped within a try-catch. All this is done within the DiagnosticDescriptor constructor, none of the clients have to explicitly handle the exception at use sites.
      51282e31
    • H