lostintangent / codeswing

VS Code extension for building web applications ("swings") using a interactive and editor-integrated coding environment
https://aka.ms/codeswing
MIT License
977 stars 45 forks source link

CodeTour inside of codeswing uses incorrect subdirectories #24

Open lucidbard opened 3 years ago

lucidbard commented 3 years ago

Current behavior: When a new CodeTour is recorded inside of a nested CodeSwing saved within a subdirectory of a workspace, the tour file assumes that all paths are relative to the directory root and not the CodeSwing root or the "main.tour" file location.

This seems to only happen in multi-step CodeSwing (with each step inside a subdirectory).

Expected behavior: Either the tour file's location in the workspace directory structure should be used to determine the location of the files in the tour (thus making it more portable when moving the tour and respective files) or CodeSwing's "record tour" feature should add the relative location of the file with respect to the root of the workspace (and not the root of the codeswing) in order to match the expected input for CodeTour.

Steps to reproduce:

Workaround None at this time.

lostintangent commented 3 years ago

Quick question: how are you recording the CodeTour? By using the CodeTour tree view/commands, or by using the "in-swing" experience? In the former case, the tour would be written to the .tours folder of your workspace. Whereas the later would be written as a main.tour file in the opened swing. So I just want to make sure the investigate the right scenario. Thanks!

lucidbard commented 3 years ago

I used the triple dots from the CodeSwing windows, so likely the case where the tour is residing in subdirectory. I also think CodeSwing ignores subdirectories.

lucidbard commented 2 years ago

Just another note -- it simply writes the relative directory from the root of the codetour subdirectory, rather than from the root of the workspace when the codetour step is recorded. I was able to manually edit the main.tour file to have the path including the path to the codeswing and the tour worked correctly.