@feng0531/dsh-code-review 0.26.3 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.27.1
4
+
5
+ - C#候选同名引用判断改一次标识符计数,避免每调用重扫整文件;同名多次保守跳过。
6
+ - 真实Git基线/目标C#自动上下文及定义提示、脏工作副本不泄漏/哈希稳定/status不改,276测试通过。
7
+
8
+ ## 0.27.0
9
+
10
+ - C#同目录静态零参调用Type.cs必要上下文有界探针,沿用批准路径/changed排除及历史对象查询。
11
+ - 无using/dynamic/同名其他引用且file-scoped namespace窄语法,捕获不证明绑定;275测试通过。
12
+
3
13
  ## 0.26.3
4
14
 
5
15
  - 历史依赖链接/目录/子模块参与路径歧义,不先过滤后误判唯一普通文件;仍禁止捕获非普通对象正文。
package/README.md CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
  ## 当前状态
6
6
 
7
- 当前代码版本为 0.26.3
7
+ 当前代码版本为 0.27.1
8
+
9
+ C#自动上下文支持窄语法同目录Type.cs静态零参调用探针,需file-scoped namespace且无using/dynamic/注释字符串/同名其他引用;捕获后定义提示再校验命名空间。不是编译器解析,不全仓寻找类型。
8
10
 
9
11
  历史捕获用diff-tree精确端点变更元数据,不前置完整枚举文件树;显式上下文/规则和直接导入依赖按字面非递归路径查询。自动依赖最多512个待查路径,仍保留200变更/20上下文/4MiB快照限制,大树小提交不因无关文件元数据超限。
10
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-code-review",
3
- "version": "0.26.3",
3
+ "version": "0.27.1",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
@@ -10,6 +10,10 @@ export function contextCandidates(files, trackedPaths, {maxCandidates=20,onProbe
10
10
  relativePath(f.path);if(f.eligibility!=='reviewable'||f.rightExists===false)continue;
11
11
  const text=f.right?.text;if(typeof text!=='string'||Buffer.byteLength(text)>256*1024)continue;
12
12
  if(text.includes('/*')||text.includes(String.fromCharCode(96))||text.includes('R"')||/\\\r?\n/.test(text))continue;
13
+ if(f.path.endsWith('.cs')&&!/["'\x60#]|\/\/|\busing\b|\bdynamic\b/.test(text)){
14
+ const namespaces=[...text.matchAll(/^\s*namespace\s+([A-Za-z_][A-Za-z0-9_.]*)\s*;\s*$/gm)];
15
+ if(namespaces.length===1){const tokens=new Map();for(const match of text.matchAll(/\b[A-Za-z_][A-Za-z0-9_]*\b/g))tokens.set(match[0],(tokens.get(match[0])??0)+1);const lines=text.split('\n');for(let i=0;i<lines.length;i++){const call=/^\s*(?:await\s+)?([A-Za-z_][A-Za-z0-9_]*)\.([A-Za-z_][A-Za-z0-9_]*)\s*\(\s*\)\s*;\s*$/.exec(lines[i]);if(!call)continue;if(tokens.get(call[1])!==1)continue;const candidate=path.posix.join(path.posix.dirname(f.path),call[1]+'.cs');onProbe?.([candidate]);add(candidate,f.path,'same-directory-csharp-static-call');}}
16
+ }
13
17
  const cpp=/\.(c|cc|cpp|cxx|h|hh|hpp|hxx|shader|hlsl|glsl|cginc|hlsli|compute)$/i.test(f.path),js=/\.(mjs|cjs|js|jsx|ts|tsx)$/i.test(f.path);
14
18
  if(cpp&&/^\s*#\s*(if|ifdef|ifndef|elif|else|define|undef)\b/m.test(text))continue;
15
19
  for(const line of text.split('\n')){