Filepath discovery from Type fails when filepath does not contain any portion of the Namespace
@alelom is already working on this.
Since Feb 14, 2022.
Assessment
This issue has not been assessed yet.
Description
Description:
Currently, the Filepath discovery from Type works so that we match a certain type with a certain repository .cs file by taking the filepath of a .cs file in the Github folder:
- whose FileName matches the Type.Name
- whose Directory has a subfolder that matches what we call "namespace group". The "namespace group" of the Type is the portion of the namespace that gives the "disciplinary category", e.g.
Geometry,Structure. This is easily extracted from the Type.Namespace e.g.BH.oM.Geometry.SomethingBH.oM.Structure.Something. We need this second condition because to avoid matching Types with the same name to the wrong.csfiles (e.g. aBH.oM.Geometry.Facerisks matching with a 3DRepo_ToolkitFace.csfile).
This second condition however does not always work. For example, StructuralEngineering_Toolkit defines certain types under the namespace BH.oM.Structure. We cannot find any file in the StructuralEngineering_Toolkit whose filepath includes the name "structure", however.
A solution could to actually read the content of the files and get the actual namespace associated to the file itself by reading the raw text (find the text namespace ___someText___ { with a regex).
Steps to reproduce:
Expected behaviour:
Test file(s):
- Dominant language
- C#
- Stars
- 10
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BHoM/RDF_Prototypes
-
type:bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
BHoM/RDF_Prototypes#132 ·
-
type:bug
BHoM/RDF_Prototypes#120 · 1 assignee ·
-
type:bug
BHoM/RDF_Prototypes#107 · 1 assignee ·
-
type:feature
BHoM/RDF_Prototypes#106 · 1 assignee ·
-
type:feature
BHoM/RDF_Prototypes#94 · 1 assignee ·
All issues in BHoM/RDF_Prototypes
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·