Skip to content

Commit 94c40da

Browse files
committed
Use vs-code relativePath function
1 parent 1534488 commit 94c40da

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src-plugin/extension.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ class ARCPanel {
157157
}
158158

159159
public async readARC() {
160-
const arc_root = vscode.workspace.workspaceFolders?vscode.workspace.workspaceFolders[0].uri.path:'';
160+
// const arc_root = vscode.workspace.workspaceFolders?vscode.workspace.workspaceFolders[0].uri.fsPath:'';
161+
// console.log("[arc-vs-code] Reading ARC from: ", arc_root);
161162
const xlsx_uris = await vscode.workspace.findFiles('**/*.xlsx');
162-
const relative_xlsx_uris = xlsx_uris.map(i=>i.path.replace(arc_root+'/',''));
163+
const relative_xlsx_uris = xlsx_uris.map(i=> vscode.workspace.asRelativePath(i));
163164
console.log("[arc-vs-code] Found .xlsx files: ", xlsx_uris);
164165
console.log("[arc-vs-code] Adjusted paths: ", relative_xlsx_uris);
165166
await this.send({api:'read_ARC',xlsx_paths:relative_xlsx_uris});

src-vue/src/App.vue

+2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ const VSCODE_API = {
5050
},
5151
5252
read_ARC: async inMessage=>{
53+
console.log('[arc-vs-code | VUE] Received inner read_ARC', inMessage);
5354
const arc = ARC.fromFilePaths(inMessage.xlsx_paths);
5455
const contracts = arc.GetReadContracts();
56+
console.log('[arc-vs-code | VUE] Received contracts:', contracts);
5557
for(const contract of contracts){
5658
const response = await VSCODE_API.send({api:'read',path:contract.Path});
5759
const buffer = new Uint8Array(response.data.data);

0 commit comments

Comments
 (0)