Skip to content

Commit 597cbb3

Browse files
committed
Display resolved file names
1 parent fa41080 commit 597cbb3

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/views/solution-outline/tree-structure/solution-outline-file-item.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,21 @@ export class FileItemBuilder extends SolutionOutlineItemBuilder {
4444

4545
const hasCmsisPackRoot = fileValue.indexOf('${CMSIS_PACK_ROOT}') !== -1;
4646
const resolvedFilePath = this.resolveFilePath(hasCmsisPackRoot, fileValue);
47-
const fileBaseName = path.basename(fileValue);
47+
const fileBaseName = path.basename(resolvedFilePath);
4848
const resourcePath = hasCmsisPackRoot ? resolvedFilePath : f.resolvePath(resolvedFilePath);
4949
const description = isApi ? ' (API)' : undefined;
5050
const rootFileName = f.rootFileName;
5151

5252
const cfileItem = this.createFileItem(cgroupItem, fileBaseName, resourcePath, description);
5353

54+
// set special tooltip if sequences are resolved
55+
if(!hasCmsisPackRoot && resolvedFilePath !== fileValue) {
56+
const tooltip =
57+
`- resolved: \`${resourcePath}\`\n` +
58+
`- original: \`${fileValue}\``;
59+
cfileItem.setAttribute('tooltip', tooltip);
60+
}
61+
5462
// Check if file is excluded based on context restrictions
5563
if (this.context && !matchesContext(f, this.context)) {
5664
cfileItem.setAttribute('excluded', '1');

test-data/solutions/USBD/CmsisViewTreeRef.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,21 @@ solution
3232
projectUri=TEST_DIR/solutions/USBD/HID/HID.cproject.yml
3333
expandable=1
3434
file
35-
label=$Dname$.test
35+
label=STM32U585AIIx.test
3636
expandable=0
3737
resourcePath=TEST_DIR/solutions/USBD/HID/STM32U585AIIx.test
3838
features=file
39+
tooltip=- resolved: `TEST_DIR/solutions/USBD/HID/STM32U585AIIx.test`
40+
- original: `$Dname$.test`
3941
fileUri=$Dname$.test
4042
projectUri=TEST_DIR/solutions/USBD/HID/HID.cproject.yml
4143
file
4244
label=testOutput.test
4345
expandable=0
4446
resourcePath=TEST_DIR/solutions/USBD/out/HID/B-U585I-IOT02A/Release/testOutput.test
4547
features=file
48+
tooltip=- resolved: `TEST_DIR/solutions/USBD/out/HID/B-U585I-IOT02A/Release/testOutput.test`
49+
- original: `$OutDir()$/testOutput.test`
4650
fileUri=$OutDir()$/testOutput.test
4751
projectUri=TEST_DIR/solutions/USBD/HID/HID.cproject.yml
4852
file

0 commit comments

Comments
 (0)