dotnet / dotnet/docfx

Region in <code> not found when parsing VB code

Open
#4,352 6 comments 0 reactions 0 assignees View on GitHub
dotnet dotnet: xml-comment
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operation System**: Win10

**DocFX Version Used**: 2.41.0

**Template used**: default

**Steps to Reproduce**:
1. Create a VB.NET project and use triple-tick comments on members (''') adding an example and **code** section
2. Add an external file to reference for the code (e.g. Example.vb) and **add source="Example.vb"** to the **code** element
3. Build and see documentation properly generated, bringing in the entire Example.vb file for the code.
4. Now, add a **region="foo"** to the code element, and add a region in the Example.vb file like so:

**#Region "foo"
...some code...
#End Region**

5. Build and check generated docs

**Expected Behavior**: The code example should only display the code within the region.

**Actual Behavior**: No code is brought into the example. Using the "region" attribute in a c# code project works just fine. Additionally, if you manually alter Examples.vb file to use the c# syntax for regions (#region foo...code...#endregion) the code is brought in. So this probably has something to do with the parser or regex being used not looking for VB formatted regions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.