From fe4be418790a0feaac096260f10aff9944137f94 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Tue, 9 Jan 2024 13:34:08 -0500 Subject: [PATCH 1/2] Take in account for possible ASP in compile path --- src/api/errors/diagnostics.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/api/errors/diagnostics.ts b/src/api/errors/diagnostics.ts index c8ffa1a67..5895d7b3d 100644 --- a/src/api/errors/diagnostics.ts +++ b/src/api/errors/diagnostics.ts @@ -99,6 +99,7 @@ export async function refreshDiagnosticsFromLocal(instance: Instance, evfeventIn } export async function handleEvfeventLines(lines: string[], instance: Instance, evfeventInfo: EvfEventInfo) { + const connection = instance.getConnection(); const config = instance.getConfig(); const asp = evfeventInfo.asp ? `${evfeventInfo.asp}/` : ``; @@ -141,7 +142,22 @@ export async function handleEvfeventLines(lines: string[], instance: Instance, e if (workspaceFolder && storage) { const workspaceDeployPath = storage.getWorkspaceDeployPath(workspaceFolder); - const relativeCompilePath = file.toLowerCase().replace(workspaceDeployPath, ''); + const deployPathIndex = file.toLowerCase().indexOf(workspaceDeployPath.toLowerCase()); + + let relativeCompilePath = (deployPathIndex !== -1 ? file.substring(0, deployPathIndex) + file.substring(deployPathIndex + workspaceDeployPath.length) : file); + + if (connection) { + // Belive it or not, sometimes if the deploy directory is symlinked into as ASP, this can be a problem + const aspNames = Object.values(connection.aspInfo); + for (const aspName of aspNames) { + const aspRoot = `/${aspName}`; + if (relativeCompilePath.startsWith(aspRoot)) { + relativeCompilePath = relativeCompilePath.substring(aspRoot.length); + break; + } + } + } + const diagnosticTargetFile = vscode.Uri.joinPath(workspaceFolder.uri, relativeCompilePath); if (diagnosticTargetFile !== undefined) { From e6e8fa240c0c1915dba1bdf9050123be7b4df682 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Tue, 9 Jan 2024 13:36:21 -0500 Subject: [PATCH 2/2] Do a build