Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "View Web Page" functionality #1377

Closed
isc-solon opened this issue Jun 14, 2024 · 3 comments
Closed

Add "View Web Page" functionality #1377

isc-solon opened this issue Jun 14, 2024 · 3 comments

Comments

@isc-solon
Copy link
Collaborator

Consider the two custom "links" below.

"objectscript.conn": {
        "active": true,
        "links": {
            "Launch Zen page": "${serverUrl}/csp/${namespace}/${classname}.cls",
            "Launch CSP page": "${serverUrl}/csp/${namespace}/hello.csp"
        }
    }

These links are a way to replicate the "View Web Page" button in InterSystems Studio. They both appear when clicking the connection info in the status bar, and they both work. But notice that the CSP link is specific to the "hello.csp" page. There's no way to make it generic like the Zen link. That's because:

  1. You can't use ${filename} because that substitution is not supported.
  2. You can't use ${classname} because hello.csp is not a class file, so classname is empty. Trying this prevents the link from appearing at all.

You can't use View Other to view the corresponding class and then use the Zen link to launch that because the class uses CSPURL to prevent using the .cls extension.

I searched Issues to see if this ability has been requested and I couldn't find anything. So maybe it's not worth doing. But if serverActions.ts had code something like the code below, a generic link like this would work "${serverUrl}/csp/${namespace}/${filename}.csp".

  const filename = file && file.name.toLowerCase().endsWith(".csp") ? file.name.slice(0, -4) : "";
  const filenameEncoded = encodeURIComponent(filename);

and:

    // Skip link if it requires a filename and we don't currently have one
    if (filename == "" && (rawLink.includes("${filename}") || rawLink.includes("${filenameEncoded}"))) {
      continue;
    }

and:

      .replace("${filename}", filename)
      .replace("${filenameEncoded}", filenameEncoded);
@isc-bsaviano
Copy link
Contributor

@isc-solon I'm treating this as a request for "View Web Page" functionality. I'll discuss this with Raj.

@isc-bsaviano isc-bsaviano changed the title Enable adding a custom link for launching a "pure" CSP page from VS Code Add "View Web Page" functionality Jun 17, 2024
@isc-rsingh
Copy link
Member

@isc-bsaviano
Copy link
Contributor

There's not enough interest to warrant spending time on this

@isc-bsaviano isc-bsaviano closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants