Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:37
    alrz commented #18093
  • 09:35
    alrz commented #18093
  • 09:35
    faso synchronize #43083
  • 09:34
    alrz commented #18093
  • 09:27
    sharwell labeled #43077
  • 09:26
    sharwell commented #43077
  • 09:26
    sharwell commented #42962
  • 09:24
    sharwell commented #42893
  • 09:23
    sharwell commented #42893
  • 09:20
    msftbot[bot] milestoned #42893
  • 09:20

    sharwell on master

    Add FirstAncestorOrSelf extensi… Move FirstAncestorOrSelf to Syn… Merge remote-tracking branch 'd… and 2 more (compare)

  • 09:20
    sharwell closed #42893
  • 09:11
    Corey-M edited #43090
  • 09:11
    Corey-M edited #43090
  • 09:10
    Corey-M opened #43090
  • 09:02

    dotnet-bot on release

    (compare)

  • 09:02

    dotnet-bot on release

    (compare)

  • 09:02

    dotnet-bot on release

    (compare)

  • 09:02

    dotnet-bot on release

    (compare)

  • 09:02

    dotnet-bot on release

    (compare)

VBAndCs
@VBAndCs
I almost solved every issue of the Complete provider, except re-viewing the completion list after first completion. I can live with that, but there is a major problem about onEvent attributes and data- attributes, which overwolming the list. The HTML editor shoes only on…. and data-… and clicking any of them shows a new list filled with all these items. I don't know how can I do that, since I have no way to trigger the list programmatically. Is there a way to add sub categories to the list?
Another remedy is to add filters to the list, with on and data- items are filtered out by default. Is this possible?
CyrusNajmabadi
@CyrusNajmabadi
you can trigger te list programatically
there are editor apis for this
Another remedy is to add filters to the list, with on and data- items are filtered out by default. Is this possible?
the filters are driven from the Tags added to completion items
VBAndCs
@VBAndCs
there are editor apis for this
Is there any sample?.. this area is so dark for me.
Joseph Musser
@jnm2
@CyrusNajmabadi It working
var something = (
    from resourceClass in resourceClasses
    from symbol in resourceClass.GetMembers().OfType<IPropertySymbol>()
    from reference in symbol.GetMethod.DeclaringSyntaxReferences
    group new { symbol, reference } by reference.SyntaxTree into propertiesBySyntaxTree
    let syntaxRoot = propertiesBySyntaxTree.Key.GetRoot()
    let semanticModel = compilation.GetSemanticModel(propertiesBySyntaxTree.Key)
    from property in propertiesBySyntaxTree
    let bodySyntax = (AccessorDeclarationSyntax)syntaxRoot.FindNode(property.reference.Span)
    select (
        Symbol: property.symbol,
        Body: (IMethodBodyOperation)semanticModel.GetOperation(bodySyntax))
    ).ToList();
CyrusNajmabadi
@CyrusNajmabadi
@VBAndCs i am unaware of any samples
VBAndCs
@VBAndCs
the filters are driven from the Tags added to completion items
CyrusNajmabadi
@CyrusNajmabadi
@jnm2 woot!
Joseph Musser
@jnm2
You'd be proud, grouping by syntax tree
VBAndCs
@VBAndCs
will all items appear and need to be filtered out?
CyrusNajmabadi
@CyrusNajmabadi
yes
Joseph Musser
@jnm2
Not sure I've ever written a LINQ query this big
Joseph Musser
@jnm2

Need to break this up:

var resourcePropertyMappings = (
    from resourceClass in resourceClasses
    from symbol in resourceClass.GetMembers().OfType<IPropertySymbol>()
    from reference in symbol.GetMethod.DeclaringSyntaxReferences
    group new { symbol, reference } by reference.SyntaxTree into propertiesBySyntaxTree
    let syntaxRoot = propertiesBySyntaxTree.Key.GetRoot()
    let semanticModel = compilation.GetSemanticModel(propertiesBySyntaxTree.Key)
    from property in propertiesBySyntaxTree
    let body = (IMethodBodyOperation)semanticModel.GetOperation(syntaxRoot.FindNode(property.reference.Span))
    from invocation in body.Descendants().OfType<IInvocationOperation>()
    where SymbolEqualityComparer.Default.Equals(invocation.TargetMethod, getObjectMethod)
    let resourceName = invocation.Arguments[0].Value.ConstantValue.Value as string
    where resourceName is { }
    select (Symbol: property.symbol, ResourceName: resourceName)).ToList();

