1. 09 1月, 2015 26 次提交
    • A
      Eliminate ‘NeedsLocalization’ calls under Compilers. · 743bbba7
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1392938)
      743bbba7
    • M
      Add couple more CodeAnalysis diagnostics for analyzers: · b5577426
      manishv 提交于
      1) Type argument for "TLanguageKindEnum" type param to language specific register methods (RegisterSyntaxNodeAction, RegisterCodeBlockStartAction and RegisterCodeBlockStartAction) must be VB/C# SyntaxKind enum type.
      
      2) Provide LocalizableString arguments for title and description parameters of DiagnosticDescriptor constructor. The rule is disabled by default, but enabled for all our analyzer projects. (changeset 1392911)
      b5577426
    • A
      Ensure that SemanicModel doesn’t dereference null binder. · 09c7d0bd
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1392909)
      09c7d0bd
    • S
      Creating projects for analyzers for CodeAnalysis APIs · d66cab23
      srivatsn 提交于
      These projects (henceforth referred to as CodeAnalysis analyzers) are set of analyzers for the Roslyn APIs. As a start, I'm moving the few metaanalyzers that Manish wrote to this project. We will ship these analyzers with the roslyn nuget packages. So any rules we want to impose on consumers of Roslyn should go here. (changeset 1392712)
      d66cab23
    • A
      Ensure that PENamedTypeSymbol.EnsureNonTypeMemberNamesAreLoaded loads names of all members. · 8fe1b266
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1392700)
      8fe1b266
    • A
      VB: Fix some issues around conversions from a constant expression to a nullable type: · 6473ee0d
      AlekseyTs 提交于
      - Detect numeric overflow for the conversion to the target underlying type during conversion classification.
      - Perform constant folding for the conversion to the target underlying type during lowering
      ***NO_CI***
       (changeset 1392661)
      6473ee0d
    • A
      Make tests passing on a non-English OS, even in presence of corresponding... · 673f18e1
      AlekseyTs 提交于
       Make tests passing on a non-English OS, even in presence of corresponding localized resources. In the process several product issues were fixed like:
           - Localized exception messages incorporated into diagnostics by command line compiler are not obeying /preferreduilang switch.
           - Some strings are loaded from resources at the time when diagnostic object is created. Resources are loaded earlier than they could be. When error message is requested, it might not be localized in accordance with the requested culture.
           - When target culture is not provided, DiagnosticInfo objects used as arguments within another diagnostic object are formatted using InvariantCulture, whereas all other arguments use current culture (as expected). Portions of the message are localized to different languages. (changeset 1392630)
      673f18e1
    • M
    • T
      ImmutableArrayExtensions should be internal - we shouldn't be exposing public... · 58b38b9a
      TomasMatousek 提交于
      ImmutableArrayExtensions should be internal - we shouldn't be exposing public extension methods on collection types. (changeset 1392421)
      58b38b9a
    • T
      83e43491
    • T
      Encapsulate heaps and operations on them in a MetadataHeapsBuilder. Previously... · 42e4a5d1
      TomasMatousek 提交于
      Encapsulate heaps and operations on them in a MetadataHeapsBuilder. Previously pieces of related functionality were scattered all over.
      Improvements in visualizer: for each blob on #Blobs heap display its kind (TypeSpec, MethodSignature, etc.). Calculate and display aggregate blob sizes per kind. (changeset 1392195)
      42e4a5d1
    • S
      Adding a TestExtensionManager class in the VisualStudioTestSetup project that... · 2330f690
      shyamn 提交于
      Adding a TestExtensionManager class in the VisualStudioTestSetup project that will cause any crashes encountered in the light bulb when running VS integration tests to crash VS within an exception filter as opposed to later once the exception has already been caught.
      
      I am adding this to get more actionable dumps to debug the issue reported in Bug 1098600... (changeset 1391946)
      2330f690
    • J
      Fix InvalidCastException that might be encountered with loading MSBuild project files. · 5703ae72
      jasonmalinowski 提交于
      The problem was an errant cast assumed the metadata would be a string[]. The clean fix is to use the appropriate extension method to deal with the single/multiple case that we get from the MEF library. (changeset 1391813)
      5703ae72
    • B
    • K
    • M
      Turn off the recently added Roslyn diagnostics for validating implementation... · e750a725
      manishv 提交于
      Turn off the recently added Roslyn diagnostics for validating implementation of anlayzers until I clean them up for Roslyn.sln (changeset 1391678)
      e750a725
    • T
      Static lambdas in generic methods are emitted on per-method display class.... · 9c7ab597
      TomasMatousek 提交于
      Static lambdas in generic methods are emitted on per-method display class. Include method ordinal into its name to make it unique.
      
           The previous change to synthesized name numbering introduced a regression - if two generic methods of the same arity contained static lambdas the resulting assembly had duplicate type names. This change addresses that case.
       (changeset 1391470)
      9c7ab597
    • K
    • M
      Add few more Roslyn diagnostic rules for analyzers: · f2f1e52a
      manishv 提交于
      1) Analyzer has an expensive compilation end action: The compilation end actions registered on CompilationStartAnalysisContext can be executed only after all other actions registered on it have been executed on the entire compilation. This can hurt the typing performance when the analyzer is executed in the Visual Studio IDE. If the analysis done within your compilation end action is independent of analyses done in other actions registered on CompilationStartAnalysisContext, then consider registering this end action on AnalysisContext in Initialize method instead of registering it here. This should improve the IDE performance for your analyzer.
      
      2) Recommend adding language support to diagnostic analyzer: If the analyzer supports just one of C#/VB languages, but the analyzer assembly doesn't reference either C# or VB CodeAnalysis assemblies, then the analyzer is pretty likely a language-agnostic analyzer and can support both languages. Consider either removing the argument to DiagnosticAnalyzerAttribute or adding a new DiagnosticAnalyzerAttribute for 'XXX' language support.
      
      3) ReportDiagnostic invoked with an unsupported DiagnosticDescriptor: Only supported descriptors returned from DiagnosticAnalyzer.SupportedDiagnostics should be used for diagnostics reported by ReportDiagnostic. This is a common mistake when adding new rules to an existing analyzer, the diagnostic author might forget to update SupportedDiagnostics. (changeset 1391218)
      f2f1e52a
    • T
      Implements a new approach to generating unique synthesized member names (see... · 94711411
      TomasMatousek 提交于
      Implements a new approach to generating unique synthesized member names (see also the attached email).
      
           1) Assigns each member a "member ordinal" - the index in the members array of the containing type. The ordinal is propagated thru lowering rewriters which uses it to make generated names unique.
           2) We no longer calculate "overload ordinal" for names of state machine types, we use the member ordinal of the async/iterator method instead.
           3) Removes GenerateTempNumber from TypeCompiationState. Combination of method ordinal and other indices is used to make generated names unique:
           - Display classes use ordinal of the method containing the lambda and closure scope ordinal (unique within a method). Static display class is shared across all non-generic methods of a containing class and thus doesn't need a unique number in name (it;'s simple named "c<>").
           - Lambda methods include containing method ordinal (unless emitted to a display class whose name already includes it) and lambda ordinal (unique within a method).
           - The same for fields caching lambdas.
           - Dynamic site containers - no longer include method name in the type name, instead method ordinal is used.
      
           4) Expression compiler - rename generated type to "<>x" to avoid confusion with "<>c" static display class.
           5) Avoid replacing "." with "_" in member names, other than type names. While displaying stack frames the EE extracts method name from synthesized lambdas method names and displays it. Thus we were displaying "I_F" instead of "I.F" for explicitly implemented methods.
            In type names replace "." with "-". Replacing with "_" lead to duplicate type names in emitted assembly (2 iterator methods with names "I_F" and "I.F" - explicitly implemented iface method). (changeset 1390962)
      94711411
    • M
      Add Roslyn diagnostic analyzers for validating implementation of diagnostic... · bbb922cd
      manishv 提交于
      Add Roslyn diagnostic analyzers for validating implementation of diagnostic analyzers (meta-analyzers)
      
      1) MissingDiagnosticAnalyzerAttributeRule: Validate that non-abstract sub-type of DiagnosticAnalyzer has DiagnosticAnalyzerAttribute applied to it.
      
      2) MissingKindArgumentRule: Ensure that at least one symbol kind/syntax kind argument is provided to RegisterSymbolAction/RegisterSyntaxNodeAction respectively.
      
      3) UnsupportedSymbolKindArgumentRule: Ensure that only supported symbol kinds are registered with symbol analyzer actions.
      
      4) ApplyDiagnosticAnalyzerAttributeFix: CodeFixProvider for Rule (1) to generate DiagnosticAnalyzer attribute(s). (changeset 1390936)
      bbb922cd
    • D
      [de minimis] Core IDE Support for VB string interpolation · 3fac3705
      dustincampbell 提交于
      The vast majority of this came from ADGreen (thanks Anthony!), which in turn had a great deal ported from the work I'd done in C#.  At this point, I'm not sure *who* wrote this code. It's shelvesets all the way down.
      
      * Automatic brace completion
      * Formatting
      * Completion list
      * Brace matching
      * Classification (changeset 1390884)
      3fac3705
    • M
      Upgrade to newer nuget packages for toolset compilers and diagnostics. · f5a4e033
      manishv 提交于
      Also fixes bug 1097058 by removing the suppressions for now fixed RS0013. (changeset 1390773)
      f5a4e033
    • R
      ba123ce3
    • A
      Disable a missed keepalive test and mark it with the same workitem to... · 4c0d29f4
      angocke 提交于
      Disable a missed keepalive test and mark it with the same workitem to investigate keepalive test reliability (CS 1095079). (changeset 1390720)
      4c0d29f4
    • R
      Move the internal folder structure from Open/* to Open/src/*. · d54b32f7
      RoslynTeam 提交于
      This matches the folder mapping of the git repository and makes it easier
      to do mapping to Codeplex/Git. (changeset 1390665)
      d54b32f7
  2. 07 1月, 2015 14 次提交
    • A
      Add support for indexer initializers (in object initializers) on pointer types · 546a62bc
      AlekseyTs 提交于
      ***NO_CI***
       (changeset 1390660)
      546a62bc
    • M
      Add skipped tests for bug 1019361. (changeset 1390653) · b11f3fa4
      manishv 提交于
      b11f3fa4
    • A
      C#: GetAndValidateConstantValue – Adjust error recovery code to avoid... · a466e99c
      AlekseyTs 提交于
      C#: GetAndValidateConstantValue – Adjust error recovery code to avoid unintentional suppression of expected diagnostic.
      ***NO_CI***
       (changeset 1390636)
      a466e99c
    • M
      Fix for bug 1088032: We need to move all our analyzers to use localizable... · 3905e47a
      manishv 提交于
      Fix for bug 1088032: We need to move all our analyzers to use localizable strings for title and description.
      
      Update FxCop and Roslyn analyzers in Roslyn.sln to use the newly added DiagnosticDescriptor constructor that takes LocalizableString for Title, MessageFormat and Description. (changeset 1390465)
      3905e47a
    • S
      Make parts of analyzer driver internal. · 97b9a4d3
      srivatsn 提交于
      The renamed files from my previous somehow didn't have the edits but just had the rename checked in. Checking in the edits as well. (changeset 1390443)
      97b9a4d3
    • S
      Make parts of AnalyzerDriver internal by creating shared projects · 644f378d
      srivatsn 提交于
      The IDE uses four public APIs from the compiler layer for doing running analyzers in the IDE:
      
      1. A bunch of static methods on AnalyzerDriver called Execute*Actions which take a type called AnalyzerActions which should be an implementation detail. So first change is to create a shared project called AnalyzerDriver that is referenced by CodeAnalysis and Features layers. I've split out these statics into a type called AnalyzerDriverHelper and made that internal. One challenge in doing this is that these methods create instances of Contexts and currently their constructors are internal. I've added constructors where possible and for some contexts that were taking Scopes, I've changed them to be abstract base classes and eliminated the scopes altogether. As part of pulling these methods, I needed some collections like ArrayBuilder, PooledDictionary etc and created another shared project called SharedCollections and put them there.
      
      2. SemanticModel.GetDeclarationsInSpan - this is used by the IDE to calculate the declarations on which to run analyzers. This has also been pulled into the shared project and the API on semantic model made internal. We need a mechanism for branching into C#\VB implementations on both sides. Hence, the compiler API on semanticmodel still exists and is internal. On the features side, I have a language service, that branches into C#\VB and the implementation simply calls into the shared code.
      
      3,4. AnalyzerDriver.GetEffectiveDiagnsotics and AnalyzerDriver.IsAnalyzerSuppressed() are two APIs about filtering that the IDE uses. There are legitimate scenarios for both of them being public APIs even if we make the IDE simply ask the compiler to run its analyzers. For eg: the IDE will need to run Document analyzers and the compiler can never run them. It needs to filter the results after that. Filtering requires pragma state and suppressmessage etc which are compiler'y things. The plan here is to move these APIs to a type called CompilationWithAnalyzers that John is creating to replace the AnalyzerDriver.GetAnalyzerdiagnostics() method. Once that happens, we can make AnalyzerDriver fully internal. This change doesn't touch those methods.
      
      The shared code needed to access some resources. So I've created a type called AnalyzerDriverResources in both the Codeanalysis and features projects and they redirect to the appropriate resources.
       (changeset 1390439)
      644f378d
    • A
      Improve the error reporting in the compiler server client. · ffc2b596
      angocke 提交于
      There are two scenarios which could be better. First, if the client hits an unrecoverable error we need as much information as possible to debug it. The solution to this is stop catching our fatal exceptions and instead let them bubble out of the process, much like our exception fail fast.
      
      Second, if the problem is that the compiler itself has crashed, we should report that error to the user and tell them where they can get more information about the crash (i.e., the event log). (changeset 1390397)
      ffc2b596
    • A
      Ensure that GetConstantValueDiagnostics API never returns default... · 397bc381
      AlekseyTs 提交于
      Ensure that GetConstantValueDiagnostics API never returns default ImmutableArray to avoid NullReferenceException while trying to foreach over it.
      ***NO_CI***
       (changeset 1390350)
      397bc381
    • M
      Fix for bug 1096600. · ed31ebb0
      manishv 提交于
      1) Add VB and C# compiler tests to verify that all configurable compiler diagnostics (non-errors) that show up in the ruleset editor have a non-null and non-empty Title and Category.
      2) Commented out some more unused diagnostic IDs in both compilers that were found through these tests.
      3) Add title resource strings for hidden and info compiler diagnostics. These are configurable and show up in the ruleset editor. (changeset 1390346)
      ed31ebb0
    • J
      Fixes in AnalyzerDriver · 1345b768
      jaredpar 提交于
      This fixes a couple of minor issues with AnalyzerDriver.
      
      1. The compilation process was always shutting down with two first
      chance exceptions.   The code would unconditionally loop an await
      DequeueAsync calls which results in a TaskCanceledException when the
      CompilationEventQueue is completed.  That exception was then rethrown to
      the calling method.
      
      This is not wrong but it significantly hinders the debugging experience
      in Visual Studio (exceptions result in dialogs + pauses).  And the
      second throw essentially amounts to using exceptions as control flow.
      
      I changed the code to stop looping when there was no potential for
      future data from the CompilationEventQueue.  If the queue is completed
      and has zero entries then no more data will ever be added and calling
      DequeueAsync is wasted processing.  This is the normal shut down
      sequence for the compiler.
      
      2. The exception handling code covered two methods: DequeueAsync and
      ProcessEventAsync.  It assumed that TaskCanceledException always came
      from DequeueAsync.  If ProcessEventAsync ever threw a
      TaskCanceledException the event loop logic would be incorrect.  Changed
      the handling to be separate for each call.
      ***NO_CI***
       (changeset 1390329)
      1345b768
    • J
      Responding to CR feedback (changeset 1390324) · d9569c8c
      jaredpar 提交于
      d9569c8c
    • K
    • M
      Fix RS0013 (Do not access property Descriptor on Diagnostic type within... · 5c2b4816
      manishv 提交于
      Fix RS0013 (Do not access property Descriptor on Diagnostic type within compilers layer) to not be reported within Diagnostic type itself. (changeset 1390290)
      5c2b4816
    • A
      Initial compiler support for VB string interpolation. Does not include target... · 4932408b
      ADGreen 提交于
      Initial compiler support for VB string interpolation. Does not include target typing or any IDE support. (changeset 1390282)
      4932408b