1. 11 9月, 2014 4 次提交
  2. 10 9月, 2014 36 次提交
    • V
      Allow parameterless constructors and instance initializers in structs · f4a557dd
      VSadov 提交于
      That is - regardless of the presence of parameterized or primary constructors.
      
      In this implementation if a struct without a primary constructor has initializers and parameterless constructor is not present, we synthesize one to ensure that "new S1()" runs initializers.
      
      ***NO_CI***
       (changeset 1332600)
      f4a557dd
    • M
      Address CR feedback. (changeset 1332543) · 1362c04f
      manishv 提交于
      1362c04f
    • C
      Added .winmd helper methods (changeset 1332312) · 0f4eeb5d
      ChuckStoner 提交于
      0f4eeb5d
    • M
      Fix for bug 1022125: diagnostic analyzer service shouldn't load diagnostic... · def35ce5
      manishv 提交于
      Fix for bug 1022125: diagnostic analyzer service shouldn't load diagnostic analyzer before it is actually used
      
      This change refactors the IDE diagnostic service to track per-language workspace analyzers (VSIX based analyzers). Each analyzer assembly reference created for every analyzer asset is now queried for analyzers in context of a language, hence avoiding instantiating analyzers targeting a different language. Additionally, now that we use the MetadataReader instead of Reflection based Assembly load to find diagnostic analyzer types within an analyzer assembly, we will delay loading of language specific analyzer assemblies until it is queried for analyzers for that language. (changeset 1332021)
      def35ce5
    • S
      Using the metadata reader to parse analyzer type names before loading them. · 8b080f51
      srivatsn 提交于
      The AnalyzerFileReference type is responsible for loading a dll and instantiating individual analyzer types. We were enumerating all available types through reflection. This was the root cause of very poor error messages for diagnostic authors while writing analyzers. Since we are loading an assembly to even determine what language the analyzers are for, we end up loading more assemblies than are needed in the VS process. This change solves both of those issues by making the following changes:
      
      - Read the file using the metadata reader to determine all types that have the DiagnosticAnalyzerAttribute. Build a map of language -> analyzer typenames so that we can avoid loading the assembly if there are no types for the language of interest.
      - The DiagnosticAnalyzerAttribute used to take a params array of strings - changing it to be a single string with allow multiple to keep the parsing simple.
      - Extract the error handling code out to an event so that hosts can report errors encountered during analyzer loading.
      
       (changeset 1331893)
      8b080f51
    • A
    • A
      DevDiv #876518: Stepping into a WinForms app · e2d4b81b
      acasey 提交于
      In dev12, it was possible to F11 a WinForms app and stop at (or just before) the Main method.  As far as I can tell, the debugger was stopping on the first sequence point in My.MyApplication.Main, which Roslyn suppresses.  Since there might be related scenarios that depend on having sequence points in the MyTemplate methods, just emit them all.
      
      Small difference from dev12: They generate GUID names for the MyTemplate files, whereas we just leave the filenames blank.  The debugger doesn't seem to care (there's no file either way).
      
      There's no corresponding bug in C# because the Main method exists in a regular source file. (changeset 1332162)
      e2d4b81b
    • A
      DevDiv #1019283: Part 2 - Consuming the attributes field on local debug info · dc9125ae
      acasey 提交于
      On its own, this change seems kind of silly - instead of consuming a mangled name from the PDB, we set the name to null.  The main benefit is that other PDB producers have a way to communicate to the EE that certain locals should not be consumed, regardless of how they are named. (changeset 1332108)
      dc9125ae
    • C
      When computing the accessibility of operators on pointer types, use the... · 4e7a9566
      chandera 提交于
      When computing the accessibility of operators on pointer types, use the accessibility of the pointer type itself. (changeset 1332023)
      4e7a9566
    • M
      Fix for bug 1022125: diagnostic analyzer service shouldn't load diagnostic... · 8fd45bea
      manishv 提交于
      Fix for bug 1022125: diagnostic analyzer service shouldn't load diagnostic analyzer before it is actually used
      
      This change refactors the IDE diagnostic service to track per-language workspace analyzers (VSIX based analyzers). Each analyzer assembly reference created for every analyzer asset is now queried for analyzers in context of a language, hence avoiding instantiating analyzers targeting a different language. Additionally, now that we use the MetadataReader instead of Reflection based Assembly load to find diagnostic analyzer types within an analyzer assembly, we will delay loading of language specific analyzer assemblies until it is queried for analyzers for that language. (changeset 1332021)
      8fd45bea
    • S
      Using the metadata reader to parse analyzer type names before loading them. · 26f9dd19
      srivatsn 提交于
      The AnalyzerFileReference type is responsible for loading a dll and instantiating individual analyzer types. We were enumerating all available types through reflection. This was the root cause of very poor error messages for diagnostic authors while writing analyzers. Since we are loading an assembly to even determine what language the analyzers are for, we end up loading more assemblies than are needed in the VS process. This change solves both of those issues by making the following changes:
      
      - Read the file using the metadata reader to determine all types that have the DiagnosticAnalyzerAttribute. Build a map of language -> analyzer typenames so that we can avoid loading the assembly if there are no types for the language of interest.
      - The DiagnosticAnalyzerAttribute used to take a params array of strings - changing it to be a single string with allow multiple to keep the parsing simple.
      - Extract the error handling code out to an event so that hosts can report errors encountered during analyzer loading.
      
       (changeset 1331893)
      26f9dd19
    • A
    • S
      Last /warnaserror flag on the command line should always win. · ccef2e07
      shyamn 提交于
      Note: C# and VB behaviors are different for /warnaserror. VB always allows /warnaserror-:xyz to override /warnaserror (i.e. specific option always overrides general one). C# on the other hand allows the last of these options specified on the command line to win - so if /warnaserror:xyz is followed by /warnaserror, then xyz is promoted to an error - but if /warnaserror:xyz follows /warnaserror, then xyz stays as a warning. We can't make the behavior for the two languages identical because we need to maintain backwards compatibility. (changeset 1331612)
      ccef2e07
    • W
      Fix Bug957071: No information available when looking at Async Call frames · a2abb9b7
      wochae 提交于
      During lowering Async method, we generate labels for state machine transition and this information is also consumed by Debugger through Pdb. Not realizing that debugger relies on this information, C# generates one additional label "Initial state" at the beginning of rewriting, which adds 1 to state numbering, causing index mismatch between state number and async-info in Pdb (since Pdb does not contain intiail state).
      
      It turns out we don't need to create this "initial state" label since we set the default value to be -1 (representing 'NotStartedStateMachine') in the constructor and dispatch will fail and fall through to the body part where "initial state" label locates. Note that VB async has already been implemented in this manner. This shelvset removes creation/use of initial states in C# and clean up affected test cases. (changeset 1331364)
      a2abb9b7
    • A
      Change projects to reference the Proprietary Resources NuGet package versus... · 4cda1134
      angocke 提交于
      Change projects to reference the Proprietary Resources NuGet package versus the project. (changeset 1331358)
      4cda1134
    • T
      7cf5f966
    • K
      Delete test associated with "Won't Fix" bug (effort to keep it running would... · 25202fda
      Kevin_H 提交于
      Delete test associated with "Won't Fix" bug (effort to keep it running would yield net negative returns) (changeset 1331314)
      25202fda
    • A
    • A
      Change the NativeClient and NativeClientTests projects to use v4.0 build tools... · 5802071c
      angocke 提交于
      Change the NativeClient and NativeClientTests projects to use v4.0 build tools for back compat. (changeset 1331209)
      5802071c
    • J
      In the case where we are generating code at the end of a file, and we have... · 3b611d7f
      jmarolf 提交于
      In the case where we are generating code at the end of a file, and we have missing braces in the code above, we used to fail to add a newline character.  We now check for this case and add the necessary newline.    (changeset 1331188)
      3b611d7f
    • A
    • B
      Do not format within the braces if they're on the same line for... · 26d35853
      BalajiKris 提交于
      Do not format within the braces if they're on the same line for array/collection/object initializer expressions. This is a heuristic to prevent brace completion from breaking user expectation/muscle memory in common scenarios.
      
      In Dev12 , with auto brace completion enabled, typing { in array, collection, object initializers does not format the brace session range (from { to }). this means users are used to typing in a space right after '{'. In Roslyn, we used to format this and put in the space, thus breaking muscle memory in  common typing scenarios. With this change, we revert to Dev12 behavior.
      
      some examples:
      No formatting cases:
      1. new int[] {}
      2. var x = new { Age = 1 }
      
      Formatting still happens for :
      class C {}
      int Prop {}
      
      The changes themselves are inside
      1. BraceCompletion where we format the tracking span
      2. SmartTokenFormatting which gets triggered for TypeChar of '{'
      
      The change in both places is the same - range to format does not include the '}' (closebrace) token. (changeset 1331104)
      26d35853
    • J
    • A
      Update the version of the toolset compilers used for build and make sure that... · dd0691bb
      angocke 提交于
      Update the version of the toolset compilers used for build and make sure that all projects are using the toolset NuGet. (changeset 1330804)
      dd0691bb
    • K
      c5a85857
    • A
      Globalization/Localizability fixes: · c8ae3dc4
      AlekseyTs 提交于
      - Ensure we can build and run tests when current system locale isn’t English.
      - Move CSC/VBC help strings to resources so that they can be localized.
       (changeset 1330638)
      c8ae3dc4
    • H
      dc2a7e57
    • V
      separated IsParameterlessValueTypeConstructor into... · b2fbbc3b
      VSadov 提交于
      separated IsParameterlessValueTypeConstructor into IsParameterlessValueTypeConstructor and IsDefaultValueTypeConstructor
      
      It is pretty confusing to follow the usage of IsParameterlessValueTypeConstructor with optional flag.
      
      ***NO_CI***
       (changeset 1330578)
      b2fbbc3b
    • V
      New T() should call Activator.CreateInstance unconditionally. · 43267174
      VSadov 提交于
      This is consistent with behavior of "new" when used with structs in general - we should call public parameterless constructor if present, which Activator.CreateInstance does.
      It is also consistent with VB and F#
      
      ***NO_CI***
       (changeset 1330480)
      43267174
    • T
      Replace a couple of metadata references with the equivalent project-to-project... · 6b074424
      tmeschter 提交于
      Replace a couple of metadata references with the equivalent project-to-project references. (changeset 1330367)
      6b074424
    • V
      Fix bug 1020273: Return the same value as the native C# compiler did in... · c121bc53
      vladres 提交于
      Fix bug 1020273: Return the same value as the native C# compiler did in unchecked conversion from floating-point types to integral types in constant expressions in case of overflow. The C# spec says the result is unspecified in these cases, but we want to return the same unspecified value as the native compiler. Before this fix, Roslyn returned zero in these cases. (changeset 1330238)
      c121bc53
    • V
      Making codegen for compound operators over properties with generic receivers... · 02312a1d
      VSadov 提交于
      Making codegen for compound operators over properties with generic receivers same as in Dev12 for compatibility reasons.
      
      This affects cases like
      
      T x;
      x.P1 += foo(ref x);
      x[1] += foo(ref x);
      
      ***NO_CI***
       (changeset 1330113)
      02312a1d
    • H
      Added roslyn diagnostic rule that warns about using generic CodeAction using... · 001d3a1c
      heejaechang 提交于
      Added roslyn diagnostic rule that warns about using generic CodeAction using CodeAction.Create (changeset 1330067)
      001d3a1c
    • A
      Initial support for VB "Elvis" operator: · ac795387
      AlekseyTs 提交于
      - Syntax tree
      - Parsing
      - Initial binding
      - Naive lowering, resulting IL might be inefficient or, in some cases, might be incorrect with respect to preserving side effects in the target.
       (changeset 1329866)
      ac795387
    • S
      Fixing the order in which the analyzer driver is attached · 9cea1ff3
      srivatsn 提交于
      We were calling GetDeclarationDiagnostics() before attaching the driver and this would have led to binding twice in the compiler (since attaching the driver produces a new compilation). Moving the call to GetDeclarationDiagnostics() after attaching the driver's queue. (changeset 1329763)
      9cea1ff3
    • V
      Replace invocations of CaseInsensitiveComparison.Compare with... · ebc69bcd
      vladres 提交于
      Replace invocations of CaseInsensitiveComparison.Compare with CaseInsensitiveComparison.Equals, remove some unnecessary code elements (usings, qualifiers, type arguments, casts, empty elements in xml doc comments).
       (changeset 1329726)
      ebc69bcd