1. 03 10月, 2014 6 次提交
    • V
      Fix bug 1036356: failing assert at... · 5041c552
      vladres 提交于
      Fix bug 1036356: failing assert at Microsoft.CodeAnalysis.CSharp.LocalRewriter.MakeConversion (changeset 1347071)
      5041c552
    • R
    • D
      Core C# IDE Support for string interpolation · 0af01e3d
      dustincampbell 提交于
      The following features have been updated to support interpolated strings:
      
      * Classification - start, mid, and end tokens of an interpolated string are now classified as strings.
      
      * Formatting - the formatter no longer adds spaces before and after insert "holes" in interpolated strings.  From an IDE design perspective, we've decided to not enforce any spacing rules because it's possible that a user may want no spacing for a simple or dotted name (e.g. "\{name}") but *would* want spacing for more complex expressions.
      
      * Completion List - the position after a start or mid token is now considered an expression context, so the completion list appears as expected.
      
      * Automatic Brace Completion - Typing \{ will complete the closing } in standard brace completion scenarios. It will not complete when going back to edit a string unless the edit happens at the end of the line. This is consistent with how brace completion works in general. (We'll need a platform change to do otherwise.)
      
      * Brace Matching - \{ and } braces are highlighted in the editor when the caret is at the start or end of them respectively. (changeset 1346881)
      0af01e3d
    • V
      Test for bug 1040171: ETA crashes if labeled statement is used as an embedded... · aaf3c3aa
      vladres 提交于
      Test for bug 1040171: ETA crashes if labeled statement is used as an embedded statement (changeset 1346866)
      aaf3c3aa
    • J
      There are two possible root causes to this test failure. · d7c2182d
      jmarolf 提交于
      1. File IO error.
      2. Incorrect options given.
      
      #2 will have some explainatory output, while #1 will not.
      
      Adding logging to determine which case is present.
       (changeset 1346801)
      d7c2182d
    • P
  2. 02 10月, 2014 34 次提交
    • N
      d13ae70f
    • S
      DiagnosticFormatter should output line numbers for externalfile locations · e9a5f14e
      srivatsn 提交于
      The Razor folks use the DiagnosticFormatter to format errors that they produce on their side. Some of the errors come from the parser and they create some errors on their own with the location set to Location.Create(...) which creates a ExternalFileLocation. In that case, we still have the proper line span information and should format that.  (changeset 1346489)
      e9a5f14e
    • S
    • S
      5b6de9bf
    • S
      Delete AnalysisContext.RegisterSessionAnalyzer · c8455ba3
      srivatsn 提交于
      The RegisterSessionAnalyzer on an AnalysisContext is a way for one session analyzer to register another session analyzer. We haven't needed such functionality till and currently this doesn't function either because it doesn't call the Initialize methods of the session analyzers. Removing this method for preview. If we get requests for this scenario, we can add this API back.
      
      With this removed, all the Register* methods on context all register actions. This was the only one that registered an analyzer. (changeset 1346448)
      c8455ba3
    • S
      Fix a couple more inconsistencies between release and debug configurations to... · bc9b76ef
      shyamn 提交于
      Fix a couple more inconsistencies between release and debug configurations to fix build breaks in release introduced in C1346108
      
      (I didn't catch this in my previous change because this issue breaks build for DevDivInserionFiles.sln and we don't build this solution as part of test.exe) (changeset 1346435)
      bc9b76ef
    • S
      Rename TSyntaxKind · f445c772
      srivatsn 提交于
      The syntax analyzer APIs take a type parameter which was called TSyntaxKind. There has been feedback that this confused people a lot - people assumed that they are supposed to pass the type corresponding to a syntax node and would pass in something like NamedTypeSyntax and this wasn't found out until it blew up at runtime with an unintelligible error.
      
      This change renames the type variables to TLanguageKindEnum and puts a struct constraint on it so that the common mistake of passing in a node would get caught at compile time. (changeset 1346415)
      f445c772
    • N
      Fix 1029117 by adding a null check. (changeset 1346395) · 927099af
      nmgafter 提交于
      927099af
    • S
      7a1b3b63
    • H
      a place where race happens is down to the point where we get MEF services from ExportProvider. · 06d641eb
      heejaechang 提交于
      removed all other diagnostic instrument code except the ponit where we get MEF services from ExportProviders.
       (changeset 1346356)
      06d641eb
    • V
      Implements a spec refinement to how autoprops behave in constructors. · 1a7ebab9
      VSadov 提交于
      For accesses to an autoprop in a corresponding [static|instance] constructor -
      
      (a) It should bind to the property, but the property should be treated as a readable/writable even if it is a readonly autoprop.
      (b) The definite assignment behavior should be as if directly accessing the backing field.
      (c) It should code gen to the property accessor (if one exists) or a field access (if not).
      
      The most observable outcome of all this is that it is possible to assign a readonly autoprop in the constructor and that
      in a struct instance constructor you no longer need to initialize whole struct before using any of its autoprops.
      
      The following code is now valid and does what you think it does:
      
      public struct S
      {
          public int X{get;}
          public int Y{get;}
      
          public S()
          {
              X = 42;
              Y = X;
          }
      
          public static void Main()
          {
              S s = new S();
              System.Console.WriteLine(s.Y);
          }
      }
      
      .
      
       (changeset 1346315)
      1a7ebab9
    • N
      Interaction between nameof and IndexerNameAttribute causes the latter to not... · d8b545dc
      nmgafter 提交于
      Interaction between nameof and IndexerNameAttribute causes the latter to not work correctly (changeset 1346254)
      d8b545dc
    • D
      Bugfix 1037992 "LockRecursionException on linked file close" and 1039084... · 54e86c47
      dpoeschl 提交于
      Bugfix 1037992 "LockRecursionException on linked file close" and 1039084 "Closing a shared document tab may cause the shared item context hierarchy to switch"
      
      Bug 1037992 "LockRecursionException on linked file close" - The workspace's OnDocumentClosed method may need to pick a new active context document and alert appropriate hierarchy of the change. Doing so may cause us to be called back via OnDocumentContextUpdated while still holding the serialization lock. We now alert the appropriate hierarchy of the active context change outside of OnDocumentClosed's serialization lock.
      
      Bugfix 1039084 "Closing a shared document tab may cause the shared item context hierarchy to switch" - In the Workspace's OnDocumentClosed method, we were lacking enough context to distinguish between cases where just one of a set of linked/shared files was closed (e.g. excluding a linked file from one of its owning projects or unloading one of the head projects for a shared project) and cases where the entire set of linked/shared files was closed (e.g. closing the tab of a shared document). In the former case, we need to pick a new active context document and alert the outside world (setting SharedItemContextHierarchy or calling TransferItem) so that the open tab updates correctly and the we stay in sync with the containing hierarchies. In the latter case, we must not alert the outside world between individual document closes.
      
      We now distinguish between these cases in OnDocumentClosed. The DocumentProvider decides the updateActiveContext flag by whether or not multiple documents are being closed at once. If multiple documents are being closed, it assumes all documents are being closed and chooses not to update the active context. (changeset 1346228)
      54e86c47
    • T
      Rename internal FieldInitializer struct in C# to FieldOrPropertyInitializer,... · 6deb754e
      TomasMatousek 提交于
      Rename internal FieldInitializer struct in C# to FieldOrPropertyInitializer, since it actually may represent a property initializer and to match VB impl. (changeset 1346166)
      6deb754e
    • A
    • J
      Extending timeout to be a maximum of 5 minutes, and adding logging to see... · 80ac8630
      jmarolf 提交于
      Extending timeout to be a maximum of 5 minutes, and adding logging to see which operation caused the test to time out. (changeset 1346136)
      80ac8630
    • K
      Change LookupForExtensionMethods to ignore accessibility based on... · ef0c4586
      Kevin_H 提交于
      Change LookupForExtensionMethods to ignore accessibility based on LookupOptions and fix some formatting... (changeset 1346125)
      ef0c4586
    • A
      Create a project for a vbcsc2ui.dll to hold resource used by vbc2.exe and... · b8fec1ce
      AlekseyTs 提交于
      Create a project for a vbcsc2ui.dll to hold resource used by vbc2.exe and csc2.exe. (changeset 1346108)
      b8fec1ce
    • B
      Bugfix 771761 - Format #region and #endregion when both typing and committing from completion list · a1fc0351
      Basoundr_ms 提交于
      Bugfix 608827 - CR (changeset 1346106)
      a1fc0351
    • V
      Bugs 1026593, 1026595: Set DtdProcessing = DtdProcessing.Prohibit, XmlResolver... · 3c19b030
      vladres 提交于
      Bugs 1026593, 1026595: Set DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null for all XML processing. Also fixes minor typos and redundant code. (changeset 1346103)
      3c19b030
    • T
      VB compiler currently creates "user-defined" function return value locals even... · d5880da2
      TomasMatousek 提交于
      VB compiler currently creates "user-defined" function return value locals even in methods where they are not (and should not be) accessible from user code, such as lambdas, iterators, async methods and operators.
      In some of these cases the variables have a synthetic name that prevents them from showing up in EE. In other cases they show up, but they shouldn't since they are not accessible from user code and changing their value doesn't work and doesn't make much sense either (e.g. in an iterator the variable showed up under MoveNext name and was of type IEnumerable<T>).
      
      This change switches such variables to synthesized variables (as opposed to user-defined). For now they are emitted to PDBs under name "VB$FRV" to satisfy various assertions. Names of all synthesized locals that are not used by the EE will be dropped in a follow-up check-in.
       (changeset 1346061)
      d5880da2
    • T
      Add doc for /checksumalgorithm command line option. · ad736dc9
      TomasMatousek 提交于
       (changeset 1346054)
      ad736dc9
    • H
      don't crash VS on fatal error on esent (fatal errors include things such as... · 53189bd4
      heejaechang 提交于
      don't crash VS on fatal error on esent (fatal errors include things such as out of disk space, log file got corrupted by other process and etc).
      
      in these cases, we will recover the issue by using memory cache. (changeset 1346037)
      53189bd4
    • A
      Rename exe.config "dieTimout" switch to "keepalive" to have consistent naming for the same feature. · d026697d
      angocke 提交于
      ***NO_CI***
       (changeset 1346027)
      d026697d
    • D
      Make DocumentInfo.DefaultEncoding internal until we have a strong reason to... · 8daffb57
      dpoeschl 提交于
      Make DocumentInfo.DefaultEncoding internal until we have a strong reason to make it public. (changeset 1346025)
      8daffb57
    • N
      5035d842
    • T
      This shelveset implements following changes to metadata reference compiler API... · 4fc808ea
      TomasMatousek 提交于
      This shelveset implements following changes to metadata reference compiler API in order to remove duplication in the public surface and prevent users from unexpected metadata lifetime issues:
      
           1) MetadataImageReference and MetadataFileReference overlap
           Currently MetadataImageReference can be constructed from a Stream. MetadataImageReference supports metadata prefetch (reading the blob into memory and close the underlying stream) as well deferred reading (no content is read until the reference is consumed during compilation). MetadataFileReference only supports deferred reading.
      
           Lifetime of MetadataFileReference is non-deterministic, the underlying file is locked until no references exist and we GC the metadata.  On the other hand, it is possible to construct MetadataImageReference in such a way that allows controlling the underlying resources deterministically.
      
           Remove MetadataFileReference, use MetadataImageReference instead.
      
           2) Lifetime management
           AssemblyMetadata and ModuleMetadata objects hold on resources and implement IDisposable. When using MetadataFileReference constructors and some MetadataImageReference constructors to create references the underlying metadata objects are created implicitly and the user doesn’t have a way to explicitly dispose them.
      
           Make MetadataImageReference constructors internal and instead add factory method GetReference on AssemblyMetadata/ModuleMetadata. The usage pattern is:
      
           using (var metadata = AssemblyMetadata.CreateFromXxx(…))
           {
               var compilation = CSharpCompilation.Create(syntaxTrees, new[] { metadata.GetReference() });
               …
           }
      
           In addition the shelveset makes MetadataImageReference internal and adds the following convenience APIs, that are not the most efficient but are very convenient, easy to discover and safe to use for customers that don’t wanna explicitly manage the lifetime of metadata objects. (changeset 1345987)
      4fc808ea
    • J
    • V
      Fix bug 1032724: Do not give error CS0842: 'C.X': Automatically implemented... · 464487b4
      vladres 提交于
      Fix bug 1032724: Do not give error CS0842: 'C.X': Automatically implemented properties cannot be used inside a type marked with StructLayout(LayoutKind.Explicit) for static auto-properties (changeset 1345941)
      464487b4
    • H
      adding more diagnostic code. · b87fbd22
      heejaechang 提交于
      recent dump indicates that some MEF services are found in MEF export provider but not in the map we creates off the MEF services.
      
      I added more data to be saved in the dump to see where that mismatch happens. (changeset 1345914)
      b87fbd22
    • J
      This change implements a new DiagnosticAnalyzer for equality which adds the... · 69d8e2ed
      jaredpar 提交于
      This change implements a new DiagnosticAnalyzer for equality which adds the following rules (VB and C#)
      
      1. If a struct overrides Object.Equals it should implement IEquatable<T>. This avoids boxing and extra type checks in many scenarios
      2. If a struct or class implements IEquatable<T> it should override Object.Equals. Without this the equality implementation is simply incomplete and will unexpectedly fail when Object.Equals
      
      There were a number of violations in the Roslyn source tree of these rules which I cleaned up as a part of this change. A couple of notes on that work
      
      - In several places Equals and GetHashCode were overridden simply to throw an exception. Rather than implement IEquatable<T> (and pay the cost of the interface JIT) I just suppressed the analysis
      - Hash utility class cannot be used from RoslynTaoActions because it comes from 2 different referenced DLLs. For now I just manually implemented hashshing, can use extern aliases to solve if there is a strong desire for this
      
       (changeset 1345744)
      69d8e2ed
    • A
      C# SymbolDisplay: Do not qualify properties and events with implemented... · c234e558
      AlekseyTs 提交于
      C# SymbolDisplay: Do not qualify properties and events with implemented interface name unless they were already qualified. (changeset 1345691)
      c234e558
    • S
      Replace some empty array allocations with... · 3d2ef013
      stoub 提交于
      Replace some empty array allocations with Roslyn.Utilities.SpecializedCollections.Empty* (changeset 1345631)
      3d2ef013
    • M
      Fix for bug 1036190: Introduce context objects for Code Fixes / Code Refactoring APIs · c6217820
      manishv 提交于
      This change introduces following context objects:
      (a) CodeFixContext struct which is passed into CodeFixProvider.GetFixesAsync method and
      (b) CodeRefactoringContext struct which is passed into CodeRefactoringProvider.GetRefactoringsAsync. (changeset 1345537)
      c6217820