Skip to content

Commit

Permalink
Resolve ts->js mapping relative to rootDir
Browse files Browse the repository at this point in the history
Fixes #1365
  • Loading branch information
mickaelistria committed Oct 16, 2023
1 parent 753e225 commit 272c6ad
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ protected boolean configureAdditionalParameters(ILaunchConfiguration config, Map
boolean outDirOrFileIsSet = false;

String outDir = co.get(OUT_DIR) instanceof String o ? o.trim() : null;
File outDirFile = parentDirectory;
if (outDir != null && outDir.length() > 0 && !".".equals(outDir) && !"./".equals(outDir)) {
File outDirFile = new File(parentDirectory, outDir);
outDirFile = new File(parentDirectory, outDir);
try {
outDir = outDirFile.getCanonicalPath();
} catch (IOException e) {
Expand All @@ -287,8 +288,9 @@ protected boolean configureAdditionalParameters(ILaunchConfiguration config, Map

param.put("rootPath", tsConfigFile.getParentFile().getAbsolutePath());
String rootDir = co.get(ROOT_DIR) instanceof String o ? o.trim() : null;
File rootDirFile = parentDirectory;
if (rootDir != null && rootDir.length() > 0 && !".".equals(outDir) && !"./".equals(outDir)) {
File rootDirFile = new File(parentDirectory, rootDir);
rootDirFile = new File(parentDirectory, rootDir);
try {
rootDir = rootDirFile.getCanonicalPath();
} catch (IOException e) {
Expand All @@ -298,6 +300,8 @@ protected boolean configureAdditionalParameters(ILaunchConfiguration config, Map
param.put(ROOT_DIR, rootDir);
param.put("rootPath", rootDir);
}
Path jsFile = outDirFile.toPath().resolve(rootDirFile.toPath().relativize(programFile.toPath().getParent().resolve(toJS(programFile.getName()))));
param.put("program", jsFile.toString());

if (!outDirOrFileIsSet && errorMessage == null) {
errorMessage = Messages.NodeDebug_TSConfigError_OutDirIsNotSet;
Expand Down

0 comments on commit 272c6ad

Please sign in to comment.