Skip to content

Commit

Permalink
feat(c#): config for namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 25, 2022
1 parent aabc5d2 commit 01ac839
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import chapi.infra.Stack
import org.antlr.v4.runtime.ParserRuleContext

class CSharpFullIdentListener(val fileName: String) : CSharpAstListener() {
private var currentNamspace: String = ""
private var currentStruct: CodeDataStruct = CodeDataStruct();
private var codeContainer: CodeContainer = CodeContainer(FullName = fileName)
private var currentContainer: CodeContainer = codeContainer
Expand Down Expand Up @@ -52,6 +53,7 @@ class CSharpFullIdentListener(val fileName: String) : CSharpAstListener() {
if (namespaceDeclaration != null) {
if (namespaceDeclaration.qualified_identifier() != null) {
val nsName = ctx.namespace_declaration().qualified_identifier().text
currentNamspace = nsName
val container = CodeContainer(
FullName = fileName,
PackageName = nsName
Expand Down Expand Up @@ -85,6 +87,7 @@ class CSharpFullIdentListener(val fileName: String) : CSharpAstListener() {
val className = ctx!!.identifier().text
val codeDataStruct = CodeDataStruct(
NodeName = className,
Package = currentNamspace,
Position = buildPosition(ctx)
)

Expand Down

0 comments on commit 01ac839

Please # to comment.