microsoft / codetour

VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.
https://aka.ms/codetour
MIT License
4.34k stars 109 forks source link

Default to use uri over file #206

Open worksofliam opened 2 years ago

worksofliam commented 2 years ago

Hi

I am wondering if it is possible to make the recording use the uri prop instead of the file prop.

I have an extension that implements a custom file system but does not make use of the workspace and have schemes ifs and member. The first item in the steps array is what I want all steps created to look like, vs the second.

{
  "$schema": "https://aka.ms/codetour-schema",
  "title": "example",
  "steps": [
    {
      "uri": "member:/BARRY/QRPGLESRC/CODETEST.RPGLE",
      "description": "Simple example.",
      "line": 10
    },
    {
      "file": "../../../../BARRY/QRPGLEREF/GENERIC.rpgle",
      "description": "Defined here.",
      "line": 13
    }
  ]
}

Thanks!

lostintangent commented 2 years ago

@worksofliam Hey! As you found, CodeTour steps already support referencing a uri instead of a file path, and furthermore, the file path can be relative to a virtual workspace, and still work. Could you explain your scenario a little bit better? Are you looking for users to be able to record tours for virtual files, that aren't contained within the open workspace?

worksofliam commented 2 years ago

Hi @lostintangent

I maintain an extension called Code for IBM i and we do not implement a workspace for our filesystem, but we do implement those schemes I mentioned. (We can talk about why we don't use it another time 😄 ). We have two filesystems which both implement readFile, writeFile, and stat

We have a tree view which lists items and clicking on the item will open the file up, for example, member:/LIBRARY/SOURCEFILE/MEMBER.cobol.

I am able to see that CodeTour will let me add a comment when recording a tour to my file, but in the JSON it is using the file property (as in my initial example) and instead I'd like to use the uri when adding a step in my tour from outside the workspace.

Does that help?