1. 07 10月, 2014 13 次提交
    • J
      Make much of the Workspaces layer Portable. · e76a29a4
      jasonmalinowski 提交于
      This change splits the Workspaces layer into two parts, mirroring the Portable/Desktop split that the compilers did. The core parts of the Workspaces layer (managing documents and projects, formatting, some refactoring, code fixes) is kept in the portable subset, with a few non-portable pieces remaining, notably MSBuild support.
      
      This change has a major impact on how MEF now works in Roslyn. Traditional MEF (“MEFv1”) is not portable, and so we must move the Workspaces layer over to using the Microsoft.Composition NuGet package (“MEFv2”) which is. The APIs are distinct in that each has its own namespace, but the concepts are more or less identical. It requires some care though: the workspaces layer is simple in that it only references MEFv2, but higher layers have to reference both versions to use metadata attributes. Exports using metadata attributes from the editor (say, ContentTypeAttribute) must use MEFv1 attributes to export, whereas exports for the workspaces layer must use MEFv2 attributes. The rule is subtle and yet simple, and so a diagnostic is provided which catches any offenses to prevent confusion.
      
      This also has some impact in how we create MEF hosts: if you wish to host just the base workspaces layer, we can use MEFv2 to compose everything. The HostServices implementation (MefV1HostServices) that consumes a MEFv1 ExportProvider. If you’re in Visual Studio, you can use this implementation to get the full set of host services provided in Visual Studio.
      
      Otherwise, most of the changes in here are minor: we react to some APIs that have been moved/renamed in the portable subset we are targeting, and also align our various exception helper utilities with the compiler’s precedent. (changeset 1349276)
      e76a29a4
    • T
      Decouple Workspace metadata provider from compiler metadata provider. · d0ea0869
      TomasMatousek 提交于
      The service no longer derives directly from MetadataReferenceProvider. Instead the service exposes API to get metadata references and an instance of compiler reference provider. (changeset 1349108)
      d0ea0869
    • H
      4cbd636d
    • A
      InvalidCastException: ForEach->For (changeset 1348995) · 36fca427
      acasey 提交于
      36fca427
    • V
      Fix bug 990618: Fix spelling of SyntaxKind.BeginCDataToken from "<[CDATA[" to... · f5e03451
      vladres 提交于
      Fix bug 990618: Fix spelling of SyntaxKind.BeginCDataToken from "<[CDATA[" to "<![CDATA[". Also fix broken link in VisualBasicSyntaxGenerator.vbproj, removes some redundant code and fixes casing in some VB identifiers. (changeset 1348971)
      f5e03451
    • T
      Implements CR feedback for EmitOptions change: rename EmitOptions.OutputName... · cad06f2b
      TomasMatousek 提交于
      Implements CR feedback for EmitOptions change: rename EmitOptions.OutputName to OutputNameOverride and adds TolerateErrors and IncludePrivateMembers.  (changeset 1348868)
      cad06f2b
    • N
      629369-null check in delegate conversion · 755ffcd0
      nmgafter 提交于
      We insert a null check into the code generated for a delegate
      conversion, so that Nothing is converted to Nothing rather
      that throwing a null exception.
      
      Note that we continue to generate the incorrect null-throwing
      code for conversions appearing in expression trees. We do that
      because we don't want to break backward compatibility
      (there is no way to translate into the null-check version). (changeset 1348760)
      755ffcd0
    • J
      Fixing file IO race condition by always removing test files in-between... · adca56da
      jmarolf 提交于
      Fixing file IO race condition by always removing test files in-between compilations. (changeset 1348724)
      adca56da
    • V
    • C
    • M
      Fix for bug 1038056: Rationalize Diagnostic.Severity and Diagnostic.IsWarnAsError properties · a66bd965
      manishv 提交于
      Diagnostic.Severity property used to denote different things for compiler and user diagnostics. For compiler diagnostics, this property denotes the error code severity, i.e. the default severity of the diagnostic. For warnings as errors, this property still returned DiagnosticSeverity.Warning and the consumer had to check for the IsWarnAsError property to get the effective severity. For user diagnostics, this property denotes the effective severity based on the compilation options.
      
      This change makes the following changes:
      1) Change Diagnostic.Severity to always represent the effective severity of the diagnostic for both user and compiler diagnostics. So for warn as error, this will return error severity.
      2) Introduce Diagnostic.DefaultSeverity to represent the default severity of the diagnostic. This is the error code severity for compiler diagnostics and diagnostic descriptor severity for user diagnostics.
      3) Change IsWarningAsError property to return true iff Diagnostic.DefaultSeverity = Warning and Diagnostic.Severity = Error. (changeset 1348667)
      a66bd965
    • T
      042bc6fb
    • T
      Introduces EmitOptions for options passed to Compilation.Emit(). · 1621a00f
      TomasMatousek 提交于
           Moves options that were previously on CompilationOptions but were not used until emit phase to EmitOptions: fileAlignment, baseAddress, highEntropyVirtualAddressSpace, subsystemVersion, runtimeMetadataVersion. They hold on values written to various PE headers. We can now easily add other similar PE flags to EmitOptions, which is a common customer request, without affecting code that works with compilation options in other layers (workspaces, project system, etc.).
      
           Removes EmitMeadataOnly method and instead adds a MetadataOnly flag to EmitOptions. Removes MetadataOnlyEmitOptions - they were not used and can now be easily added as bools to EmitOptions.
      
           Moves pdbFilePath and outputName from parameters of Emit to EmitOptions.
      
      IDE: remove tracking of options that were moved to EmitOptions, since the IDE doesn't care about options that don't affect compilation. (changeset 1348623)
      1621a00f
  2. 06 10月, 2014 7 次提交
  3. 05 10月, 2014 3 次提交
  4. 04 10月, 2014 16 次提交
    • H
      wait up to 5 seconds on VS shutdown to give grace period to shutdown solution... · cc87ac0f
      heejaechang 提交于
      wait up to 5 seconds on VS shutdown to give grace period to shutdown solution cralwer. otherwise, some async method of solution cralwer might in the middle of running even after shutdown process started. (changeset 1348118)
      cc87ac0f
    • K
      Rollback change that added a reference to the Compilation on... · 610c328b
      Kevin_H 提交于
      Rollback change that added a reference to the Compilation on CompilationTestData.  I misunderstood the root cause of the issue that caused a test to AV when visualizing IL. (changeset 1348099)
      610c328b
    • T
      The synthesized variable used for storing the value of Select Case should be... · a1c4f361
      TomasMatousek 提交于
      The synthesized variable used for storing the value of Select Case should be long-lived. (changeset 1348097)
      a1c4f361
    • D
      Bugfixes 991528 and 1038018 Respecting encoding settings · 400ce23a
      dpoeschl 提交于
      Bugfix 991528 "[CodePlex] Persisting Documents with MSBuildWorkspace.TryApplyChanges doesn't respect existing encoding"
      
      Pass the CodePage MSBuild property to our MSBuildWorkspace instead of defaulting to the system default encoding. If the CodePage is 0 or missing, we default to UTF8.
      
      Bugfix 1038018 "Inline rename causes unrelated edits in files with unicode characters"
      
      The TextBufferTextFactory now prefers encodings in the following order:
           - UTF8/Unicode/BigEndianUnicode if the byte order mark is present
           - The specified default codepage/encoding in the project file
           - UTF8 without a byte order mark
           - The system default encoding (changeset 1348078)
      400ce23a
    • T
      EnC: Local variable mapping rewrite. · 916b9efa
      TomasMatousek 提交于
      Current approach and issues
      
           When emitting method body of a method updated during EnC the compiler needs to assign local variables the same slots they had before the edit, so that state stored in those locals gets preserved.
           To implement this slot mapping we used to encode information into synthesized variable names that identified the syntax node that produced the variable and ultimately allowed us to calculate the slot mapping.
           For user variables we identified the slot by name. In both cases we relied on an assumption that the compiler assigns slots in syntax order. This assumption is false in some cases. We could make it true but the requirement would be fragile and hard to enforce when new features are implemented in the compiler since the entire lowering pipeline would need to preserve the assumption.
      
           New approach
           In the new approach we calculate a "syntax offset" for each user-defined and long-lived synthesized variable. Every such variable symbol has to be associated with a syntax node (its declarator). In usual cases this is the textual distance of the declarator from the start of the method body. It gets a bit complicated when the containing method body is not contiguous (constructors). If the variable is in the body of the constructor the definition of syntax offset is the same. If the variable is defined in a constructor  initializer or in a member initializer (this is only possible when declaration expressions or closures in primary constructors are involved) then the distance is a negative sum of the widths of all the initializers that succeed the declarator of the variable in the emitted constructor body plus the relative offset of the declarator from the start of the containing initializer.
      
           If a single node is a declarator for multiple variables of the same synthesized kind (it can only happen for synthesized variables) we calculate additional number "ordinal" for such variable. We assign the ordinals to the synthesized variables with the same kind and syntax offset in the order as they appear in the lowered bound tree. It is important that a valid EnC edit can't change the ordinal of a synthesized variable. If it could it would need to be assigned a different kind or associated with a different declarator node.
      
           To support EnC of async method we will assign another number "subordinal" to certain synthesized locals (produced by spilling by-ref variables) to simplify the mapping. Assigning of such number is not yet implemented in this change.
      
           Together (syntax offset, ordinal, subordinal) form a LocalDebugId of a variable. Since this id needs to be stored in PDB for both user-defined and long-lived synthesized variables we can’t encode it in the name of the variable (the names of user-defined variables have to be their user specified names). Therefore this change introduces a new custom debug info record that is associated with a method. The record encodes the kind and id for each local slot of the method.
      
           As a consequence we no longer emit names for synthesized long-lived variables (“CS$...”) unless it’s necessary for backward comp with Dev12 EE (only display class local names need to be emitted for this reason). (changeset 1348066)
      916b9efa
    • R
      Add a Culture property to AnalyzerOptions so that analyzers can localize... · b1691bfa
      RoslynTeam 提交于
      Add a Culture property to AnalyzerOptions so that analyzers can localize diagnostics. (changeset 1347954)
      b1691bfa
    • M
    • V
      Fix bug 1040171: ETA crashes if labeled statement is used as an embedded... · e70cbbdb
      vladres 提交于
      Fix bug 1040171: ETA crashes if labeled statement is used as an embedded statement. Also simplifies some conditions using null-propagating operator. (changeset 1347929)
      e70cbbdb
    • H
      removed diagnostic code I had put into workspace to figure out MEF issues. it... · af9763aa
      heejaechang 提交于
      removed diagnostic code I had put into workspace to figure out MEF issues. it is no longer needed. no fix yet though. (changeset 1347829)
      af9763aa
    • B
      Bugfix 1036954 CR Comments (changeset 1347775) · 68e7654f
      Basoundr_ms 提交于
      68e7654f
    • K
      Add a reference in CompilationTestData to hold on to the Compilation that was... · d8a4bfb8
      Kevin_H 提交于
      Add a reference in CompilationTestData to hold on to the Compilation that was used to initialize it.  The IL visualizer requires Symbols of the Compilation to still be alive when visualizing tokens.
      
      Most of the time, we hold a reference to the compilation in the test method, so the lifetime of the Symbols would be long enough for all test verification to occur.  However, in some tests, the Compilation is created in a helper and then thrown away as soon as the PE image is emitted.  Verification steps later in the test method could result in AVs if a GC occurs at the wrong time. (changeset 1347747)
      d8a4bfb8
    • J
    • B
      Bugfix 1036954 : Compiler only expects IOException and BadImageFormatException... · d20c2155
      Basoundr_ms 提交于
      Bugfix 1036954 : Compiler only expects IOException and BadImageFormatException coming out of PortableExecutableReference.GetMetadata.
      
      Any other exception (like UnauthorizedAccessException) needs to be wrapped into IOException, unless it already derives from IOException.
           VisualStudioMetadataReferenceManager.GetStorageInfoFromTemporaryStorage directly calls File.Open which may throw all sorts of exceptions.
      
      The fix is to call FileUtilities.OpenStream which wraps the exceptions properly
      
      Since this is behavior expected any where in the product, the APIs Open, Create have now been wrapped with the helpers to generate the IOException instead of some random exception. (changeset 1347659)
      d20c2155
    • A
      C#: Changing BaseListSyntax to contain a list of BaseTypeSyntax nodes rather... · fd4cf5dc
      AlekseyTs 提交于
      C#: Changing BaseListSyntax to contain a list of BaseTypeSyntax nodes rather than a list of TypeSyntax nodes. (changeset 1347630)
      fd4cf5dc
    • R
      I am adding telemetry to Roslyn to collect information regarding analyzers... · ec281063
      RoslynTeam 提交于
       I am adding telemetry to Roslyn to collect information regarding analyzers which crash. This is to get answers for questions like
           - What are the top 10 analyzers which crash the most often in a VS Session?
           - What exceptions do they crash with?
           - What kind (symbol, syntaxtree) of analyzers crash often?
      
           DiagnosticAnalyzerDriver.cs - Log the analyzer and the exception details when there is a crash.
           DiagnosticAnalyzerLogger.cs - Logic to aggregate the analyzers crash details and post the summary as telemetry event.
           SolutionCrawlerLogger.cs - Log the analyzer crash summary during shutdown.
           HashAlgorithms.cs - Some style cop changes. (changeset 1347620)
      ec281063
    • M
      Fix for bug 685183: Eliminate usages of SemanticModel.ResolveOverloads · 2b627eee
      manishv 提交于
      This change replaces the uses of this API with use of speculative semantic model to determine if invoking a different constructor (given type or its base type), possibly with a subset of arguments, binds to an accesible constructor.
      Additionally, I have removed this public API from SemanticModel.
      
      Note: There are still language specific internal implementations of this API. These seem to be only used by tests, but some tests use them as helpers to test actual overload resolution functionality. I'll open a separate bug on compiler team to clean this up post-preview. (changeset 1347617)
      2b627eee
  5. 03 10月, 2014 1 次提交