1. 11 10月, 2014 1 次提交
    • T
      Remove duplicate package references. · 8fef5b5d
      tmeschter 提交于
      When our projects were last updated to a newer version of Microsoft.Net.ToolsetCompilers, NuGet didn't replace the old version--it just put the new version next to it. Every project ended up referencing both versions, and which set of compiler binaries "won" depended on the order they appeared in the project file. So different projects built with different compilers.
      
      This change strips out all references to the old version. (changeset 1352054)
      8fef5b5d
  2. 10 10月, 2014 1 次提交
  3. 07 10月, 2014 2 次提交
    • 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
      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
  4. 06 10月, 2014 1 次提交
  5. 05 10月, 2014 1 次提交
    • A
      Simply the VB syntax trees for single- and multi-line Ifs and Try blocks,... · f0fd7469
      ADGreen 提交于
      Simply the VB syntax trees for single- and multi-line Ifs and Try blocks, making them consistent with the VB language spec.
      
      Now, instead of being parented by an intermediate "If Part" or "Try Part" the header statements and the body statements are directly parented by the block (similar to how we represent them in C#). (changeset 1348193)
      f0fd7469
  6. 04 10月, 2014 2 次提交
    • 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
    • M
  7. 02 10月, 2014 1 次提交
    • 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
  8. 25 9月, 2014 4 次提交
  9. 10 9月, 2014 6 次提交
  10. 15 8月, 2014 6 次提交
    • S
      Plumb additional files from MSBuild through to the MSBuildWorkspace. · b7cfa472
      srivatsn 提交于
      Projects that specify additionalfiles through the <AdditionalFileItemNames> tag should have their AdditionalDocuments property poupulated with these documents. This change plumbs that through from MSBuild to the workspace. (changeset 1317159)
      b7cfa472
    • T
      Replaces CompilationOptions.Optimize and... · 9fbe1432
      TomasMatousek 提交于
      Replaces CompilationOptions.Optimize and CompilationOptions.DebugInformationKind with a single enum OptimizationLevel that has two values: Release and Debug.
      Removes dependency in IL generation on whether PDB stream is passed to Emit or not. IL shall only differ between Release and Debug.
      
      Command line arguments /optimize, /debug and /pdb remain the same, their values map to either Release or Debug. The value of /optimize is mapped to Release or Debug. /debug+, /debug:full and /debug:pdbonly have all the same effect - enable generating PDB file. They don't influence the generated IL.
      
      Debug information/instrumentation (sequence points, dead stores, nops, etc.) doesn't need to be emitted for synthesized methods that don't contain user code (property GenerateDebugInfo on a symbol returns true).
      
      During lowering always create bound sequence nodes. In some scenarios (PDB stream is not passed, we are emitting helper that contains no user code) these nodes are not used. However, in mainstream scenarios we always emit PDBs, so optimizing the bound nodes away is optimizing for uncommon case and just increases test matrix. Lambda, iterator and async lowering have to handle presence of bound sequence point nodes. We get more test coverage if they are always present.
      
      Another reason why to always create bound sequence points is to avoid complexity and ambiguity when checking if a symbol needs debug information. Some symbols might need debug information during some lowering phases but not other. For example, the generated body of a method symbol that represents an async kick-off method doesn't need debug information since it doesn't contain any user code. However, all source code contained in an async method should have debug information emitted. Bound tree for such code is lowered in the context of the async method symbol, so the value of GenerateDebugInfo for the async method symbol would need to differ depending on which phase of compilation are we in.
      
      Finally, IL body deduplication can always be enabled (in Release and Debug), even in EnC scenarios. Removing another compiler knob further simplifies testing.
       (changeset 1316430)
      9fbe1432
    • H
      small cleanup on ILogger · 8102a73c
      heejaechang 提交于
      re-ordered a parameter and added LogMessage to LogBlockEnd. (changeset 1312594)
      8102a73c
    • H
      refactored Logger to support chaining better · bea307bf
      heejaechang 提交于
      now we have AggregateLogger that we can combine multiple logger together more cleanly. (changeset 1312345)
      bea307bf
    • H
      Removed FeatureId · 2af57996
      heejaechang 提交于
      our Logger used to get both FeatureId and FunctionId. FeatureId used to be used to control a group of functionId.
      
      now, I am flattening them so that we can group functionId by its name rather than using both FeatureId and FunctionId. (changeset 1311395)
      2af57996
    • K
      Removing skipped test (changeset 1311108) · 45b1264f
      kayleh 提交于
      45b1264f
  11. 05 8月, 2014 1 次提交
    • K
      Moving NuGet.targets import to be last. · 9bf4a3b3
      kayleh 提交于
      MSBuild unconditionally overwrites the value of BuildDependsOn in Microsoft.Common.CurrentVersion.targets:
        <PropertyGroup>
          <BuildDependsOn>
            BeforeBuild;
            CoreBuild;
            AfterBuild
          </BuildDependsOn>
        </PropertyGroup>
      
      So NuGet.targets needs to be included after Microsoft.Common.CurrentVersion.targets.  Otherwise, the RestorePackages build target won't run.
      
       (changeset 1311037)
      9bf4a3b3
  12. 02 8月, 2014 1 次提交
  13. 30 7月, 2014 1 次提交
    • S
      The changes needed to MSBuild to plumb through the additional files introduces... · a9ffcd1b
      srivatsn 提交于
      The changes needed to MSBuild to plumb through the additional files introduces a new method to the IAnalyzerHostObject interface in MSBuild. We implement that interface on the Roslyn side for our MSBuildWorkspace scenarios. I can only implement the new interface method after we update the base drop to include this method. I'm removing the interface implementation from Roslyn - this means that analyzers won't be understood from project files in MSBuildWorkspace scenarios but VS and command line builds will work fine. Once we update the base drop, I'll reenable this. (changeset 1307743)
      a9ffcd1b
  14. 24 7月, 2014 1 次提交
    • S
      The additional files that are passed in by the compilers\project system for... · 36095e3a
      srivatsn 提交于
      The additional files that are passed in by the compilers\project system for analyzers (like web.config) need to be represented in the workspace. We are representing them as documents so that codefixers can simply alter the document to change them.
      
      This change introudces a type called TextDocument, which is now a base type of Document and has only the functionality for dealing with text. The project will have a list of these additionaldocuments separate from documents and these two don't mix anywhere. So if an extension got hold of the textdocument, they cannot do anything more than ask for text. This makes it a conceptually additive change. Anyone who doesn't care about additional documents don't have to know about it at all. They still deal with Document and do everything the same as they did before. The analyzers can get hold of these additional documents and change them if they wish through codefixes and apply changes knows to deal with them.
       (changeset 1304743)
      36095e3a
  15. 18 7月, 2014 1 次提交
  16. 12 7月, 2014 3 次提交
    • D
      Automatic text-based merging of divergent edits made to linked files during... · abf56b54
      dpoeschl 提交于
      Automatic text-based merging of divergent edits made to linked files during Workspace.TryApplyChanges.
      
      Changes that are easily merged because they are identical or isolated (a change span that overlaps no other change spans in any linked document) are simply updated to reflect the new text. In the case of isolated changes, - we assume that the change happened in a #if region and it is therefore safe to apply the change.
      
      Once these straightforward changes are applied, the remaining changes which cannot be easily merged because they conflict with another edit are added to the final text in a commented form. If we start with a reference to a class C but a refactoring fully qualifies it as "A.B.C" in one linked document but as "B.C" in another, the following comment is emitted into source:
      
      /* Unmerged change from project 'ProjectName'
      Before:
      C
      After:
      B.C
      */
      A.B.C
      
      This change also prevents the Preview Changes dialog from showing multiple copies of linked documents. (changeset 1295841)
      abf56b54
    • T
      To support EnC well the compiler needs to carefully distinguish between... · d4b0a867
      TomasMatousek 提交于
      To support EnC well the compiler needs to carefully distinguish between long-lived and short-lived synthesized variables. Long-lived variables may cross sequence points and thus need to be mapped the the corresponding variables in the previous generation when emitting EnC deltas. Short-lived local variables shall never cross sequence points.
      
      This change revisits helpers that create synthesized variables and assigns each synthesized variable a SynthesizedLocalKind. Negative kind values are reserved for short-lived variables, positive values for long-lived variables.
      
      The change removed the option to give a synthesized variable an explicit name. The names of the variables are assigned at code-gen time based on their SynthesizedLocalKind. This is to enforce that the names of long-lived variables follow a naming pattern that allows use to reverse-engineer the SynthesizedLocalKind value from the variable name.
      
      Also renames DebugInformationKind.PDBOnly to DebugInformationKind.PdbOnly to follow .NET naming guidelines.
       (changeset 1293017)
      d4b0a867
    • M
      Add code to MSBuildWorkspace to convert metadata references into project... · e18001b0
      mattwar 提交于
      Add code to MSBuildWorkspace to convert metadata references into project references if the metadata reference is to an assembly that matches a project's output path.  This help recover from failures to interpret project files correctly.
      
      Change CustomWorkspace.AddXXX methods to return the solution/project/document they are adding. (changeset 1289678)
      e18001b0
  17. 08 7月, 2014 1 次提交
  18. 20 6月, 2014 6 次提交
    • T
      Splits Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.CSharp and... · fc3b332f
      TomasMatousek 提交于
      Splits Microsoft.CodeAnalysis, Microsoft.CodeAnalysis.CSharp and Microsoft.CodeAnalysis.VisualBasic into portable and desktop assemblies.
      
      Existing Core\Source, CSharp\Source and VisualBasic\Source directories are renamed to Core\Portable, CSharp\Portable and VisualBasic\Portable.
      New sibling Desktop folders are added and non-portable source is moved there.
      "System.Runtime" references has to be removed in order for the portable project system magic to automatically add facade references.
       (changeset 1281686)
      fc3b332f
    • M
      Added MSBuildWorkspace.SkipUnrecognizedProjects property. · bf7f5976
      mattwar 提交于
      This property controls what happens when referenced projects are not recognized as supported project types during solution or project open. If set to false, an exception is thrown the first time an unrecognized project is encountered.  If set to false (the default) it raises an WorkspaceFailed event and continues, omitting the project from the resulting solution and leaving dangling project references.  Of course, if the project type is unrecognized but its metadata can be identified, the project reference is turned into a metadata references (as per existing behavior).
      
      Added tests for all cases of unrecognized projects; bad path, non-existing project file, unrecognized file extensions, unrecognized project type and unrecognized language.
      
      Updated HostWorkspaceServices to allow for searching for language services without forcing the language to be loaded.  Added ProjectFileExtensionAttribute and ProjectTypeGuidAttribute so ProjectFileLoader's can declare via MEF metadata information used to find them.
      
      Removed Project GUID from ProjectFileReference.  Project GUID's cannot be trusted. :-)
       (changeset 1279722)
      bf7f5976
    • A
    • T
    • T
      The current implementation was unnecessarily complicated and confusing. · 1c5188aa
      TomasMatousek 提交于
      Removes IFieldDefinition.FieldMapping that returned ISectionBlock -- the only section the writer is writing data into is .text, so it suffice to return ImmutableArray<byte> containing the data.
      Deletes ISectionBlock since it hasn't been used elsewhere.
      Reduces the amount of state stored on PEWriter. (changeset 1277226)
      1c5188aa
    • M
      Fix for bug 918072: Add support for MSBuildWorkspace to load analyzers from projects. · 1240e832
      manishv 提交于
      Add msbuild workspace support to load analyzer assemblies specified in the project file. This change is conditioned around presence of correct msbuild version referenced by workspaces projects. (changeset 1275262)
      1240e832