Skip to content

TypeMapper

GaN8373 edited this page Jun 19, 2025 · 6 revisions

Setting

Mapping data is modified in the settings page of JetBrains IDEs; importing results with the same name repeatedly will overwrite the previous ones.

映射数据在jetbrainsIDEs的设置页面进行修改, 重复导入同名的结果会被覆盖.

Mapper intro

Regex can remap the element matched by $1; if the mapping fails, it will always result in the "undefined" string.

Regex可以会将$1匹配到的元素进行重新映射, 如果映射失败, 都会得到"undefined"字符串.

$1 Capture group will not perform regular expression matching again.

捕获组将不会再进行正则表达式匹配.

Action represents the matching action; Regex is regular expression matching, then Eq is an equality comparison. The matching order is Regex->Eq->StartsWith->EndsWith->Contains. A conversion to lowercase will be performed before comparison.

Action表示匹配的动作, Regex是正则匹配, 然后是Eq是等于比较, 匹配顺序为Regex->Eq->StartsWith->EndsWith->Contains. 会进行全小写转换再比较

JsonExample

[
  {
    "Action": "Regex",
    "Rule": "(.*)\\[\\]",
    "Type": "IEnumerable<$1>"
  },
  {
    "Action": "StartsWith",
    "Rule": "VARCHAR",
    "Type": "string"
  },
  {
    "Action": "StartsWith",
    "Rule": "NVARCHAR",
    "Type": "string"
  },
  {
    "Action": "StartsWith",
    "Rule": "TEXT",
    "Type": "string"
  },
  {
    "Action": "StartsWith",
    "Rule": "CHAR",
    "Type": "string"
  }
]

Clone this wiki locally