Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有几个功能想要支持,模板,二维数组 #12

Closed
zjwps opened this issue Apr 12, 2017 · 7 comments
Closed

有几个功能想要支持,模板,二维数组 #12

zjwps opened this issue Apr 12, 2017 · 7 comments

Comments

@zjwps
Copy link

zjwps commented Apr 12, 2017

1.期望C#的数据类模板可以做成一个外部文件,现在是写在代码里的不是很方便。
2.期望有办法支持二维数组。
3.注释的那一行期望能支持多行,现在多行生成的C#代码不正确.

@davyxu
Copy link
Owner

davyxu commented Apr 13, 2017

  1. 不是很懂说的什么意思
  2. 不支持二维数组, 也没有支持计划
  3. 请具体说明

@zjwps
Copy link
Author

zjwps commented Apr 13, 2017

1.现在的config.cs文件的生成是用printer/csharp.go 来生成的,期望可以用一个类似json文件来自定义一些东西。比如在public partial class 前面加上 [System.Serializable]。

我现在改源码生成自定义数据类是这种格式
[System.Serializable]
public partial class WeightInt
{
/// < summary >
///值
/// < /summary >
public int value = 1;// i
/// < summary >
///权重
/// < /summary >
public int weight = 100;// w
}
2.二维数组不支持的话,现在我用json替代了,比如分隔符是| 写成 [1,2]|[3,4]
3.注释的那一行如果有换行符的话生成的注释有问题。比如
1.注释1
2.注释2
生成的config.cs 里面
//1.注释1
2. 注释2

3 我改了一下printer/csharp.go 最主要的修改其中的Comment方法

func (self csharpField) Comment() string {

if self.FieldDescriptor.Comment == "" {
	return ""
}

return "/// <summary> \n		///"  + strings.Replace(self.FieldDescriptor.Comment, "\n", "\n		///", -1) +"\n		/// </summary>"

}

@zjwps
Copy link
Author

zjwps commented Apr 13, 2017

Excel忽略行现在支持了没有?没有的话稍微有点不方便。

@davyxu
Copy link
Owner

davyxu commented Apr 13, 2017

忽略行特性暂时不添加, 因为有内容歧义

davyxu added a commit that referenced this issue Apr 13, 2017
调整: C#风格的字段注释
@davyxu
Copy link
Owner

davyxu commented Apr 13, 2017

已经添加C#类头添加属性

@davyxu
Copy link
Owner

davyxu commented Apr 13, 2017

你可以在使用空行作为内容分割, 空行后的内容不会被导出

@zjwps
Copy link
Author

zjwps commented Apr 13, 2017

不错不错,赞。

@davyxu davyxu closed this as completed Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants