Skip to content

Command line args for VSCode #8

@thbeu

Description

@thbeu

The command line args did not work on my setup (code.exe not on PATH, reuse-window option). Here's my modification:

--- a/DGVisualStudioCodeIntegration.pas
+++ b/DGVisualStudioCodeIntegration.pas
@@ -130,12 +131,11 @@ begin
   if not SaveAllModules then
     exit;
 
-  var cmdline:string;
-  if sourceInfos.Line < 0 then
-    cmdline := Format('cmd /c "code --reuse-window %s"', [ProjectPath])
-  else
-    cmdline := Format('cmd /c "code --reuse-window %s -g %s:%d:%d"', [ProjectPath, FileName, sourceInfos.Line, sourceInfos.Column]);
-
+  var cmdline: string;
+  if sourceInfos.Line < 0 then
+    cmdline := Format('"%s" -r "%s"', ['C:\Program Files\Microsoft VS Code\Code.exe', FileName])
+  else
+    cmdline := Format('"%s" -r -g "%s":%d:%d', ['C:\Program Files\Microsoft VS Code\Code.exe', FileName, sourceInfos.Line, sourceInfos.Column]);
 
   var executor := TOSCommandLineExecutor.Create(nil);
   try

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions