提交 b2d62e8e 编写于 作者: D Dustin Campbell

Merge remote-tracking branch 'origin/master' into codemodelfixes

###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
* text=auto encoding=UTF-8
###############################################################################
# Set default behavior for command prompt diff.
......
......@@ -28,7 +28,7 @@ public SymbolDeclaredCompilationEvent(Compilation compilation, ISymbol symbol, L
/// <summary>
/// Lockable object only instance is knowledgeable about.
/// <summary>
/// </summary>
private readonly object _gate = new object();
public SemanticModel SemanticModel(SyntaxReference reference)
......
......@@ -12,7 +12,7 @@
<ProjectGuid>{D835C05E-9D83-40B2-9D25-19EB652F10D7}</ProjectGuid>
<OutputType>Library</OutputType>
<AnalyzerProject>true</AnalyzerProject>
<AssemblyName>Microsoft.CodeAnalysis.VisualBasic.Analyzers</AssemblyName>
<AssemblyName>System.Runtime.VisualBasic.Analyzers</AssemblyName>
<ProjectTypeGuids>{14182A97-F7F0-4C62-8B27-98AA8AE2109A};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
......
......@@ -61,7 +61,7 @@ protected static IEnumerable<SymbolDisplayPart> GetSeparatorParts()
return new SignatureHelpParameter(
parameter.Name,
parameter.IsOptional,
parameter.GetDocumentationParts(semanticModel, position, formatter, cancellationToken),
parameter.GetDocumentationPartsFactory(semanticModel, position, formatter),
parameter.ToMinimalDisplayParts(semanticModel, position));
}
......
......@@ -135,7 +135,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
constructor, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic,
constructor.GetDocumentationParts(semanticModel, position, documentationCommentFormatter, cancellationToken),
constructor.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormatter),
GetPreambleParts(constructor, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(constructor),
......@@ -158,6 +158,8 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
for (int i = 0; i < namedParameters.Count; i++)
{
cancellationToken.ThrowIfCancellationRequested();
var namedParameter = namedParameters[i];
var type = namedParameter is IFieldSymbol ? ((IFieldSymbol)namedParameter).Type : ((IPropertySymbol)namedParameter).Type;
......@@ -175,7 +177,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
yield return new SignatureHelpParameter(
namedParameter.Name,
isOptional: true,
documentation: namedParameter.GetDocumentationParts(semanticModel, position, documentationCommentFormatter, cancellationToken),
documentationFactory: namedParameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormatter),
displayParts: displayParts,
prefixDisplayParts: GetParameterPrefixDisplayParts(i));
}
......
......@@ -135,7 +135,7 @@ public override SignatureHelpState GetCurrentArgumentState(SyntaxNode root, int
constructor, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
constructor.IsParams(),
constructor.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
constructor.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(constructor, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(constructor),
......
......@@ -200,7 +200,7 @@ private bool TryGetIndexers(int position, SemanticModel semanticModel, Expressio
var item = CreateItem(indexer, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
indexer.IsParams(),
indexer.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
indexer.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(indexer, position, semanticModel),
GetSeparatorParts(),
GetPostambleParts(indexer),
......
......@@ -183,7 +183,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
symbol, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
false,
symbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
symbol.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(namedType, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(namedType),
......@@ -196,7 +196,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
symbol, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
false,
symbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken).Concat(GetAwaitableUsage(method, semanticModel, position)),
c => symbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, c).Concat(GetAwaitableUsage(method, semanticModel, position)),
GetPreambleParts(method, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(method, semanticModel, position),
......@@ -220,7 +220,7 @@ protected virtual TextSpan GetTextSpan(SyntaxToken genericIdentifier, SyntaxToke
return new SignatureHelpParameter(
parameter.Name,
isOptional: false,
documentation: parameter.GetDocumentationParts(semanticModel, position, formatter, cancellationToken),
documentationFactory: parameter.GetDocumentationPartsFactory(semanticModel, position, formatter),
displayParts: parameter.ToMinimalDisplayParts(semanticModel, position, s_minimallyQualifiedFormat),
selectedDisplayParts: GetSelectedDisplayParts(parameter, semanticModel, position, cancellationToken));
}
......
......@@ -37,7 +37,7 @@ internal partial class InvocationExpressionSignatureHelpProvider
invokeMethod, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic: invokeMethod.IsParams(),
documentation: SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>(),
documentationFactory: null,
prefixParts: GetDelegateInvokePreambleParts(invokeMethod, semanticModel, position),
separatorParts: GetSeparatorParts(),
suffixParts: GetDelegateInvokePostambleParts(),
......@@ -62,10 +62,11 @@ private IEnumerable<SymbolDisplayPart> GetDelegateInvokePreambleParts(IMethodSym
{
foreach (var parameter in invokeMethod.Parameters)
{
cancellationToken.ThrowIfCancellationRequested();
yield return new SignatureHelpParameter(
parameter.Name,
parameter.IsOptional,
parameter.GetDocumentationParts(semanticModel, position, formattingService, cancellationToken),
parameter.GetDocumentationPartsFactory(semanticModel, position, formattingService),
parameter.ToMinimalDisplayParts(semanticModel, position));
}
}
......
......@@ -108,7 +108,7 @@ private bool IsHiddenBy(IMethodSymbol method1, IMethodSymbol method2)
method, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
method.IsParams(),
method.OriginalDefinition.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken).Concat(GetAwaitableUsage(method, semanticModel, position)),
c => method.OriginalDefinition.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, c).Concat(GetAwaitableUsage(method, semanticModel, position)),
GetMethodGroupPreambleParts(method, semanticModel, position),
GetSeparatorParts(),
GetMethodGroupPostambleParts(method),
......
......@@ -32,7 +32,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
invokeMethod, semanticModel, position,
symbolDisplayService, anonymousTypeDispalyService,
isVariadic: false,
documentation: SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>(),
documentationFactory: null,
prefixParts: GetDelegateTypePreambleParts(invokeMethod, semanticModel, position),
separatorParts: GetSeparatorParts(),
suffixParts: GetDelegateTypePostambleParts(invokeMethod),
......@@ -80,7 +80,7 @@ private IEnumerable<SignatureHelpParameter> GetDelegateTypeParameters(IMethodSym
yield return new SignatureHelpParameter(
TargetName,
isOptional: false,
documentation: SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>(),
documentationFactory: null,
displayParts: parts);
}
......
......@@ -56,7 +56,7 @@ internal partial class ObjectCreationExpressionSignatureHelpProvider
constructor, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
constructor.IsParams(),
constructor.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
constructor.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetNormalTypePreambleParts(constructor, semanticModel, position),
GetSeparatorParts(),
GetNormalTypePostambleParts(constructor),
......
......@@ -2,7 +2,9 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Roslyn.Utilities;
......@@ -16,25 +18,26 @@ internal class SignatureHelpItem
/// selected parameter index strictly goes past the number of defined parameters for this
/// item.
/// </summary>
public bool IsVariadic { get; private set; }
public bool IsVariadic { get; }
public IList<SymbolDisplayPart> PrefixDisplayParts { get; private set; }
public IList<SymbolDisplayPart> SuffixDisplayParts { get; private set; }
public ImmutableArray<SymbolDisplayPart> PrefixDisplayParts { get; }
public ImmutableArray<SymbolDisplayPart> SuffixDisplayParts { get; }
// TODO(cyrusn): This probably won't be sufficient for VB query signature help. It has
// TODO: This probably won't be sufficient for VB query signature help. It has
// arbitrary separators between parameters.
public IList<SymbolDisplayPart> SeparatorDisplayParts { get; private set; }
public ImmutableArray<SymbolDisplayPart> SeparatorDisplayParts { get; }
public IList<SignatureHelpParameter> Parameters { get; private set; }
public ImmutableArray<SignatureHelpParameter> Parameters { get; }
public IList<SymbolDisplayPart> DescriptionParts { get; internal set; }
public ImmutableArray<SymbolDisplayPart> DescriptionParts { get; internal set; }
// TODO(cyrusn): This may be unnecessary. How would a user ever see this.
public IList<SymbolDisplayPart> Documentation { get; set; }
public Func<CancellationToken, IEnumerable<SymbolDisplayPart>> DocumenationFactory { get; }
private static readonly Func<CancellationToken, IEnumerable<SymbolDisplayPart>> s_emptyDocumentationFactory = _ => SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>();
public SignatureHelpItem(
bool isVariadic,
IEnumerable<SymbolDisplayPart> documentation,
Func<CancellationToken, IEnumerable<SymbolDisplayPart>> documentationFactory,
IEnumerable<SymbolDisplayPart> prefixParts,
IEnumerable<SymbolDisplayPart> separatorParts,
IEnumerable<SymbolDisplayPart> suffixParts,
......@@ -47,7 +50,7 @@ internal class SignatureHelpItem
}
this.IsVariadic = isVariadic;
this.Documentation = documentation.ToImmutableArrayOrEmpty();
this.DocumenationFactory = documentationFactory ?? s_emptyDocumentationFactory;
this.PrefixDisplayParts = prefixParts.ToImmutableArrayOrEmpty();
this.SeparatorDisplayParts = separatorParts.ToImmutableArrayOrEmpty();
this.SuffixDisplayParts = suffixParts.ToImmutableArrayOrEmpty();
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Editor
......@@ -13,46 +14,48 @@ internal class SignatureHelpParameter
/// <summary>
/// The name of this parameter.
/// </summary>
public string Name { get; private set; }
public string Name { get; }
/// <summary>
/// Documentation for this parameter. This should normally be presented to the user when
/// this parameter is selected.
/// </summary>
public IList<SymbolDisplayPart> Documentation { get; private set; }
public Func<CancellationToken, IEnumerable<SymbolDisplayPart>> DocumentationFactory { get; }
/// <summary>
/// Display parts to show before the normal display parts for the parameter.
/// </summary>
public IList<SymbolDisplayPart> PrefixDisplayParts { get; private set; }
public IList<SymbolDisplayPart> PrefixDisplayParts { get; }
/// <summary>
/// Display parts to show after the normal display parts for the parameter.
/// </summary>
public IList<SymbolDisplayPart> SuffixDisplayParts { get; private set; }
public IList<SymbolDisplayPart> SuffixDisplayParts { get; }
/// <summary>
/// Display parts for this parameter. This should normally be presented to the user as part
/// of the entire signature display.
/// </summary>
public IList<SymbolDisplayPart> DisplayParts { get; private set; }
public IList<SymbolDisplayPart> DisplayParts { get; }
/// <summary>
/// True if this parameter is optional or not. Optional parameters may be presented in a
/// different manner to users.
/// </summary>
public bool IsOptional { get; private set; }
public bool IsOptional { get; }
/// <summary>
/// Display parts for this parameter that should be presented to the user when this
/// parameter is selected.
/// </summary>
public IList<SymbolDisplayPart> SelectedDisplayParts { get; private set; }
public IList<SymbolDisplayPart> SelectedDisplayParts { get; }
private static readonly Func<CancellationToken, IEnumerable<SymbolDisplayPart>> s_emptyDocumentationFactory = _ => SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>();
public SignatureHelpParameter(
string name,
bool isOptional,
IEnumerable<SymbolDisplayPart> documentation,
Func<CancellationToken, IEnumerable<SymbolDisplayPart>> documentationFactory,
IEnumerable<SymbolDisplayPart> displayParts,
IEnumerable<SymbolDisplayPart> prefixDisplayParts = null,
IEnumerable<SymbolDisplayPart> suffixDisplayParts = null,
......@@ -60,7 +63,7 @@ internal class SignatureHelpParameter
{
this.Name = name ?? string.Empty;
this.IsOptional = isOptional;
this.Documentation = documentation.ToImmutableArrayOrEmpty();
this.DocumentationFactory = documentationFactory ?? s_emptyDocumentationFactory;
this.DisplayParts = displayParts.ToImmutableArrayOrEmpty();
this.PrefixDisplayParts = prefixDisplayParts.ToImmutableArrayOrEmpty();
this.SuffixDisplayParts = suffixDisplayParts.ToImmutableArrayOrEmpty();
......
......@@ -2,9 +2,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp
{
......@@ -12,17 +10,17 @@ internal abstract partial class AbstractSignatureHelpProvider
{
internal class SymbolKeySignatureHelpItem : SignatureHelpItem, IEquatable<SymbolKeySignatureHelpItem>
{
public SymbolKey SymbolKey { get; private set; }
public SymbolKey SymbolKey { get; }
public SymbolKeySignatureHelpItem(
ISymbol symbol,
bool isVariadic,
IEnumerable<SymbolDisplayPart> documentation,
Func<CancellationToken, IEnumerable<SymbolDisplayPart>> documentationFactory,
IEnumerable<SymbolDisplayPart> prefixParts,
IEnumerable<SymbolDisplayPart> separatorParts,
IEnumerable<SymbolDisplayPart> suffixParts,
IEnumerable<SignatureHelpParameter> parameters,
IEnumerable<SymbolDisplayPart> descriptionParts) : base(isVariadic, documentation, prefixParts, separatorParts, suffixParts, parameters, descriptionParts)
IEnumerable<SymbolDisplayPart> descriptionParts) : base(isVariadic, documentationFactory, prefixParts, separatorParts, suffixParts, parameters, descriptionParts)
{
this.SymbolKey = symbol == null ? null : symbol.GetSymbolKey();
}
......
......@@ -75,7 +75,7 @@ public async Task<SignatureHelpState> GetCurrentArgumentStateAsync(Document docu
ISymbolDisplayService symbolDisplayService,
IAnonymousTypeDisplayService anonymousTypeDisplayService,
bool isVariadic,
IEnumerable<SymbolDisplayPart> documentation,
Func<CancellationToken, IEnumerable<SymbolDisplayPart>> documentationFactory,
IEnumerable<SymbolDisplayPart> prefixParts,
IEnumerable<SymbolDisplayPart> separatorParts,
IEnumerable<SymbolDisplayPart> suffixParts,
......@@ -83,7 +83,7 @@ public async Task<SignatureHelpState> GetCurrentArgumentStateAsync(Document docu
IEnumerable<SymbolDisplayPart> descriptionParts = null)
{
var item = new SymbolKeySignatureHelpItem(
orderSymbol, isVariadic, documentation, prefixParts, separatorParts,
orderSymbol, isVariadic, documentationFactory, prefixParts, separatorParts,
suffixParts, parameters, descriptionParts);
return FixAnonymousTypeParts(orderSymbol, item, semanticModel, position, symbolDisplayService, anonymousTypeDisplayService);
......@@ -93,7 +93,7 @@ public async Task<SignatureHelpState> GetCurrentArgumentStateAsync(Document docu
ISymbol orderSymbol, SignatureHelpItem item, SemanticModel semanticModel, int position, ISymbolDisplayService symbolDisplayService, IAnonymousTypeDisplayService anonymousTypeDisplayService)
{
var currentItem = new SymbolKeySignatureHelpItem(
orderSymbol, item.IsVariadic, item.Documentation,
orderSymbol, item.IsVariadic, item.DocumenationFactory,
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(item.PrefixDisplayParts, semanticModel, position, symbolDisplayService),
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(item.SeparatorDisplayParts, semanticModel, position, symbolDisplayService),
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(item.SuffixDisplayParts, semanticModel, position, symbolDisplayService),
......@@ -120,7 +120,7 @@ where part.Symbol.IsNormalAnonymousType()
currentItem = new SymbolKeySignatureHelpItem(
orderSymbol,
currentItem.IsVariadic,
currentItem.Documentation,
currentItem.DocumenationFactory,
info.ReplaceAnonymousTypes(currentItem.PrefixDisplayParts),
info.ReplaceAnonymousTypes(currentItem.SeparatorDisplayParts),
info.ReplaceAnonymousTypes(currentItem.SuffixDisplayParts),
......@@ -138,7 +138,7 @@ where part.Symbol.IsNormalAnonymousType()
return new SignatureHelpParameter(
parameter.Name,
parameter.IsOptional,
parameter.Documentation,
parameter.DocumentationFactory,
info.ReplaceAnonymousTypes(parameter.DisplayParts),
info.ReplaceAnonymousTypes(parameter.SelectedDisplayParts));
}
......@@ -153,7 +153,7 @@ where part.Symbol.IsNormalAnonymousType()
return new SignatureHelpParameter(
parameter.Name,
parameter.IsOptional,
parameter.Documentation,
parameter.DocumentationFactory,
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(parameter.DisplayParts, semanticModel, position, symbolDisplayService),
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(parameter.PrefixDisplayParts, semanticModel, position, symbolDisplayService),
anonymousTypeDisplayService.InlineDelegateAnonymousTypes(parameter.SuffixDisplayParts, semanticModel, position, symbolDisplayService),
......@@ -256,7 +256,7 @@ private SignatureHelpItem UpdateItem(SignatureHelpItem item, SupportedPlatformDa
? item.DescriptionParts.Concat(startingNewLine.Concat(platformParts))
: startingNewLine.Concat(platformParts);
item.DescriptionParts = updatedDescription.ToList();
item.DescriptionParts = updatedDescription.ToImmutableArrayOrEmpty();
return item;
}
......
......@@ -95,7 +95,7 @@ private static int GetSelectedParameter(SignatureHelpItem bestItem, int paramete
// If we don't have an item that can take that number of parameters, then just pick
// the last item. Or stick with the current item if the last item isn't any better.
var lastItem = filteredItems.Last();
if (currentItem.IsVariadic || currentItem.Parameters.Count == lastItem.Parameters.Count)
if (currentItem.IsVariadic || currentItem.Parameters.Length == lastItem.Parameters.Length)
{
return currentItem;
}
......@@ -117,7 +117,7 @@ private static bool IsApplicable(SignatureHelpItem item, int argumentCount, stri
// parameter index. i.e. if it has 2 parameters and we're at index 0 or 1 then it's
// applicable. However, if it has 2 parameters and we're at index 2, then it's not
// applicable.
if (item.Parameters.Count >= argumentCount)
if (item.Parameters.Length >= argumentCount)
{
return true;
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
......@@ -8,11 +9,17 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHel
{
internal class Parameter : IParameter
{
public string Documentation { get; internal set; }
public string Name { get; internal set; }
public Span Locus { get; internal set; }
public Span PrettyPrintedLocus { get; internal set; }
public ISignature Signature { get; internal set; }
private readonly SignatureHelpParameter _parameter;
private string _documentation;
private readonly int _contentLength;
private readonly int _index;
private readonly int _prettyPrintedIndex;
public string Documentation => _documentation ?? (_documentation = _parameter.DocumentationFactory(CancellationToken.None).GetFullText());
public string Name => _parameter.Name;
public Span Locus => new Span(_index, _contentLength);
public Span PrettyPrintedLocus => new Span(_prettyPrintedIndex, _contentLength);
public ISignature Signature { get; }
public Parameter(
Signature signature,
......@@ -21,12 +28,11 @@ internal class Parameter : IParameter
int index,
int prettyPrintedIndex)
{
_parameter = parameter;
this.Signature = signature;
this.Name = parameter.Name;
this.Documentation = parameter.Documentation.GetFullText();
this.Locus = new Span(index, content.Length);
this.PrettyPrintedLocus = new Span(prettyPrintedIndex, content.Length);
_contentLength = content.Length;
_index = index;
_prettyPrintedIndex = prettyPrintedIndex;
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
......@@ -8,6 +9,7 @@
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Roslyn.Utilities;
using System.Threading;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Presentation
{
......@@ -16,26 +18,91 @@ internal class Signature : ISignature
private const int MaxParamColumnCount = 100;
private readonly SignatureHelpItem _signatureHelpItem;
private IParameter _currentParameter;
internal IList<SymbolDisplayPart> DisplayParts { get; private set; }
private IList<SymbolDisplayPart> _prettyPrintedDisplayParts;
public ITrackingSpan ApplicableToSpan { get; internal set; }
public string Content { get; private set; }
public string PrettyPrintedContent { get; private set; }
public ReadOnlyCollection<IParameter> Parameters { get; private set; }
public string Documentation { get; private set; }
public event EventHandler<CurrentParameterChangedEventArgs> CurrentParameterChanged;
public Signature(ITrackingSpan applicableToSpan, SignatureHelpItem signatureHelpItem)
public Signature(ITrackingSpan applicableToSpan, SignatureHelpItem signatureHelpItem, int selectedParameterIndex)
{
if (selectedParameterIndex < -1 || selectedParameterIndex >= signatureHelpItem.Parameters.Length)
{
throw new ArgumentOutOfRangeException(nameof(selectedParameterIndex));
}
this.ApplicableToSpan = applicableToSpan;
_signatureHelpItem = signatureHelpItem;
this.Initialize(setParameters: true);
_parameterIndex = selectedParameterIndex;
}
private bool _isInitialized;
private void EnsureInitialized()
{
if (!_isInitialized)
{
_isInitialized = true;
Initialize();
}
}
private Signature InitializedThis
{
get
{
EnsureInitialized();
return this;
}
}
private IList<SymbolDisplayPart> _displayParts;
internal IList<SymbolDisplayPart> DisplayParts => InitializedThis._displayParts;
public ITrackingSpan ApplicableToSpan { get; }
private string _content;
public string Content => InitializedThis._content;
private int _parameterIndex = -1;
public IParameter CurrentParameter
{
get
{
EnsureInitialized();
return _parameterIndex >= 0 && _parameters != null ? _parameters[_parameterIndex] : null;
}
}
private void Initialize(bool setParameters)
public string Documentation => null;
private ReadOnlyCollection<IParameter> _parameters;
public ReadOnlyCollection<IParameter> Parameters => InitializedThis._parameters;
private string _prettyPrintedContent;
public string PrettyPrintedContent => InitializedThis._prettyPrintedContent;
// This event is required by the ISignature interface but it's not actually used
// (once created the CurrentParameter property cannot change)
public event EventHandler<CurrentParameterChangedEventArgs> CurrentParameterChanged
{
add
{
}
remove
{
}
}
private IList<SymbolDisplayPart> _prettyPrintedDisplayParts;
internal IList<SymbolDisplayPart> PrettyPrintedDisplayParts
{
get
{
return InitializedThis._prettyPrintedDisplayParts;
}
set
{
_prettyPrintedDisplayParts = value;
}
}
private void Initialize()
{
var content = new StringBuilder();
var prettyPrintedContent = new StringBuilder();
......@@ -61,7 +128,7 @@ private void Initialize(bool setParameters)
var paramColumnCount = 0;
for (int i = 0; i < _signatureHelpItem.Parameters.Count; i++)
for (int i = 0; i < _signatureHelpItem.Parameters.Length; i++)
{
var sigHelpParameter = _signatureHelpItem.Parameters[i];
......@@ -107,9 +174,9 @@ private void Initialize(bool setParameters)
AddRange(_signatureHelpItem.SuffixDisplayParts, parts, prettyPrintedParts);
Append(_signatureHelpItem.SuffixDisplayParts.GetFullText(), content, prettyPrintedContent);
if (_currentParameter != null)
if (_parameterIndex >= 0)
{
var sigHelpParameter = _signatureHelpItem.Parameters[this.Parameters.IndexOf(_currentParameter)];
var sigHelpParameter = _signatureHelpItem.Parameters[_parameterIndex];
AddRange(sigHelpParameter.SelectedDisplayParts, parts, prettyPrintedParts);
Append(sigHelpParameter.SelectedDisplayParts.GetFullText(), content, prettyPrintedContent);
......@@ -118,24 +185,21 @@ private void Initialize(bool setParameters)
AddRange(_signatureHelpItem.DescriptionParts, parts, prettyPrintedParts);
Append(_signatureHelpItem.DescriptionParts.GetFullText(), content, prettyPrintedContent);
if (_signatureHelpItem.Documentation.Count > 0)
var documentation = _signatureHelpItem.DocumenationFactory(CancellationToken.None).ToList();
if (documentation.Count > 0)
{
AddRange(new[] { newLinePart }, parts, prettyPrintedParts);
Append(newLineContent, content, prettyPrintedContent);
AddRange(_signatureHelpItem.Documentation, parts, prettyPrintedParts);
Append(_signatureHelpItem.Documentation.GetFullText(), content, prettyPrintedContent);
AddRange(documentation, parts, prettyPrintedParts);
Append(documentation.GetFullText(), content, prettyPrintedContent);
}
this.Content = content.ToString();
this.PrettyPrintedContent = prettyPrintedContent.ToString();
this.DisplayParts = parts.ToImmutableArrayOrEmpty();
this.PrettyPrintedDisplayParts = prettyPrintedParts.ToImmutableArrayOrEmpty();
if (setParameters)
{
this.Parameters = parameters.ToReadOnlyCollection();
}
_content = content.ToString();
_prettyPrintedContent = prettyPrintedContent.ToString();
_displayParts = parts.ToImmutableArrayOrEmpty();
_prettyPrintedDisplayParts = prettyPrintedParts.ToImmutableArrayOrEmpty();
_parameters = parameters.ToReadOnlyCollection();
}
private void AddRange(IList<SymbolDisplayPart> values, List<SymbolDisplayPart> parts, List<SymbolDisplayPart> prettyPrintedParts)
......@@ -163,45 +227,5 @@ private IList<SymbolDisplayPart> AddOptionalBrackets(bool isOptional, IList<Symb
return list;
}
public IParameter CurrentParameter
{
get
{
return _currentParameter;
}
set
{
if (value == _currentParameter)
{
return;
}
var oldValue = _currentParameter;
_currentParameter = value;
Initialize(setParameters: false);
var currentParameterChanged = this.CurrentParameterChanged;
if (currentParameterChanged != null)
{
currentParameterChanged(this, new CurrentParameterChangedEventArgs(oldValue, value));
}
}
}
internal IList<SymbolDisplayPart> PrettyPrintedDisplayParts
{
get
{
return _prettyPrintedDisplayParts;
}
set
{
_prettyPrintedDisplayParts = value;
}
}
}
}
......@@ -116,45 +116,30 @@ private class SignatureHelpPresenterSession : ForegroundThreadAffinitizedObject,
foreach (var item in _signatureHelpItems)
{
_signatureMap = _signatureMap.Add(item, new Signature(triggerSpan, item));
}
this.SetCurrentParameterForAllItems(selectedParameter);
}
private void SetCurrentParameterForAllItems(int? selectedParameter)
{
foreach (var item in _signatureHelpItems)
{
this.SetCurrentParameter(item, selectedParameter);
_signatureMap = _signatureMap.Add(item, new Signature(triggerSpan, item, GetParameterIndexForItem(item, selectedParameter)));
}
}
private void SetCurrentParameter(SignatureHelpItem item, int? selectedParameter)
private static int GetParameterIndexForItem(SignatureHelpItem item, int? selectedParameter)
{
Contract.ThrowIfFalse(_signatureMap.ContainsKey(item));
var signature = _signatureMap.GetValueOrDefault(item);
if (selectedParameter.HasValue)
{
if (selectedParameter.Value < item.Parameters.Count)
if (selectedParameter.Value < item.Parameters.Length)
{
// If the selected parameter is within the range of parameters of this item then set
// that as the current parameter.
signature.CurrentParameter = signature.Parameters[selectedParameter.Value];
return;
return selectedParameter.Value;
}
else if (item.IsVariadic)
{
// It wasn't in range, but the item takes an unlmiited number of parameters. So
// It wasn't in range, but the item takes an unlimited number of parameters. So
// just set current parameter to the last parameter (the variadic one).
signature.CurrentParameter = signature.Parameters.Last();
return;
return item.Parameters.Length - 1;
}
}
// It was out of bounds, there is no current parameter now.
signature.CurrentParameter = null;
return -1;
}
private void OnEditorSessionDismissed()
......
......@@ -200,15 +200,17 @@ private void VerifyCurrentParameterNameWorker(string markup, string expectedPara
int cursorPosition,
TextSpan applicableSpan)
{
var signature = new Signature(applicableToSpan: null, signatureHelpItem: actualSignatureHelpItem);
int currentParameterIndex = -1;
if (expectedTestItem.CurrentParameterIndex != null)
{
if (expectedTestItem.CurrentParameterIndex.Value >= 0 && expectedTestItem.CurrentParameterIndex.Value < signature.Parameters.Count)
if (expectedTestItem.CurrentParameterIndex.Value >= 0 && expectedTestItem.CurrentParameterIndex.Value < actualSignatureHelpItem.Parameters.Length)
{
signature.CurrentParameter = signature.Parameters[expectedTestItem.CurrentParameterIndex.Value];
currentParameterIndex = expectedTestItem.CurrentParameterIndex.Value;
}
}
var signature = new Signature(applicableToSpan: null, signatureHelpItem: actualSignatureHelpItem, selectedParameterIndex: currentParameterIndex);
// We're a match if the signature matches...
// We're now combining the signature and documentation to make classification work.
if (!string.IsNullOrEmpty(expectedTestItem.MethodDocumentation))
......@@ -227,7 +229,7 @@ private void VerifyCurrentParameterNameWorker(string markup, string expectedPara
if (expectedTestItem.MethodDocumentation != null)
{
Assert.Equal(expectedTestItem.MethodDocumentation, actualSignatureHelpItem.Documentation.GetFullText());
Assert.Equal(expectedTestItem.MethodDocumentation, actualSignatureHelpItem.DocumenationFactory(CancellationToken.None).GetFullText());
}
if (expectedTestItem.ParameterDocumentation != null)
......
......@@ -205,7 +205,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
End Function
Private Shared Function CreateItems(count As Integer) As IList(Of SignatureHelpItem)
Return Enumerable.Range(0, count).Select(Function(i) New SignatureHelpItem(isVariadic:=False, documentation:={}, prefixParts:={}, separatorParts:={}, suffixParts:={}, parameters:={}, descriptionParts:={})).ToList()
Return Enumerable.Range(0, count).Select(Function(i) New SignatureHelpItem(isVariadic:=False, documentationFactory:=Nothing, prefixParts:={}, separatorParts:={}, suffixParts:={}, parameters:={}, descriptionParts:={})).ToList()
End Function
Friend Class MockSignatureHelpProvider
......
......@@ -2,6 +2,7 @@
Imports System.ComponentModel.Composition.Hosting
Imports System.ComponentModel.Composition.Primitives
Imports System.Threading
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Completion
Imports Microsoft.CodeAnalysis.Completion.Providers
......@@ -388,7 +389,7 @@ Namespace Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
End If
If documentation IsNot Nothing Then
Assert.Equal(documentation, Me.CurrentSignatureHelpPresenterSession.SelectedItem.Documentation.GetFullText())
Assert.Equal(documentation, Me.CurrentSignatureHelpPresenterSession.SelectedItem.DocumenationFactory(CancellationToken.None).GetFullText())
End If
If selectedParameter IsNot Nothing Then
......
......@@ -55,11 +55,12 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Dim parameters As New List(Of SignatureHelpParameter)
For i = 0 To documentation.ParameterCount - 1
Dim capturedIndex = i
parameters.Add(
New SignatureHelpParameter(
name:=documentation.GetParameterName(i),
isOptional:=False,
documentation:=documentation.GetParameterDocumentation(i).ToSymbolDisplayParts(),
documentationFactory:=Function(c As CancellationToken) documentation.GetParameterDocumentation(capturedIndex).ToSymbolDisplayParts(),
displayParts:=documentation.GetParameterDisplayParts(i)))
Next
......@@ -72,7 +73,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Nothing, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic:=False,
documentation:=SpecializedCollections.SingletonEnumerable(New SymbolDisplayPart(SymbolDisplayPartKind.Text, Nothing, documentation.DocumentationText)),
documentationFactory:=Function(c As CancellationToken) SpecializedCollections.SingletonEnumerable(New SymbolDisplayPart(SymbolDisplayPartKind.Text, Nothing, documentation.DocumentationText)),
prefixParts:=documentation.PrefixParts,
separatorParts:=GetSeparatorParts(),
suffixParts:=suffixParts,
......
......@@ -44,7 +44,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Return New SignatureHelpParameter(
parameter.Name,
parameter.IsOptional,
parameter.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
parameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
parameter.ToMinimalDisplayParts(semanticModel, position))
End Function
......
......@@ -113,7 +113,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
constructor, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic,
constructor.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
constructor.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(constructor, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(constructor),
......@@ -151,7 +151,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
result.Add(New SignatureHelpParameter(
namedParameter.Name,
isOptional:=True,
documentation:=namedParameter.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
documentationFactory:=namedParameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
displayParts:=displayParts,
prefixDisplayParts:=GetParameterPrefixDisplayParts(i)))
Next
......
......@@ -96,7 +96,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
method, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
False,
method.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
method.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(method, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(method, semanticModel, position),
......@@ -154,7 +154,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Dim sigHelpParameter = New SignatureHelpParameter(
"<expression>",
parameter.IsOptional,
parameter.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
parameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
parts)
Return SpecializedCollections.SingletonEnumerable(sigHelpParameter)
......
......@@ -117,7 +117,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
symbol, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
False,
symbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
symbol.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(namedType, semanticModel, position), GetSeparatorParts(), GetPostambleParts(namedType), namedType.TypeParameters.[Select](Function(p) Convert(p, semanticModel, position, documentationCommentFormattingService, cancellationToken)))
Else
Dim method = DirectCast(symbol, IMethodSymbol)
......@@ -125,7 +125,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
symbol, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
False,
symbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
symbol.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(method, semanticModel, position), GetSeparatorParts(), GetPostambleParts(method, semanticModel, position), method.TypeParameters.[Select](Function(p) Convert(p, semanticModel, position, documentationCommentFormattingService, cancellationToken)))
End If
......@@ -142,7 +142,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Return New SignatureHelpParameter(
parameter.Name,
isOptional:=False,
documentation:=parameter.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
documentationFactory:=parameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
displayParts:=parts)
End Function
......
......@@ -28,7 +28,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
invokeMethod, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic:=invokeMethod.IsParams(),
documentation:=SpecializedCollections.EmptyEnumerable(Of SymbolDisplayPart)(),
documentationFactory:=Nothing,
prefixParts:=GetDelegateInvokePreambleParts(invokeMethod, semanticModel, position),
separatorParts:=GetSeparatorParts(),
suffixParts:=GetDelegateInvokePostambleParts(invokeMethod, semanticModel, position),
......@@ -52,10 +52,11 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Private Function GetDelegateInvokeParameters(invokeMethod As IMethodSymbol, semanticModel As SemanticModel, position As Integer, documentationCommentoFormattingService As IDocumentationCommentFormattingService, cancellationToken As CancellationToken) As IEnumerable(Of SignatureHelpParameter)
Dim parameters = New List(Of SignatureHelpParameter)
For Each parameter In invokeMethod.Parameters
cancellationToken.ThrowIfCancellationRequested()
parameters.Add(New SignatureHelpParameter(
parameter.Name,
isOptional:=False,
documentation:=parameter.GetDocumentationParts(semanticModel, position, documentationCommentoFormattingService, cancellationToken),
documentationFactory:=parameter.GetDocumentationPartsFactory(semanticModel, position, documentationCommentoFormattingService),
displayParts:=parameter.ToMinimalDisplayParts(semanticModel, position)))
Next
......
......@@ -44,7 +44,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
indexer, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
indexer.IsParams(),
indexer.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
indexer.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetIndexerPreambleParts(indexer, semanticModel, position),
GetSeparatorParts(),
GetIndexerPostambleParts(indexer, semanticModel, position),
......
......@@ -55,7 +55,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
member, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
member.IsParams(),
member.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken).Concat(GetAwaitableDescription(member, semanticModel, position)),
Function(c) member.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, c).Concat(GetAwaitableDescription(member, semanticModel, position)),
GetMemberGroupPreambleParts(member, semanticModel, position),
GetSeparatorParts(),
GetMemberGroupPostambleParts(member, semanticModel, position),
......
......@@ -28,7 +28,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
invokeMethod, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
isVariadic:=False,
documentation:=invokeMethod.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
documentationFactory:=invokeMethod.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
prefixParts:=GetDelegateTypePreambleParts(invokeMethod, semanticModel, position), separatorParts:=GetSeparatorParts(), suffixParts:=GetDelegateTypePostambleParts(invokeMethod), parameters:=GetDelegateTypeParameters(invokeMethod, semanticModel, position, cancellationToken))
Return SpecializedCollections.SingletonEnumerable(item)
End Function
......@@ -77,7 +77,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
Return {New SignatureHelpParameter(
TargetName,
isOptional:=False,
documentation:=String.Empty.ToSymbolDisplayParts(),
documentationFactory:=Nothing,
displayParts:=parts)}
End Function
......
......@@ -40,7 +40,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
constructor, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
constructor.IsParams(),
constructor.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
constructor.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetNormalTypePreambleParts(constructor, semanticModel, position), GetSeparatorParts(), GetNormalTypePostambleParts(constructor), constructor.Parameters.[Select](Function(p) Convert(p, semanticModel, position, documentationCommentFormattingService, cancellationToken)))
Return item
End Function
......
......@@ -109,7 +109,7 @@ Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.SignatureHelp
eventSymbol, semanticModel, position,
symbolDisplayService, anonymousTypeDisplayService,
False,
eventSymbol.GetDocumentationParts(semanticModel, position, documentationCommentFormattingService, cancellationToken),
eventSymbol.GetDocumentationPartsFactory(semanticModel, position, documentationCommentFormattingService),
GetPreambleParts(eventSymbol, semanticModel, position),
GetSeparatorParts(),
GetPostambleParts(eventSymbol, semanticModel, position),
......
......@@ -45,7 +45,7 @@
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x02730000
// Image base: 0x04D70000
// =============== CLASS MEMBERS DECLARATION ===================
......@@ -44,7 +44,7 @@
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x01330000
// Image base: 0x008F0000
// =============== CLASS MEMBERS DECLARATION ===================
......
......@@ -27,14 +27,14 @@
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<TargetVsixContainerName>ExpressionEvaluatorPackage.vsix</TargetVsixContainerName>
<SolutionDir Condition="'$(SolutionDir)' == '' OR '$(SolutionDir)' == '*Undefined*'">..\..\..\</SolutionDir>
<!-- Don't transitively copy output files, since everything builds to the same folder. -->
<UseCommonOutputDirectory>True</UseCommonOutputDirectory>
<RestorePackages>true</RestorePackages>
<!-- Don't transitively copy output files, since everything builds to the same folder. -->
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\VisualStudio\Components\VisualStudioComponents.csproj">
<ProjectReference Include="..\..\VisualStudio\Setup\VisualStudioSetup.csproj">
<Project>{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}</Project>
<Name>VisualStudioComponents</Name>
<Name>VisualStudioSetup</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<Private>False</Private>
</ProjectReference>
......
......@@ -12,7 +12,7 @@
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.VSWinExpress" />
</Installation>
<Dependencies>
<Dependency Version="|VisualStudioComponents;GetBuildVersion|" DisplayName="Roslyn Components" Id="0b5e8ddb-f12d-4131-a71d-77acc26a798f" />
<Dependency Version="|VisualStudioSetup;GetBuildVersion|" DisplayName="Roslyn Language Services" Id="0b5e8ddb-f12d-4131-a71d-77acc26a798f" />
</Dependencies>
<Assets>
<Asset Type="DebuggerEngineExtension" d:Source="Project" d:ProjectName="BasicExpressionCompiler" Path="|BasicExpressionCompiler;VsdConfigOutputGroup|" />
......@@ -20,4 +20,4 @@
<Asset Type="DebuggerEngineExtension" d:Source="Project" d:ProjectName="CSharpExpressionCompiler" Path="|CSharpExpressionCompiler;VsdConfigOutputGroup|" />
<Asset Type="DebuggerEngineExtension" d:Source="Project" d:ProjectName="CSharpResultProvider" Path="|CSharpResultProvider;VsdConfigOutputGroup|" />
</Assets>
</PackageManifest>
\ No newline at end of file
</PackageManifest>
......@@ -121,7 +121,14 @@ public override bool IsTriggerCharacter(SourceText text, int characterPosition,
private INamedTypeSymbol GetCompletionListType(ITypeSymbol type, INamedTypeSymbol within, Compilation compilation)
{
var documentation = type.GetDocumentationComment();
// PERF: Avoid parsing XML unless the text contains the word "completionlist".
string xmlText = type.GetDocumentationCommentXml();
if (xmlText == null || !xmlText.Contains(DocumentationCommentXmlNames.CompletionListElementName))
{
return null;
}
var documentation = Shared.Utilities.DocumentationComment.FromXmlFragment(xmlText);
var completionListType = documentation.CompletionListCref != null
? DocumentationCommentId.GetSymbolsForDeclarationId(documentation.CompletionListCref, compilation).OfType<INamedTypeSymbol>().FirstOrDefault()
......
......@@ -78,6 +78,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.SolutionExplorer" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Telemetry" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
<InternalsVisibleTo Include="Roslyn.CSharp.InteractiveEditorFeatures" />
<InternalsVisibleTo Include="Roslyn.InteractiveEditorFeatures" />
......@@ -545,4 +546,4 @@
<Import Project="..\..\..\build\VSL.Imports.Closed.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
......@@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Threading;
using Microsoft.CodeAnalysis.DocumentationCommentFormatting;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Shared.Extensions
......@@ -170,8 +169,6 @@ public static Glyph GetGlyph(this ISymbol symbol)
public static IEnumerable<SymbolDisplayPart> GetDocumentationParts(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter, CancellationToken cancellationToken)
{
var globalNamespace = semanticModel.Compilation.GlobalNamespace;
var documentation = symbol.TypeSwitch(
(IParameterSymbol parameter) => parameter.ContainingSymbol.OriginalDefinition.GetDocumentationComment(cancellationToken: cancellationToken).GetParameterText(symbol.Name),
(ITypeParameterSymbol typeParam) => typeParam.ContainingSymbol.GetDocumentationComment(cancellationToken: cancellationToken).GetTypeParameterText(symbol.Name),
......@@ -179,12 +176,14 @@ public static IEnumerable<SymbolDisplayPart> GetDocumentationParts(this ISymbol
(IAliasSymbol alias) => alias.Target.GetDocumentationComment(cancellationToken: cancellationToken).SummaryText,
_ => symbol.GetDocumentationComment(cancellationToken: cancellationToken).SummaryText);
if (documentation != null)
{
return formatter.Format(documentation, semanticModel, position, CrefFormat);
}
return documentation != null
? formatter.Format(documentation, semanticModel, position, CrefFormat)
: SpecializedCollections.EmptyEnumerable<SymbolDisplayPart>();
}
return SpecializedCollections.EmptyList<SymbolDisplayPart>();
public static Func<CancellationToken, IEnumerable<SymbolDisplayPart>> GetDocumentationPartsFactory(this ISymbol symbol, SemanticModel semanticModel, int position, IDocumentationCommentFormattingService formatter)
{
return c => symbol.GetDocumentationParts(semanticModel, position, formatter, cancellationToken: c);
}
public static readonly SymbolDisplayFormat CrefFormat =
......
......@@ -229,7 +229,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpVisualStudioTest", "V
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ServicesVisualStudioTest", "VisualStudio\Core\Test\ServicesVisualStudioTest.vbproj", "{A1455D30-55FC-45EF-8759-3AEBDB13D940}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudioComponents", "VisualStudio\Components\VisualStudioComponents.csproj", "{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudioSetup", "VisualStudio\Setup\VisualStudioSetup.csproj", "{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualStudioInteractiveComponents", "VisualStudio\VisualStudioInteractiveComponents\VisualStudioInteractiveComponents.csproj", "{2169F526-8A88-435D-8732-486ACA095A6A}"
EndProject
......
......@@ -51,7 +51,7 @@ internal class ScriptBuilder
/// <summary>
/// Lockable object only instance is knowledgeable about.
/// <summary>
/// </summary>
private readonly object _gate = new object();
#region Testing and Debugging
......@@ -250,12 +250,12 @@ private sealed class CollectibleCodeManager : AssemblyLoader
/// <summary>
/// lock(_gate) on access.
/// <summary>
/// </summary>
private readonly object _gate = new object();
/// <summary>
// lock(_gate) on access.
/// <summary>
/// lock(_gate) on access.
/// </summary>
internal ModuleBuilder dynamicModule;
public CollectibleCodeManager(AssemblyLoader assemblyLoader, string assemblyNamePrefix)
......@@ -335,7 +335,7 @@ private sealed class UncollectibleCodeManager : AssemblyLoader
/// <summary>
/// Lockable object only instance is knowledgeable about.
/// <summary>
/// </summary>
private readonly object _gate = new object();
internal UncollectibleCodeManager(AssemblyLoader assemblyLoader, string assemblyNamePrefix)
......
[$RootKey$\BindingPaths\{5EABCC64-FDFC-478D-9123-DAE27341DE85}]
"$PackageFolder$"=""
......@@ -211,6 +211,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.SolutionExplorer" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Telemetry" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.CSharp.Repl" />
<InternalsVisibleTo Include="Roslyn.VisualStudio.InteractiveServices" />
......@@ -710,7 +711,6 @@
<SubType>Designer</SubType>
</None>
<None Include="app.config" />
<None Include="packages.config" />
<PublicAPI Include="PublicAPI.txt" />
</ItemGroup>
<ItemGroup />
......
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.ComponentModel.Composition.Hosting
Imports System.Threading
Imports Microsoft.CodeAnalysis
Imports Microsoft.CodeAnalysis.Completion
Imports Microsoft.CodeAnalysis.Completion.Providers
......@@ -8,7 +9,7 @@ Imports Microsoft.CodeAnalysis.Completion.Rules
Imports Microsoft.CodeAnalysis.Editor
Imports Microsoft.CodeAnalysis.Editor.CommandHandlers
Imports Microsoft.CodeAnalysis.Editor.Commands
Imports Microsoft.CodeAnalysis.Editor.Implementation.Intellisense.Completion
Imports Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion
Imports Microsoft.CodeAnalysis.Editor.UnitTests
Imports Microsoft.CodeAnalysis.Editor.UnitTests.IntelliSense
Imports Microsoft.CodeAnalysis.Host.Mef
......@@ -365,7 +366,7 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.DebuggerIntelliSense
End If
If documentation IsNot Nothing Then
Assert.Equal(documentation, Me.CurrentSignatureHelpPresenterSession.SelectedItem.Documentation.GetFullText())
Assert.Equal(documentation, Me.CurrentSignatureHelpPresenterSession.SelectedItem.DocumenationFactory(CancellationToken.None).GetFullText())
End If
If selectedParameter IsNot Nothing Then
......
......@@ -162,6 +162,38 @@
PublicKeyToken = Constants.PublicKeyToken,
GenerateCodeBase = false)]
[assembly: ProvideBindingRedirection(
AssemblyName = "Microsoft.VisualStudio.LanguageServices.Implementation",
OldVersionLowerBound = Constants.OldVersionLowerBound,
OldVersionUpperBound = Constants.OldVersionUpperBound,
NewVersion = Constants.NewVersion,
PublicKeyToken = Constants.PublicKeyToken,
GenerateCodeBase = false)]
[assembly: ProvideBindingRedirection(
AssemblyName = "Microsoft.VisualStudio.LanguageServices.VisualBasic",
OldVersionLowerBound = Constants.OldVersionLowerBound,
OldVersionUpperBound = Constants.OldVersionUpperBound,
NewVersion = Constants.NewVersion,
PublicKeyToken = Constants.PublicKeyToken,
GenerateCodeBase = false)]
[assembly: ProvideBindingRedirection(
AssemblyName = "Microsoft.VisualStudio.LanguageServices.CSharp",
OldVersionLowerBound = Constants.OldVersionLowerBound,
OldVersionUpperBound = Constants.OldVersionUpperBound,
NewVersion = Constants.NewVersion,
PublicKeyToken = Constants.PublicKeyToken,
GenerateCodeBase = false)]
[assembly: ProvideBindingRedirection(
AssemblyName = "Microsoft.VisualStudio.LanguageServices.SolutionExplorer",
OldVersionLowerBound = Constants.OldVersionLowerBound,
OldVersionUpperBound = Constants.OldVersionUpperBound,
NewVersion = Constants.NewVersion,
PublicKeyToken = Constants.PublicKeyToken,
GenerateCodeBase = false)]
internal class Constants
{
#if OFFICIAL_BUILD
......
[$RootKey$\Editors]
[$RootKey$\Editors\{08467b34-b90f-4d91-bdca-eb8c8cf3033a}]
"CommonPhysicalViewAttributes"=dword:00000003
"DisplayName"="#2359"
"EditorTrustLevel"=dword:00000002
"ExcludeDefTextEditor"=dword:00000001
"LinkedEditorGuid"="{A6C744A8-0E4A-4FC6-886A-064283054674}"
"Package"="{13C3BBB4-F18F-4111-9F54-A0FB010D9194}"
@="Microsoft CSharp Editor Factory with Encoding"
[$RootKey$\Editors\{08467b34-b90f-4d91-bdca-eb8c8cf3033a}\Extensions]
"cs"=dword:00000027
[$RootKey$\Editors\{08467b34-b90f-4d91-bdca-eb8c8cf3033a}\LogicalViews]
"{7651a700-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a701-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
"{7651a703-06e5-11d1-8ebd-00a0c90f26ea}"=""
[$RootKey$\Editors\{08467b34-b90f-4d91-bdca-eb8c8cf3033a}\UntrustedLogicalViews]
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\Editors\{A6C744A8-0E4A-4FC6-886A-064283054674}]
"CommonPhysicalViewAttributes"=dword:00000002
"DisplayName"="#2358"
"EditorTrustLevel"=dword:00000002
"ExcludeDefTextEditor"=dword:00000001
"Package"="{13C3BBB4-F18F-4111-9F54-A0FB010D9194}"
@="Microsoft CSharp Editor Factory"
[$RootKey$\Editors\{A6C744A8-0E4A-4FC6-886A-064283054674}\Extensions]
"cs"=dword:00000028
[$RootKey$\Editors\{A6C744A8-0E4A-4FC6-886A-064283054674}\LogicalViews]
"{7651a700-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a701-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
"{7651a703-06e5-11d1-8ebd-00a0c90f26ea}"=""
[$RootKey$\Editors\{A6C744A8-0E4A-4FC6-886A-064283054674}\PhysicalViewAttributes]
"Form"=dword:00000003
[$RootKey$\Editors\{A6C744A8-0E4A-4FC6-886A-064283054674}\UntrustedLogicalViews]
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\FileExtensionMapping\{201669EE-A2F4-4B72-82C6-028810C22A40}]
"DisplayName"="#113"
"EditorGUID"="{A6C744A8-0E4A-4FC6-886A-064283054674}"
"LogViewID"="{694DD9B6-B865-4C5B-AD85-86356E9C88DC}"
"Package"="{13C3BBB4-F18F-4111-9F54-A0FB010D9194}"
"SortPriority"=dword:00000064
@="Microsoft Visual C#"
<?xml version="1.0" encoding="utf-8"?>
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<Extern href="stdidcmd.h"/>
<Extern href="vsshlids.h"/>
<Include href="KnownImageIds.vsct"/>
<Commands package="guidRoslynPkgId">
<Groups>
<Group guid="guidRoslynGrpId" id="IDG_ROSLYN_HIDDEN_COMMANDS" priority="0x0000">
<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_EDIT" />
</Group>
<Group guid="guidCSharpGrpId" id="IDG_CSHARP_CODEGEN" priority="0x0000">
<Parent guid="guidStdEditor" id="IDM_VS_EDITOR_INTELLISENSE_MENU"/>
</Group>
<!-- Organize context sub-menu -->
<Group guid="guidCSharpGrpId" id="IDG_CSHARP_CTX_ORGANIZE" priority="0x0020">
<Parent guid="guidCSharpGrpId" id="IDM_CSHARP_CTX_ORGANIZE"/>
</Group>
<!-- Organize top-level sub-menu -->
<Group guid="guidCSharpGrpId" id="IDG_CSHARP_ORGANIZE" priority="0x0020">
<Parent guid="guidCSharpGrpId" id="IDM_CSHARP_ORGANIZE"/>
</Group>
<!-- Analyzer commands in Solution Explorer -->
<Group guid="guidRoslynGrpId" id="grpAnalyzerFolderContextMenu" priority="0x000">
<Parent guid="guidRoslynGrpId" id="cmdidAnalyzerFolderContextMenu"/>
</Group>
<Group guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJWIN_SCOPE" priority="0x001">
<Parent guid="guidRoslynGrpId" id="cmdidAnalyzerFolderContextMenu"/>
</Group>
<Group guid="guidRoslynGrpId" id="grpAnalyzerRemove" priority="0x000">
<Parent guid="guidRoslynGrpId" id="cmdidAnalyzerContextMenu"/>
</Group>
<Group guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJWIN_SCOPE" priority="0x001">
<Parent guid="guidRoslynGrpId" id="cmdidAnalyzerContextMenu"/>
</Group>
<Group guid="guidRoslynGrpId" id="grpAnalyzerProperties" priority="0x002">
<Parent guid="guidRoslynGrpId" id="cmdidAnalyzerContextMenu"/>
</Group>
<Group guid="guidRoslynGrpId" id="grpDiagnosticSeverity" priority="0x000">
<Parent guid="guidRoslynGrpId" id="cmdidDiagnosticContextMenu"/>
</Group>
<Group guid="guidRoslynGrpId" id="grpDiagnosticProperties" priority="0x002">
<Parent guid="guidRoslynGrpId" id="cmdidDiagnosticContextMenu"/>
</Group>
</Groups>
<Buttons>
<!-- Organize context sub-menu -->
<Button guid="guidCSharpGrpId" id="cmdidContextOrganizeRemoveUnusedUsings" priority="0x0200" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_CTX_ORGANIZE"/>
<Icon guid="ImageCatalogGuid" id="RemoveNamespace"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>IconIsMoniker</CommandFlag>
<Strings>
<ButtonText>&amp;Remove Unused Usings</ButtonText>
<CanonicalName>RemoveUnusedUsings</CanonicalName>
<LocCanonicalName>RemoveUnusedUsings</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidCSharpGrpId" id="cmdidContextOrganizeSortUsings" priority="0x0300" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_CTX_ORGANIZE"/>
<Icon guid="ImageCatalogGuid" id="SortByNamespace"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>IconIsMoniker</CommandFlag>
<Strings>
<ButtonText>Sort &amp;Usings</ButtonText>
<CanonicalName>SortUsings</CanonicalName>
<LocCanonicalName>SortUsings</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidCSharpGrpId" id="cmdidContextOrganizeRemoveAndSort" priority="0x0400" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_CTX_ORGANIZE"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<ButtonText>Remove &amp;and Sort</ButtonText>
<CanonicalName>RemoveAndSort</CanonicalName>
<LocCanonicalName>RemoveAndSort</LocCanonicalName>
</Strings>
</Button>
<!-- Organize top-level sub-menu -->
<Button guid="guidCSharpGrpId" id="cmdidCSharpOrganizeRemoveUnusedUsings" priority="0x0200" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_ORGANIZE"/>
<Icon guid="ImageCatalogGuid" id="RemoveNamespace"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>IconIsMoniker</CommandFlag>
<Strings>
<ButtonText>&amp;Remove Unused Usings</ButtonText>
<CanonicalName>RemoveUnusedUsings</CanonicalName>
<LocCanonicalName>RemoveUnusedUsings</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidCSharpGrpId" id="cmdidCSharpOrganizeSortUsings" priority="0x0300" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_ORGANIZE"/>
<Icon guid="ImageCatalogGuid" id="SortByNamespace"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<CommandFlag>IconIsMoniker</CommandFlag>
<Strings>
<ButtonText>Sort &amp;Usings</ButtonText>
<CanonicalName>SortUsings</CanonicalName>
<LocCanonicalName>SortUsings</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidCSharpGrpId" id="cmdidCSharpOrganizeRemoveAndSort" priority="0x0400" type="Button">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_ORGANIZE"/>
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<ButtonText>Remove &amp;and Sort</ButtonText>
<CanonicalName>RemoveAndSort</CanonicalName>
<LocCanonicalName>RemoveAndSort</LocCanonicalName>
</Strings>
</Button>
<!-- <project context menu> | Add | Analyzer... -->
<Button guid="guidRoslynGrpId" id="cmdidProjectContextAddAnalyzer" priority="0x0280" type="Button">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD_REFERENCES" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>&amp;Analyzer...</ButtonText>
<CanonicalName>AddAnalyzer</CanonicalName>
<LocCanonicalName>AddAnalyzer</LocCanonicalName>
</Strings>
</Button>
<!-- Project | Add Analyzer... -->
<Button guid="guidRoslynGrpId" id="cmdidProjectAddAnalyzer" priority="0x0180" type="Button">
<Parent guid="guidSHLMainMenu" id="IDG_VS_PROJ_OPTIONS" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Add &amp;Analyzer...</ButtonText>
<CanonicalName>AddAnalyzer</CanonicalName>
<LocCanonicalName>AddAnalyzer</LocCanonicalName>
</Strings>
</Button>
<!-- <References node context menu> | Add Analyzer -->
<Button guid="guidRoslynGrpId" id="cmdidReferencesContextAddAnalyzer" priority="0x0180" type="Button">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_REFROOT_ADD" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Add &amp;Analyzer...</ButtonText>
<CanonicalName>AddAnalyzer</CanonicalName>
<LocCanonicalName>AddAnalyzer</LocCanonicalName>
</Strings>
</Button>
<!-- Analyzer buttons in Solution Explorer -->
<Button guid="guidRoslynGrpId" id="cmdidAddAnalyzer" priority="100" type="Button">
<Parent guid="guidRoslynGrpId" id="grpAnalyzerFolderContextMenu" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Add &amp;Analyzer...</ButtonText>
<CanonicalName>AddAnalyzer</CanonicalName>
<LocCanonicalName>AddAnalyzer</LocCanonicalName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidRemoveAnalyzer" priority="100" type="Button">
<Parent guid="guidRoslynGrpId" id="grpAnalyzerRemove" />
<Strings>
<ButtonText>&amp;Remove</ButtonText>
<CanonicalName>RemoveAnalyzer</CanonicalName>
<LocCanonicalName>RemoveAnalyzer</LocCanonicalName>
<CommandName>RemoveAnalyzer</CommandName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidOpenRuleSet" priority="200" type="Button">
<Parent guid="guidRoslynGrpId" id="grpAnalyzerFolderContextMenu" />
<Strings>
<ButtonText>&amp;Open Rule Set</ButtonText>
<CanonicalName>OpenRuleSet</CanonicalName>
<LocCanonicalName>OpenRuleSet</LocCanonicalName>
<CommandName>OpenRuleSet</CommandName>
</Strings>
</Button>
<!-- Buttons to set severity of diagnostics -->
<Button guid="guidRoslynGrpId" id="cmdidSetSeverityError" priority="100" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticSeverity" />
<Strings>
<ButtonText>&amp;Error</ButtonText>
<CanonicalName>Error</CanonicalName>
<LocCanonicalName>Error</LocCanonicalName>
<CommandName>SetSeverityError</CommandName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidSetSeverityWarning" priority="200" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticSeverity" />
<Strings>
<ButtonText>&amp;Warning</ButtonText>
<CanonicalName>Warning</CanonicalName>
<LocCanonicalName>Warning</LocCanonicalName>
<CommandName>SetSeverityWarning</CommandName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidSetSeverityInfo" priority="300" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticSeverity" />
<Strings>
<ButtonText>&amp;Info</ButtonText>
<CanonicalName>Info</CanonicalName>
<LocCanonicalName>Info</LocCanonicalName>
<CommandName>SetSeverityInfo</CommandName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidSetSeverityHidden" priority="400" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticSeverity" />
<Strings>
<ButtonText>&amp;Hidden</ButtonText>
<CanonicalName>Hidden</CanonicalName>
<LocCanonicalName>Hidden</LocCanonicalName>
<CommandName>SetSeverityHidden</CommandName>
</Strings>
</Button>
<Button guid="guidRoslynGrpId" id="cmdidSetSeverityNone" priority="500" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticSeverity" />
<Strings>
<ButtonText>&amp;None</ButtonText>
<CanonicalName>None</CanonicalName>
<LocCanonicalName>None</LocCanonicalName>
<CommandName>SetSeverityNone</CommandName>
</Strings>
</Button>
<!-- Buttons to open the diagnostic help link -->
<Button guid="guidRoslynGrpId" id="cmdidOpenDiagnosticHelpLink" priority="100" type="Button">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticProperties" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>&amp;View Help...</ButtonText>
<CanonicalName>ViewHelp</CanonicalName>
<LocCanonicalName>ViewHelp</LocCanonicalName>
<CommandName>ViewHelp</CommandName>
</Strings>
</Button>
</Buttons>
<Menus>
<Menu guid="guidCSharpGrpId" id="IDM_CSHARP_ORGANIZE" priority="0x0500" type="Menu">
<Parent guid="guidCSharpGrpId" id="IDG_CSHARP_CODEGEN"/>
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<ButtonText>Organize Usings</ButtonText>
<CommandName>&amp;Organize Usings</CommandName>
</Strings>
</Menu>
<Menu guid="guidCSharpGrpId" id="IDM_CSHARP_CTX_ORGANIZE" priority="0x0400" type="Context">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CODEWIN_LANGUAGE"/>
<CommandFlag>TextChanges</CommandFlag>
<Strings>
<ButtonText>Organize Usings</ButtonText>
<CommandName>&amp;Organize Usings</CommandName>
</Strings>
</Menu>
<Menu guid="guidRoslynGrpId" id="cmdidAnalyzerContextMenu" priority="100" type="Context">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLNEXPL_ALL" />
<Strings>
<ButtonText>Analyzer</ButtonText>
<CanonicalName>Analyzer</CanonicalName>
<LocCanonicalName>Analyzer</LocCanonicalName>
</Strings>
</Menu>
<Menu guid="guidRoslynGrpId" id="cmdidAnalyzerFolderContextMenu" priority="100" type="Context">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLNEXPL_ALL" />
<Strings>
<ButtonText>Analyzers</ButtonText>
<CanonicalName>Analyzers</CanonicalName>
<LocCanonicalName>Analyzers</LocCanonicalName>
</Strings>
</Menu>
<Menu guid="guidRoslynGrpId" id="cmdidDiagnosticContextMenu" priority="100" type="Context">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLNEXPL_ALL" />
<Strings>
<ButtonText>Diagnostic</ButtonText>
<CanonicalName>Diagnostic</CanonicalName>
<LocCanonicalName>Diagnostic</LocCanonicalName>
</Strings>
</Menu>
</Menus>
</Commands>
<CommandPlacements>
<CommandPlacement guid="guidVSStd2K" id="ECMD_INSERTCOMMENT" priority="0x0300">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CODEWIN_ADVANCED" />
</CommandPlacement>
<!-- Add Rename to the editor context menu below the Refactor item. -->
<CommandPlacement guid="guidVSStd2K" id="ECMD_RENAME" priority="0x0150">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CODEWIN_LANGUAGE"/>
</CommandPlacement>
<!-- Analyzer node entries -->
<CommandPlacement guid="guidVSStd97" id="cmdidPropSheetOrProperties" priority="200">
<Parent guid="guidRoslynGrpId" id="grpAnalyzerProperties" />
</CommandPlacement>
<!-- Diagnostic node entries -->
<CommandPlacement guid="guidVSStd97" id="cmdidPropSheetOrProperties" priority="200">
<Parent guid="guidRoslynGrpId" id="grpDiagnosticProperties" />
</CommandPlacement>
</CommandPlacements>
<UsedCommands>
<UsedCommand guid="guidVSStd2K" id="ECMD_INSERTCOMMENT" />
</UsedCommands>
<Symbols>
<GuidSymbol name="guidRoslynPkgId" value="{6cf2e545-6109-4730-8883-cf43d7aec3e1}" />
<GuidSymbol name ="guidCSharpGrpId" value ="{5d7e7f65-a63f-46ee-84f1-990b2cab23f9}">
<IDSymbol name="IDM_CSHARP_ORGANIZE" value="0x3900"/>
<IDSymbol name="IDM_CSHARP_CTX_ORGANIZE" value="0x3950"/>
<IDSymbol name="IDG_CSHARP_CODEGEN" value="0x3490"/>
<IDSymbol name="IDG_CSHARP_ORGANIZE" value="0x3617"/>
<IDSymbol name="IDG_CSHARP_CTX_ORGANIZE" value="0x3618"/>
<IDSymbol name="cmdidContextOrganizeRemoveUnusedUsings" value="0x1911"/>
<IDSymbol name="cmdidContextOrganizeSortUsings" value="0x1912"/>
<IDSymbol name="cmdidContextOrganizeRemoveAndSort" value="0x1913"/>
<IDSymbol name="cmdidCSharpOrganizeRemoveUnusedUsings" value="0x1921"/>
<IDSymbol name="cmdidCSharpOrganizeSortUsings" value="0x1922"/>
<IDSymbol name="cmdidCSharpOrganizeRemoveAndSort" value="0x1923"/>
</GuidSymbol>
<GuidSymbol name="guidRoslynGrpId" value="{b61e1a20-8c13-49a9-a727-a0ec091647dd}">
<IDSymbol name="IDG_ROSLYN_HIDDEN_COMMANDS" value="0x3002" />
<IDSymbol name="cmdidAnalyzerContextMenu" value="0x0103" />
<IDSymbol name="grpAnalyzerProperties" value="0x0104" />
<IDSymbol name="grpAnalyzerRemove" value="0x0105" />
<IDSymbol name="cmdidAddAnalyzer" value="0x0106" />
<IDSymbol name="cmdidAnalyzerFolderContextMenu" value="0x0107" />
<IDSymbol name="grpAnalyzerFolderContextMenu" value="0x0108" />
<IDSymbol name="cmdidRemoveAnalyzer" value="0x0109" />
<IDSymbol name="cmdidOpenRuleSet" value="0x010a" />
<IDSymbol name="cmdidProjectAddAnalyzer" value="0x010b" />
<IDSymbol name="cmdidProjectContextAddAnalyzer" value="0x010c" />
<IDSymbol name="cmdidReferencesContextAddAnalyzer" value="0x010d" />
<IDSymbol name="cmdidDiagnosticContextMenu" value="0x010e" />
<IDSymbol name="grpDiagnosticSeverity" value="0x010f" />
<IDSymbol name="cmdidSetSeverityError" value="0x0110" />
<IDSymbol name="cmdidSetSeverityWarning" value="0x0111" />
<IDSymbol name="cmdidSetSeverityInfo" value="0x0112" />
<IDSymbol name="cmdidSetSeverityHidden" value="0x0113" />
<IDSymbol name="cmdidSetSeverityNone" value="0x0114" />
<IDSymbol name="grpDiagnosticProperties" value="0x0115" />
<IDSymbol name="cmdidOpenDiagnosticHelpLink" value="0x0116" />
</GuidSymbol>
</Symbols>
</CommandTable>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualStudio.ComponentModelHost;
namespace Microsoft.VisualStudio.LanguageServices.Setup
{
internal interface IRoslynTelemetrySetup
{
void Initialize(IServiceProvider componentModel);
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.ComponentModel.Design;
using System.Reflection;
using System.Runtime.InteropServices;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Versions;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.LanguageServices.Implementation;
using Microsoft.VisualStudio.LanguageServices.Implementation.Library.FindResults;
using Microsoft.VisualStudio.LanguageServices.Implementation.SolutionExplorer;
using Microsoft.VisualStudio.LanguageServices.Implementation.TableDataSource;
using Microsoft.VisualStudio.LanguageServices.Implementation.TaskList;
using Microsoft.VisualStudio.LanguageServices.Utilities;
using Microsoft.VisualStudio.PlatformUI;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Task = System.Threading.Tasks.Task;
namespace Microsoft.VisualStudio.LanguageServices.Setup
{
[Guid(Guids.RoslynPackageIdString)]
[PackageRegistration(UseManagedResourcesOnly = true)]
[ProvideMenuResource("Menus.ctmenu", version: 10)]
public class RoslynPackage : Package
{
private LibraryManager _libraryManager;
private uint _libraryManagerCookie;
private VisualStudioWorkspace _workspace;
private WorkspaceFailureOutputPane _outputPane;
private IComponentModel _componentModel;
private AnalyzerItemsTracker _analyzerTracker;
private IDisposable _solutionBuildMonitor;
protected override void Initialize()
{
base.Initialize();
ForegroundThreadAffinitizedObject.Initialize();
FatalError.Handler = FailFast.OnFatalException;
FatalError.NonFatalHandler = WatsonReporter.Report;
// We also must set the FailFast handler for the compiler layer as well
var compilerAssembly = typeof(Compilation).Assembly;
var compilerFatalError = compilerAssembly.GetType("Microsoft.CodeAnalysis.FatalError", throwOnError: true);
var property = compilerFatalError.GetProperty(nameof(FatalError.Handler), BindingFlags.Static | BindingFlags.Public);
var compilerFailFast = compilerAssembly.GetType(typeof(FailFast).FullName, throwOnError: true);
var method = compilerFailFast.GetMethod(nameof(FailFast.OnFatalException), BindingFlags.Static | BindingFlags.NonPublic);
property.SetValue(null, Delegate.CreateDelegate(property.PropertyType, method));
RegisterFindResultsLibraryManager();
var componentModel = (IComponentModel)this.GetService(typeof(SComponentModel));
_workspace = componentModel.GetService<VisualStudioWorkspace>();
var telemetrySetup = componentModel.GetService<IRoslynTelemetrySetup>();
telemetrySetup?.Initialize(this);
// set workspace output pane
_outputPane = new WorkspaceFailureOutputPane(this, _workspace);
InitializeColors();
// load some services that have to be loaded in UI thread
LoadComponentsInUIContext();
_solutionBuildMonitor = new SolutionBuildMonitor(_workspace);
}
private void InitializeColors()
{
// Use VS color keys in order to support theming.
CodeAnalysisColors.SystemCaptionTextColorKey = EnvironmentColors.SystemWindowTextColorKey;
CodeAnalysisColors.SystemCaptionTextBrushKey = EnvironmentColors.SystemWindowTextBrushKey;
CodeAnalysisColors.CheckBoxTextBrushKey = EnvironmentColors.SystemWindowTextBrushKey;
CodeAnalysisColors.RenameErrorTextBrushKey = VSCodeAnalysisColors.RenameErrorTextBrushKey;
CodeAnalysisColors.RenameResolvableConflictTextBrushKey = VSCodeAnalysisColors.RenameResolvableConflictTextBrushKey;
CodeAnalysisColors.BackgroundBrushKey = VsBrushes.CommandBarGradientBeginKey;
CodeAnalysisColors.ButtonStyleKey = VsResourceKeys.ButtonStyleKey;
CodeAnalysisColors.AccentBarColorKey = EnvironmentColors.FileTabInactiveDocumentBorderEdgeBrushKey;
}
private void LoadComponentsInUIContext()
{
if (KnownUIContexts.SolutionExistsAndFullyLoadedContext.IsActive)
{
// if we are already in the right UI context, load it right away
LoadComponents();
}
else
{
// load them when it is a right context.
KnownUIContexts.SolutionExistsAndFullyLoadedContext.UIContextChanged += OnSolutionExistsAndFullyLoadedContext;
}
}
private void OnSolutionExistsAndFullyLoadedContext(object sender, UIContextChangedEventArgs e)
{
if (e.Activated)
{
// unsubscribe from it
KnownUIContexts.SolutionExistsAndFullyLoadedContext.UIContextChanged -= OnSolutionExistsAndFullyLoadedContext;
// load components
LoadComponents();
}
}
private void LoadComponents()
{
this.ComponentModel.GetService<VisualStudioErrorTaskList>();
this.ComponentModel.GetService<VisualStudioTodoTaskList>();
this.ComponentModel.GetService<HACK_ThemeColorFixer>();
this.ComponentModel.GetExtensions<IReferencedSymbolsPresenter>();
this.ComponentModel.GetExtensions<INavigableItemsPresenter>();
this.ComponentModel.GetService<VisualStudioMetadataAsSourceFileSupportService>();
this.ComponentModel.GetService<VirtualMemoryNotificationListener>();
LoadAnalyzerNodeComponents();
Task.Run(() => LoadComponentsBackground());
}
private void LoadComponentsBackground()
{
// Perf: Initialize the command handlers.
var commandHandlerServiceFactory = this.ComponentModel.GetService<ICommandHandlerServiceFactory>();
commandHandlerServiceFactory.Initialize(ContentTypeNames.RoslynContentType);
this.ComponentModel.GetService<VisualStudioTodoListTable>();
this.ComponentModel.GetService<VisualStudioDiagnosticListTable>();
this.ComponentModel.GetService<MiscellaneousTodoListTable>();
this.ComponentModel.GetService<MiscellaneousDiagnosticListTable>();
}
internal IComponentModel ComponentModel
{
get
{
if (_componentModel == null)
{
_componentModel = (IComponentModel)GetService(typeof(SComponentModel));
}
return _componentModel;
}
}
protected override void Dispose(bool disposing)
{
UnregisterFindResultsLibraryManager();
DisposeVisualStudioDocumentTrackingService();
UnregisterAnalyzerTracker();
ReportSessionWideTelemetry();
if (_solutionBuildMonitor != null)
{
_solutionBuildMonitor.Dispose();
_solutionBuildMonitor = null;
}
base.Dispose(disposing);
}
private void ReportSessionWideTelemetry()
{
PersistedVersionStampLogger.LogSummary();
}
private void RegisterFindResultsLibraryManager()
{
var objectManager = this.GetService(typeof(SVsObjectManager)) as IVsObjectManager2;
if (objectManager != null)
{
_libraryManager = new LibraryManager(this);
if (ErrorHandler.Failed(objectManager.RegisterSimpleLibrary(_libraryManager, out _libraryManagerCookie)))
{
_libraryManagerCookie = 0;
}
((IServiceContainer)this).AddService(typeof(LibraryManager), _libraryManager, promote: true);
}
}
private void UnregisterFindResultsLibraryManager()
{
if (_libraryManagerCookie != 0)
{
var objectManager = this.GetService(typeof(SVsObjectManager)) as IVsObjectManager2;
if (objectManager != null)
{
objectManager.UnregisterLibrary(_libraryManagerCookie);
_libraryManagerCookie = 0;
}
((IServiceContainer)this).RemoveService(typeof(LibraryManager), promote: true);
_libraryManager = null;
}
}
private void DisposeVisualStudioDocumentTrackingService()
{
if (_workspace != null)
{
var documentTrackingService = _workspace.Services.GetService<IDocumentTrackingService>() as VisualStudioDocumentTrackingService;
documentTrackingService.Dispose();
}
}
private void LoadAnalyzerNodeComponents()
{
_analyzerTracker = this.ComponentModel.GetService<AnalyzerItemsTracker>();
if (_analyzerTracker != null)
{
_analyzerTracker.Register();
}
var analyzerCommandHandler = this.ComponentModel.GetService<AnalyzersCommandHandler>();
if (analyzerCommandHandler != null)
{
analyzerCommandHandler.Initialize((IMenuCommandService)this.GetService(typeof(IMenuCommandService)));
}
}
private void UnregisterAnalyzerTracker()
{
if (_analyzerTracker != null)
{
_analyzerTracker.Unregister();
_analyzerTracker = null;
}
}
}
}
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Roslyn.VisualStudio.Setup {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class VSPackage {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal VSPackage() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Roslyn.VisualStudio.Setup.VSPackage", typeof(VSPackage).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Workspace.
/// </summary>
internal static string WorkspaceOutputPaneTitle {
get {
return ResourceManager.GetString("WorkspaceOutputPaneTitle", resourceCulture);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="WorkspaceOutputPaneTitle" xml:space="preserve">
<value>Workspace</value>
</data>
</root>
\ No newline at end of file
[$RootKey$\Editors]
[$RootKey$\Editors\{6C33E1AA-1401-4536-AB67-0E21E6E569DA}]
"Package"="{574FC912-F74F-4B4E-92C3-F695C208A2BB}"
"DisplayName"="#1012"
"CommonPhysicalViewAttributes"=dword:00000003
"ExcludeDefTextEditor"=dword:00000001
"EditorTrustLevel"=dword:00000002
"LinkedEditorGuid"="{2C015C70-C72C-11D0-88C3-00A0C9110049}"
@="Microsoft Visual Basic Editor with Encoding"
[$RootKey$\Editors\{6C33E1AA-1401-4536-AB67-0E21E6E569DA}\LogicalViews]
"{7651a700-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a701-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a703-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\Editors\{6C33E1AA-1401-4536-AB67-0E21E6E569DA}\UntrustedLogicalViews]
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\Editors\{6C33E1AA-1401-4536-AB67-0E21E6E569DA}\Extensions]
"bas"=dword:00000027
"cls"=dword:00000027
"frm"=dword:00000027
"dob"=dword:00000027
"dsr"=dword:00000027
"pag"=dword:00000027
"ctl"=dword:00000027
"vb"=dword:00000027
[$RootKey$\Editors\{2C015C70-C72C-11D0-88C3-00A0C9110049}]
"Package"="{574FC912-F74F-4B4E-92C3-F695C208A2BB}"
"DisplayName"="#1013"
"CommonPhysicalViewAttributes"=dword:00000002
"ExcludeDefTextEditor"=dword:00000001
"EditorTrustLevel"=dword:00000002
@="Microsoft Visual Basic Editor"
[$RootKey$\Editors\{2C015C70-C72C-11D0-88C3-00A0C9110049}\LogicalViews]
"{7651a700-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a701-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a703-06e5-11d1-8ebd-00a0c90f26ea}"=""
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\Editors\{2C015C70-C72C-11D0-88C3-00A0C9110049}\PhysicalViewAttributes]
"Form"=dword:00000003
[$RootKey$\Editors\{2C015C70-C72C-11D0-88C3-00A0C9110049}\UntrustedLogicalViews]
"{7651a702-06e5-11d1-8ebd-00a0c90f26ea}"="Form"
[$RootKey$\Editors\{2C015C70-C72C-11D0-88C3-00A0C9110049}\Extensions]
"bas"=dword:00000028
"cls"=dword:00000028
"frm"=dword:00000028
"dob"=dword:00000028
"dsr"=dword:00000028
"pag"=dword:00000028
"ctl"=dword:00000028
"vb"=dword:00000028
[$RootKey$\FileExtensionMapping\{4EFF8F38-5CAD-44D4-BA53-E9F0FC152D1F}]
"DisplayName"="#108"
"EditorGUID"="{2C015C70-C72C-11D0-88C3-00A0C9110049}"
"LogViewID"="{E34ACDC0-BAAE-11D0-88BF-00A0C9110049}"
"Package"="{574FC912-F74F-4B4E-92C3-F695C208A2BB}"
"SortPriority"=dword:00000064
@="Microsoft Visual Basic"
[$RootKey$\Languages\Language Services\Basic]
@="{e34acdc0-baae-11d0-88bf-00a0c9110049}"
"Package"="{574fc912-f74f-4b4e-92c3-f695c208a2bb}"
"LangResID"=dword:00000000
"DefaultToInsertSpaces"=dword:00000001
"HideAdvancedMembersByDefault"=dword:00000001
"RequestStockColors"=dword:00000001
"ShowBraceCompletion"=dword:00000001
"ShowCompletion"=dword:00000001
"ShowDropdownBarOption"=dword:00000001
"ShowSmartIndent"=dword:00000001
"SupportsImageCaching"=dword:00000001
"Single Code Window Only"=dword:00000000
// DesignerLoader is still set in VBLanguageService.pkgdef in the main product setup authoring since that needs to differ between Dev12 and Dev14.
[$RootKey$\Text Editor\Basic]
"Insert Tabs"=dword:00000000
"Indent Style"=dword:00000002
[$RootKey$\VB Editor\Roslyn]
"DisplayLineSeparators"=dword:00000001
\ No newline at end of file
......@@ -10,140 +10,122 @@
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Roslyn.VisualStudio.Components</RootNamespace>
<AssemblyName>Roslyn.VisualStudio.Components</AssemblyName>
<RootNamespace>Roslyn.VisualStudio.Setup</RootNamespace>
<AssemblyName>Roslyn.VisualStudio.Setup</AssemblyName>
<GeneratePkgDefFile>true</GeneratePkgDefFile>
<UseCodebase>true</UseCodebase>
<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<NoDocumentationFile>true</NoDocumentationFile>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<ImportVSSDKTargets>true</ImportVSSDKTargets>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition="'$(OfficialBuild)' == 'true'">
<DefineConstants>OFFICIAL_BUILD</DefineConstants>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\CodeAnalysis.csproj">
<Project>{1EE8CAD3-55F9-4D91-96B2-084641DA9A6C}</Project>
<Name>CodeAnalysis</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\Core\Desktop\CodeAnalysis.Desktop.csproj">
<Project>{DFA21CA1-7F96-47EE-940C-069858E81727}</Project>
<Name>CodeAnalysis.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\CSharp\Portable\CSharpCodeAnalysis.csproj">
<Project>{B501A547-C911-4A05-AC6E-274A50DFF30E}</Project>
<Name>CSharpCodeAnalysis</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\CSharp\Desktop\CSharpCodeAnalysis.Desktop.csproj">
<Project>{079AF8EF-1058-48B6-943F-AB02D39E0641}</Project>
<Name>CSharpCodeAnalysis.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\VisualBasic\Portable\BasicCodeAnalysis.vbproj">
<Project>{2523D0E6-DF32-4A3E-8AE0-A19BFFAE2EF6}</Project>
<Name>BasicCodeAnalysis</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Compilers\VisualBasic\Desktop\BasicCodeAnalysis.Desktop.vbproj">
<Project>{73F3E2C5-D742-452E-B9E1-20732DDBC75D}</Project>
<Name>BasicCodeAnalysis.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\Core\Desktop\Workspaces.Desktop.csproj">
<Project>{2e87fa96-50bb-4607-8676-46521599f998}</Project>
<Name>Workspaces.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\CSharp\Desktop\CSharpWorkspace.Desktop.csproj">
<Project>{687daffd-9bd9-4331-96b7-483b941edeaa}</Project>
<Name>CSharpWorkspace.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\VisualBasic\Desktop\BasicWorkspace.Desktop.vbproj">
<Project>{e637ad92-8397-4337-a9cd-9f2570078e59}</Project>
<Name>BasicWorkspace.Desktop</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Features\VisualBasic\BasicFeatures.vbproj">
<Project>{A1BCD0CE-6C2F-4F8C-9A48-D9D93928E26D}</Project>
<Name>BasicFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Features\CSharp\CSharpFeatures.csproj">
<Project>{3973B09A-4FBF-44A5-8359-3D22CEB71F71}</Project>
<Name>CSharpFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\EditorFeatures\CSharp\CSharpEditorFeatures.csproj">
<Project>{B0CE9307-FFDB-4838-A5EC-CE1F7CDC4AC2}</Project>
<Name>CSharpEditorFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\EditorFeatures\Core\EditorFeatures.csproj">
<Project>{3CDEEAB7-2256-418A-BEB2-620B5CB16302}</Project>
<Name>EditorFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Features\Core\Features.csproj">
<Project>{EDC68A0E-C68D-4A74-91B7-BF38EC909888}</Project>
<Name>Features</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\EditorFeatures\Text\TextEditorFeatures.csproj">
<Project>{18F5FBB8-7570-4412-8CC7-0A86FF13B7BA}</Project>
<Name>TextEditorFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\EditorFeatures\VisualBasic\BasicEditorFeatures.vbproj">
<Project>{49BFAE50-1BCE-48AE-BC89-78B7D90A3ECD}</Project>
<Name>BasicEditorFeatures</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\Core\Portable\Workspaces.csproj">
<Project>{5F8D2414-064A-4B3A-9B42-8E2A04246BE5}</Project>
<Name>Workspaces</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\CSharp\Portable\CSharpWorkspace.csproj">
<Project>{21B239D0-D144-430F-A394-C066D58EE267}</Project>
<Name>CSharpWorkspace</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\Workspaces\VisualBasic\Portable\BasicWorkspace.vbproj">
<Project>{57CA988D-F010-4BF2-9A2E-07D6DCD2FF2C}</Project>
<Name>BasicWorkspace</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\..\VisualStudio\Core\Def\ServicesVisualStudio.csproj">
<ProjectReference Include="..\Core\Def\ServicesVisualStudio.csproj">
<Project>{86FD5B9A-4FA0-4B10-B59F-CFAF077A859C}</Project>
<Name>ServicesVisualStudio</Name>
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\Core\Impl\ServicesVisualStudioImpl.csproj">
<Project>{c0e80510-4fbe-4b0c-af2c-4f473787722c}</Project>
<Name>ServicesVisualStudioImpl</Name>
</ProjectReference>
<ProjectReference Include="..\Core\SolutionExplorerShim\SolutionExplorerShim.csproj">
<Project>{7BE3DEEB-87F8-4E15-9C21-4F94B0B1C2D6}</Project>
<Name>SolutionExplorerShim</Name>
</ProjectReference>
<ProjectReference Include="..\CSharp\Impl\CSharpVisualStudio.csproj">
<Project>{5defadbd-44eb-47a2-a53e-f1282cc9e4e9}</Project>
<Name>CSharpVisualStudio</Name>
</ProjectReference>
<ProjectReference Include="..\VisualBasic\Impl\BasicVisualStudio.vbproj">
<Project>{d49439d7-56d2-450f-a4f0-74cb95d620e6}</Project>
<Name>BasicVisualStudio</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Telemetry" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
</PropertyGroup>
......@@ -160,19 +142,20 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="BindingPath.pkgdef">
<IncludeInVsix>true</IncludeInVsix>
<VSIXSubPath>$(PkgdefVSIXSubPath)</VSIXSubPath>
</Content>
</ItemGroup>
<ItemGroup>
<Reference Include="Esent.Interop">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\ManagedEsent.1.9.2.0\lib\net40\Esent.Interop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=$(VisualStudioReferenceAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.14.0, Version=$(VisualStudioReferenceAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop, Version=7.1.40304.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="System" />
<Reference Include="System.Collections.Immutable">
<SpecificVersion>False</SpecificVersion>
......@@ -184,15 +167,41 @@
<HintPath>..\..\References\MetadataReader\System.Reflection.Metadata.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition="'$(OfficialBuild)' == 'true'">
<DefineConstants>OFFICIAL_BUILD</DefineConstants>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="VSPackage.resx">
<MergeWithCTO>true</MergeWithCTO>
<ManifestResourceNme>VSPackage</ManifestResourceNme>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>VSPackage.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<VSCTCompile Include="Commands.vsct">
<ResourceName>Menus.ctmenu</ResourceName>
<SubType>Designer</SubType>
</VSCTCompile>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyRedirects.cs" Condition="('$(AssemblyVersion)' == '42.42.42.42') or ('$(OfficialBuild)' == 'true')" />
<Compile Include="IRoslynTelemetrySetup.cs" />
<Compile Include="RoslynPackage.cs" />
<Compile Include="WorkspaceFailureOutputPane.cs" />
<Compile Include="VSPackage.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>VSPackage.resx</DependentUpon>
</Compile>
<Content Include="CSharpPackageRegistration.pkgdef">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="VisualBasicPackageRegistration.pkgdef">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="Resources\Generate_Commands.bmp" />
</ItemGroup>
<ImportGroup Label="Targets">
<Import Project="..\..\Tools\Microsoft.CodeAnalysis.Toolset.Open\Targets\VSL.Imports.targets" />
<Import Project="..\..\..\build\VSL.Imports.Closed.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.Shell.Interop;
using Roslyn.VisualStudio.Setup;
namespace Microsoft.VisualStudio.LanguageServices.Setup
{
internal class WorkspaceFailureOutputPane : ForegroundThreadAffinitizedObject
{
private static readonly Guid s_workspacePaneGuid = new Guid("53D7CABD-085E-46AF-ACCA-EF5A640641CA");
private readonly IServiceProvider _serviceProvider;
private readonly Workspace _workspace;
public WorkspaceFailureOutputPane(IServiceProvider serviceProvider, Workspace workspace)
{
_serviceProvider = serviceProvider;
_workspace = workspace;
_workspace.WorkspaceFailed += OnWorkspaceFailed;
}
private void OnWorkspaceFailed(object sender, WorkspaceDiagnosticEventArgs e)
{
InvokeBelowInputPriority(() =>
{
var outputPane = this.OutputPane;
if (outputPane == null)
{
return;
}
outputPane.OutputString(e.Diagnostic.ToString() + Environment.NewLine);
});
}
private IVsOutputWindowPane _doNotAccessDirectlyOutputPane;
private IVsOutputWindowPane OutputPane
{
get
{
AssertIsForeground();
if (_doNotAccessDirectlyOutputPane == null)
{
var outputWindow = (IVsOutputWindow)_serviceProvider.GetService(typeof(SVsOutputWindow));
// Try to get the workspace pane if it has already been registered
var workspacePaneGuid = s_workspacePaneGuid;
var hr = outputWindow.GetPane(ref workspacePaneGuid, out _doNotAccessDirectlyOutputPane);
// If the workspace pane has not been registered before, create it
if (_doNotAccessDirectlyOutputPane == null || hr != VSConstants.S_OK)
{
if (ErrorHandler.Failed(outputWindow.CreatePane(ref workspacePaneGuid, VSPackage.WorkspaceOutputPaneTitle, fInitVisible: 1, fClearWithSolution: 1)) ||
ErrorHandler.Failed(outputWindow.GetPane(ref workspacePaneGuid, out _doNotAccessDirectlyOutputPane)))
{
return null;
}
// Must activate the workspace pane for it to show up in the output window
_doNotAccessDirectlyOutputPane.Activate();
}
}
return _doNotAccessDirectlyOutputPane;
}
}
}
}
......@@ -2,8 +2,8 @@
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="0b5e8ddb-f12d-4131-a71d-77acc26a798f" Version="|%CurrentProject%;GetBuildVersion|" Language="en-US" Publisher="Microsoft" />
<DisplayName>Roslyn Components</DisplayName>
<Description>Core Roslyn components for Visual Studio.</Description>
<DisplayName>Roslyn Language Services</DisplayName>
<Description>C# and VB.NET language services for Visual Studio.</Description>
</Metadata>
<Installation>
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.Pro" />
......@@ -15,7 +15,7 @@
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
</Dependencies>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" Path="Roslyn.VisualStudio.Components.pkgdef" />
<Asset Type="Microsoft.VisualStudio.VsPackage" Path="BindingPath.pkgdef" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.Workspaces.dll" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.Workspaces.Desktop.dll" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.EditorFeatures.dll" />
......@@ -30,6 +30,14 @@
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.dll" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.CodeAnalysis.EditorFeatures.Text.dll" />
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Microsoft.VisualStudio.LanguageServices.dll" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="BasicVisualStudio" Path="|BasicVisualStudio|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="CSharpVisualStudio" Path="|CSharpVisualStudio|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="SolutionExplorerShim" Path="|SolutionExplorerShim|" />
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="ServicesVisualStudioImpl" Path="|ServicesVisualStudioImpl|" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="BasicVisualStudio" Path="|BasicVisualStudio;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="CSharpVisualStudio" Path="|CSharpVisualStudio;PkgdefProjectOutputGroup|" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="CSharpPackageRegistration.pkgdef" />
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="VisualBasicPackageRegistration.pkgdef" />
<Asset Type="Microsoft.VisualStudio.Analyzer" Path="Microsoft.CodeAnalysis.CSharp.dll" />
<Asset Type="Microsoft.VisualStudio.Analyzer" Path="Microsoft.CodeAnalysis.VisualBasic.dll" />
<Asset Type="Microsoft.VisualStudio.Analyzer" Path="Microsoft.CodeAnalysis.EditorFeatures.dll" />
......@@ -39,4 +47,4 @@
<Asset Type="Microsoft.VisualStudio.Analyzer" Path="Microsoft.CodeAnalysis.VisualBasic.Features.dll" />
<Asset Type="Microsoft.VisualStudio.Analyzer" Path="Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.dll" />
</Assets>
</PackageManifest>
\ No newline at end of file
</PackageManifest>
......@@ -62,7 +62,7 @@
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup%3bPkgDefProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\Components\VisualStudioComponents.csproj">
<ProjectReference Include="..\Setup\VisualStudioSetup.csproj">
<Project>{201ec5b7-f91e-45e5-b9f2-67a266cce6fc}</Project>
<Name>VisualStudioComponents</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
......@@ -142,4 +142,4 @@
<Import Project="..\..\..\build\VSL.Imports.Closed.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
</Project>
\ No newline at end of file
......@@ -115,9 +115,9 @@
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
<IncludeOutputGroupsInVSIXLocalOnly>DebugSymbolsProjectOutputGroup</IncludeOutputGroupsInVSIXLocalOnly>
</ProjectReference>
<ProjectReference Include="..\Components\VisualStudioComponents.csproj">
<ProjectReference Include="..\Setup\VisualStudioSetup.csproj">
<Project>{201EC5B7-F91E-45E5-B9F2-67A266CCE6FC}</Project>
<Name>VisualStudioComponents</Name>
<Name>VisualStudioSetup</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
......
......@@ -13,7 +13,7 @@
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />
<Dependency Version="|VisualStudioComponents;GetBuildVersion|" DisplayName="Roslyn Components" Id="0b5e8ddb-f12d-4131-a71d-77acc26a798f" />
<Dependency Version="|VisualStudioSetup;GetBuildVersion|" DisplayName="Roslyn Language Services" Id="0b5e8ddb-f12d-4131-a71d-77acc26a798f" />
<Dependency Version="|VisualStudioInteractiveWindow;GetBuildVersion|" DisplayName="VisualStudio Interactive Components" Id="1F42C6D0-F876-4AF0-8185-1BEB0A325BB2" />
</Dependencies>
<Assets>
......@@ -22,4 +22,4 @@
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="Roslyn.InteractiveEditorFeatures.dll" />
<Asset Type="Microsoft.VisualStudio.VsPackage" Path="BindingPath.pkgdef" />
</Assets>
</PackageManifest>
\ No newline at end of file
</PackageManifest>
......@@ -5872,5 +5872,46 @@ static string F(int a, int b, int c)
}
}");
}
[WorkItem(62)]
[Fact, Trait(Traits.Feature, Traits.Features.Formatting)]
public void SpaceAfterWhenInExceptionFilter()
{
const string expected = @"class C
{
void M()
{
try
{
if (x)
{
G();
}
}
catch (Exception e) when (H(e))
{
}
}
}";
const string code = @"class C
{
void M()
{
try
{
if(x){
G();
}
}
catch(Exception e) when (H(e))
{
}
}
}";
AssertFormat(expected, code);
}
}
}
......@@ -138,6 +138,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Telemetry" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
<InternalsVisibleTo Include="Roslyn.InteractiveFeatures" />
<InternalsVisibleTo Include="Roslyn.InteractiveEditorFeatures" />
......
......@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading;
using System.Xml;
using XmlNames = Roslyn.Utilities.DocumentationCommentXmlNames;
......@@ -71,6 +72,11 @@ private DocumentationComment()
ExceptionTypes = ImmutableArray<string>.Empty;
}
/// <summary>
/// Cache of the most recently parsed fragment and the resulting DocumentationComment
/// </summary>
private static volatile DocumentationComment s_cacheLastXmlFragmentParse;
/// <summary>
/// Parses and constructs a <see cref="DocumentationComment" /> from the given fragment of XML.
/// </summary>
......@@ -78,7 +84,15 @@ private DocumentationComment()
/// <returns>A DocumentationComment instance.</returns>
public static DocumentationComment FromXmlFragment(string xml)
{
return CommentBuilder.Parse(xml);
var result = s_cacheLastXmlFragmentParse;
if (result == null || result.FullXmlFragment != xml)
{
// Cache miss
result = CommentBuilder.Parse(xml);
s_cacheLastXmlFragmentParse = result;
}
return result;
}
/// <summary>
......
......@@ -249,6 +249,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.CSharp" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Implementation" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.SolutionExplorer" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.Telemetry" />
<InternalsVisibleTo Include="Microsoft.VisualStudio.LanguageServices.VisualBasic" />
<InternalsVisibleTo Include="csi" />
<InternalsVisibleTo Include="Roslyn.CSharp.InteractiveEditorFeatures" />
......@@ -928,4 +929,4 @@
<Import Project="..\..\..\..\build\VSL.Imports.Closed.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
</ImportGroup>
</Project>
\ No newline at end of file
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册