next step is to find all refs for each property symbol that ends up in that list to detect unused properties

VBAndCs
@VBAndCs
What is the VB completion provider that completes method names after . ?
CyrusNajmabadi
@CyrusNajmabadi
can you be more specific
what do you mean "that completes method names after ."
VBAndCs
@VBAndCs
Thanks. I will look at it, maybe I find something to use.
VBAndCs
@VBAndCs
Is there a way to show some items on top of the list regardless of alphabetic order? Something like intellicode suggestions?
CyrusNajmabadi
@CyrusNajmabadi
yes
Yair Halberstadt
@YairHalberstadt
Is there any way in VS to select whether to run unit tests on framework or core?
VBAndCs
@VBAndCs
I can't use JsonSerializer in the completion provider inside Roslyn. It causes an exception and it's assembly can't be loaded. Why?
I was trying to serialize the copmletion context to use it to test the provider outside Roslyn
By the way, it will be helpful, if the info window that appears in debug mode to show the object details, offers a way to save the object to a file
If this already can be done, how?
CyrusNajmabadi
@CyrusNajmabadi
It causes an exception and it's assembly can't be loaded. Why?
what exception do you get?
it's hard to answer questions with limited information
VBAndCs
@VBAndCs
Assembly can't be loaded. I used the latest Json Nuget, then tried the lowest available version, but get the same exception.
CyrusNajmabadi
@CyrusNajmabadi
why can't the assembly be loaded?
VBAndCs
@VBAndCs
I will answer you tomorrow. I turned of the machine and almost sleep.
VBAndCs
@VBAndCs
What type of library to use with Completion provider? A class library for .NET framework or Roslyn or .NET Standard?
CyrusNajmabadi
@CyrusNajmabadi
we use standard
VBAndCs
@VBAndCs
OK
VBAndCs
@VBAndCs
Nugets brought back dll hell. I have this error in a test project
Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Microsoft.CodeAnalysis.Common. Install/reference Microsoft.CodeAnalysis.Common 3.5.0 directly to project VbXmlCompletionProvider.Tests to resolve this issue.
VbXmlCompletionProvider.Tests -> VbXmlCompletionProvider -> Microsoft.CodeAnalysis.VisualBasic.Features 3.5.0 -> Microsoft.CodeAnalysis.Common (= 3.5.0)
VbXmlCompletionProvider.Tests -> SmartAnalyzers.RoslynTestKit 3.0.61 -> Microsoft.CodeAnalysis.CSharp.Workspaces 2.4.0 -> Microsoft.CodeAnalysis.CSharp 2.4.0 -> Microsoft.CodeAnalysis.Common (= 2.4.0). VbXmlCompletionProvider.Tests C:\Users\MHG\source\repos\VbXmlCompletionProvider\VbXmlCompletionProvider.Tests\VbXmlCompletionProvider.Tests.vbproj 1
I tried to install the mentioned package, but nithing changes.
CyrusNajmabadi
@CyrusNajmabadi
sorry, i know nothing about that. i don't generally mess with roslyn's nuget packages.
Joseph Musser
@jnm2

@VBAndCs You might have told it to do conflicting things. If you know the versions you have are all correct, it tells you exactly what to do in the text you pasted:

Install/reference Microsoft.CodeAnalysis.Common 3.5.0 directly to project VbXmlCompletionProvider.Tests to resolve this issue.

That message should not appear once you have done this.
VBAndCs
@VBAndCs
The conflict results from the RoslynTestKit nuget. Seems to use an old version of the conflicted nuget. Why can't two assemblies have different Nuget versions? They are isolated after all.
CyrusNajmabadi
@CyrusNajmabadi
what do you mean by 'isolated'?
VBAndCs
@VBAndCs
I fixed the issue by downloading the source and updating its NuGets. This wll be a real issue with closed source nugets, or open source nugets with a chain of nuget dependencies that can cause the conflict. We literally back to dll hell days.
VBAndCs
@VBAndCs
RoslynTestKit is very helpful. It always to test comp prov easily.