DeltaXML / vscode-xpath-notebook

Visual Studio Code notebook extension for XPath 3.1
MIT License
22 stars 1 forks source link

Running XPath notebooks in CodeSpaces #5

Open RandomFractals opened 3 years ago

RandomFractals commented 3 years ago

might need more fs fixing for CodeSpaces. Are you using workspace.fs to load your built-in XSLT stylesheets?

xpath-code-spaces

potentially related to #4

Altho it works on Windows now. see: https://github.com/DeltaXML/vscode-xpath-notebook/issues/2#issuecomment-890405243

pgfearo commented 3 years ago

As CodeSpaces on GitHub is still in Beta (and I haven't signed up for it yet) I'm inclined to defer investigation of this.

Are you suggesting that I need to use workspace.fs? I haven't had much success in the past with figuring out how to process URIs that do not have the file:: scheme - so have much to learn. VS Code documentation seems to be a bit sparse here.

pgfearo commented 3 years ago

This VS Code Remote Repositories may be useful for reference.

RandomFractals commented 3 years ago

@pgfearo you probably don't need that.

However, you do need to make sure you use path.join to construct file path for your built-in stylesheets to ensure they load properly on different platforms and operating systems.

Example:

    const extensionPath: string = _context.asAbsolutePath('./');
        if (notebookUrl) {
            const notebookUri: Uri =  Uri.file(path.join(extensionPath, notebookUrl));
            // open data table example notebook
            commands.executeCommand(constants.VSCodeOpenCommand, notebookUri);  
        }
    }

You can find more info on that feature I just added here: https://github.com/RandomFractals/vscode-data-table/issues/75

I've used similar setup in Vega Viewer and Geo Data Viewer and have not seen any complaints from devs on different platforms.

so, that's the alternative if you don't want to use workspace.fs just yet. Altho, that api is fairly stable and been around for some time now.

Btw, you can use that built-in notebooks example setup for your examples if you'd like. should be easy copy and paste of the setup I just created in my data table extension.

Here is a pic of that notebook examples quick pick list feature:

data-table-notebook-examples