@guanlin4924/devflow-pi 0.1.74 → 0.1.75
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/package.json
CHANGED
package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/structured_scope.py
CHANGED
|
@@ -131,8 +131,39 @@ class StructuredScopeAdapter(Adapter):
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
def _without_strings_and_comments(line: str) -> str:
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
"""Mask strings/comments without backtracking on malformed source lines.
|
|
135
|
+
|
|
136
|
+
The old back-reference regex could spend unbounded time on an unterminated
|
|
137
|
+
quote. This scanner is linear and keeps character positions stable for
|
|
138
|
+
declaration matching.
|
|
139
|
+
"""
|
|
140
|
+
chars = list(line)
|
|
141
|
+
quote = None
|
|
142
|
+
escaped = False
|
|
143
|
+
index = 0
|
|
144
|
+
while index < len(line):
|
|
145
|
+
character = line[index]
|
|
146
|
+
if quote is not None:
|
|
147
|
+
chars[index] = " "
|
|
148
|
+
if escaped:
|
|
149
|
+
escaped = False
|
|
150
|
+
elif character == "\\":
|
|
151
|
+
escaped = True
|
|
152
|
+
elif character == quote:
|
|
153
|
+
quote = None
|
|
154
|
+
index += 1
|
|
155
|
+
continue
|
|
156
|
+
if character in {"'", '"', "`"}:
|
|
157
|
+
quote = character
|
|
158
|
+
chars[index] = " "
|
|
159
|
+
index += 1
|
|
160
|
+
continue
|
|
161
|
+
if character == "#" or (character == "/" and index + 1 < len(line) and line[index + 1] == "/"):
|
|
162
|
+
for position in range(index, len(chars)):
|
|
163
|
+
chars[position] = " "
|
|
164
|
+
break
|
|
165
|
+
index += 1
|
|
166
|
+
return "".join(chars)
|
|
136
167
|
|
|
137
168
|
|
|
138
169
|
def _brace_end(lines: List[str], start: int) -> int:
|
|
@@ -273,6 +273,8 @@ def command_scan(args) -> int:
|
|
|
273
273
|
rel_path = _workspace_rel(root, path)
|
|
274
274
|
if rel_path in indexed_paths:
|
|
275
275
|
continue
|
|
276
|
+
if parsed == 0 or parsed % 100 == 0:
|
|
277
|
+
progress.emit("parse", f"parsing {rel_path}", codebase=codebase.name, parsed=parsed, total=len(all_files), path=rel_path)
|
|
276
278
|
adapter = adapters[-1]
|
|
277
279
|
try:
|
|
278
280
|
text = path.read_text(encoding="utf-8", errors="ignore")
|
package/src/constants.ts
CHANGED