Skip to content

Commit

Permalink
Remove docfx from snippet extractor
Browse files Browse the repository at this point in the history
We were only using it to work out the uid, and that's easily done
(for the members we care about) using
ISymbol.GetDocumentationCommentId.

This means we don't need a different nuget.config either. Hooray.
  • Loading branch information
jskeet committed Jan 29, 2018
1 parent 06dc456 commit f1639e9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
10 changes: 0 additions & 10 deletions NuGet.config

This file was deleted.

12 changes: 0 additions & 12 deletions build/SnippetExtractor/SnippetExtractor.csproj
Expand Up @@ -12,19 +12,7 @@

<!-- Roslyn dependencies -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="2.6.1" />

<!-- docfx dependencies -->
<PackageReference Include="Microsoft.DocAsCode.Metadata.ManagedReference" Version="2.28.2" />
<PackageReference Include="Microsoft.DocAsCode.Plugins" Version="2.28.2" />
<PackageReference Include="Microsoft.DocAsCode.Common" Version="2.28.2" />
<PackageReference Include="Microsoft.DocAsCode.YamlSerialization" Version="2.28.2" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions build/SnippetExtractor/SnippetFileSyntaxTree.cs
Expand Up @@ -4,7 +4,6 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.DocAsCode.Metadata.ManagedReference;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -44,7 +43,8 @@ private IEnumerable<SourceSnippet> GetSnippets(MethodDeclarationSyntax method)
{
throw new Exception($"Couldn't get a symbol for Snippet.For argument: {snippetFor.ToString()}");
}
var uid = VisitorHelper.GetId(targetSymbol);
// docfx UIDs don't have the M: (etc) prefix.
var uid = targetSymbol.GetDocumentationCommentId().Substring(2);
var block = snippetFor.Ancestors().OfType<BlockSyntax>().First();
yield return new SourceSnippet(uid, block.GetLines(), usings);
}
Expand Down

0 comments on commit f1639e9

Please sign in to comment.