Skip to content

Commit b47a470

Browse files
committed
修复导出keil时,文件类型生成bug
1 parent a089b43 commit b47a470

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/KeilXmlParser.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,19 @@ export abstract class KeilParser<T> {
164164
}
165165

166166
protected JudgeFileType(f: File): number {
167-
switch (f.suffix.toLowerCase()) {
168-
case '.c':
167+
168+
if (AbstractProject.cppfileFilter.test(f.name)) {
169+
if (f.suffix.toLowerCase() == '.c')
169170
return 1;
170-
case '.s':
171-
case '.a51':
172-
return 2;
173-
case '.cpp':
171+
else
174172
return 8;
175-
default:
176-
return 5;
177173
}
174+
175+
else if (AbstractProject.asmfileFilter.test(f.name)) {
176+
return 2;
177+
}
178+
179+
return 5;
178180
}
179181

180182
// example: file: 'c:\aa\bb', path: '../cc/f.txt', result: 'c:\aa\cc\f.txt'

0 commit comments

Comments
 (0)