         let scope = swiftDeclaringMessageName == nil ? "" : "static "
         let traitsType = descriptor.getTraitsType(context: context)
 
-        let fieldNamePath: String
-        if let message = swiftDeclaringMessageName {
-            fieldNamePath = "\(message).protoMessageName + \".\(fieldName)\""
-        } else if !protoPackageName.isEmpty {
-            fieldNamePath = "_protobuf_package + \".\(fieldName)\""
-        } else {
-            fieldNamePath = "\"\(fieldName)\""
-        }
-
         p.print("\(scope)let \(swiftRelativeExtensionName) = SwiftProtobuf.MessageExtension<\(extensionFieldType)<\(traitsType)>, \(swiftExtendedMessageName)>(\n")
         p.indent()
         p.print("_protobuf_fieldNumber: \(descriptor.number),\n")
-        p.print("fieldName: \(fieldNamePath),\n")
+        p.print("fieldName: \"\(fieldNamePath)\",\n")
         p.print("defaultValue: \(defaultValue)\n")
         p.outdent()
         p.print(")\n")

        self.apiType = descriptor.getSwiftApiType(context: context, isProto3: false)
        self.comments = file.commentsFor(path: path)
        self.fieldName = descriptor.isGroup ? descriptor.bareTypeName : descriptor.name
        if let parentProtoPath = parentProtoPath {
            self.protoPath = parentProtoPath + "." + fieldName
        } else {
            self.protoPath = fieldName
        }

        let baseName: String

    let descriptor: Google_Protobuf_FieldDescriptorProto
    let generatorOptions: GeneratorOptions
    let path: [Int32]
    let protoPackageName: String
    let swiftDeclaringMessageName: String?
    let context: Context
    let comments: String
    let fieldName: String
    let fieldNamePath: String
    let apiType: String
    let swiftFieldName: String
    let swiftHasPropertyName: String
