Skip to content

Commit

Permalink
Merge pull request #134 from gjsjohnmurray/pre-sync-2.0.9
Browse files Browse the repository at this point in the history
Sync prerelease with 2.0.9
  • Loading branch information
gjsjohnmurray authored Apr 20, 2022
2 parents 600a930 + 5c08381 commit bb56abd
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 14,683 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.1.2022042001 (20-Apr-2022 pre-release)
* Add 2.0.8 and 2.0.9 changes.

## 3.1.2022020201 (02-Feb-2022 pre-release)
* Update vulnerable dependencies.

Expand All @@ -10,6 +13,16 @@

## 3.0.0 (27-Nov-2021 pre-release)
* Implement `intersystems-server-credentials` authentication provider.
*
## 2.0.9 (20-Apr-2022)
* Add support for server-side projects (#131).

## 2.0.8 (28-Mar-2022)
* Update vulnerable dependencies.

## 2.0.7 (02-Feb-2022)
* Also import user-specific connections from Windows registry (#107).
* Update vulnerable dependencies.

## 2.0.6 (28-Sep-2021)
* Apply `pathPrefix` correctly (#95, #99).
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# InterSystems Server Manager

> **Note:** The best way to install and use this extension is by installing the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) and following the [documentation here](https://intersystems-community.github.io/vscode-objectscript/).
InterSystems Server Manager is a Visual Studio Code extension for defining connections to [InterSystems](https://www.intersystems.com/) servers. These definitions can used by other VS Code extensions when they make connections. One example is the [ObjectScript extension](https://github.com/intersystems-community/vscode-objectscript) for code editing.

Expand All @@ -11,7 +12,7 @@ We are pleased to publish version 3 of this extension which improves the securit

> 2022-01-26: This is currently a **pre-release**.
> Thanks to [George James Software](https://georgejames.com) for backing this development effort.
Thanks to [George James Software](https://georgejames.com) for backing this development effort.

## The Authentication Provider

Expand Down
54 changes: 33 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 31 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "servermanager",
"displayName": "InterSystems Server Manager",
"version": "3.1.2022020202-SNAPSHOT",
"version": "3.1.2022042001-SNAPSHOT",
"preview": true,
"publisher": "intersystems-community",
"description": "Define connections to InterSystems servers. Browse and manage those servers.",
Expand All @@ -16,8 +16,7 @@
"multi-root ready"
],
"engines": {
"vscode": "^1.63.0",
"node": "^10.2.0"
"vscode": "^1.63.0"
},
"icon": "images/logo.png",
"categories": [
Expand Down Expand Up @@ -52,6 +51,7 @@
"tough-cookie": "^4.0.0"
},
"devDependencies": {
"@types/vscode": "^1.63.0",
"@types/glob": "^7.1.1",
"@types/keytar": "^4.4.2",
"@types/mocha": "^9.0.0",
Expand Down Expand Up @@ -425,6 +425,16 @@
"command": "intersystems-community.servermanager.viewNamespaceWebAppFiles",
"title": "View Web Application Files",
"icon": "$(telescope)"
},
{
"command": "intersystems-community.servermanager.editProject",
"title": "Edit Code in Project",
"icon": "$(edit)"
},
{
"command": "intersystems-community.servermanager.viewProject",
"title": "View Code in Project",
"icon": "$(eye)"
}
],
"submenus": [
Expand Down Expand Up @@ -532,6 +542,14 @@
{
"command": "intersystems-community.servermanager.viewNamespaceWebAppFiles",
"when": "false"
},
{
"command": "intersystems-community.servermanager.editProject",
"when": "false"
},
{
"command": "intersystems-community.servermanager.viewProject",
"when": "false"
}
],
"view/title": [
Expand Down Expand Up @@ -589,6 +607,16 @@
"when": "view == intersystems-community_servermanager && viewItem =~ /namespace$/",
"group": "inline@20"
},
{
"command": "intersystems-community.servermanager.editProject",
"when": "view == intersystems-community_servermanager && viewItem == project",
"group": "inline@10"
},
{
"command": "intersystems-community.servermanager.viewProject",
"when": "view == intersystems-community_servermanager && viewItem == project",
"group": "inline@20"
},
{
"command": "intersystems-community.servermanager.openPortalTab",
"when": "view == intersystems-community_servermanager && viewItem =~ /\\.server\\./",
Expand Down
25 changes: 18 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AUTHENTICATION_PROVIDER, ServerManagerAuthenticationProvider } from "./
import { importFromRegistry } from "./commands/importFromRegistry";
import { clearPassword, storePassword } from "./commands/managePasswords";
import { cookieJar } from "./makeRESTRequest";
import { ServerManagerView, ServerTreeItem, SMTreeItem } from "./ui/serverManagerView";
import { NamespaceTreeItem, ProjectTreeItem, ServerManagerView, ServerTreeItem, SMTreeItem } from "./ui/serverManagerView";

export const extensionId = "intersystems-community.servermanager";
export let globalState: vscode.Memento;
Expand Down Expand Up @@ -345,7 +345,7 @@ export function activate(context: vscode.ExtensionContext) {
}),
);

const addWorkspaceFolderAsync = async (readonly: boolean, csp: boolean, namespaceTreeItem?: ServerTreeItem) => {
const addWorkspaceFolderAsync = async (readonly: boolean, csp: boolean, namespaceTreeItem?: ServerTreeItem, project?: string) => {
if (namespaceTreeItem) {
const pathParts = namespaceTreeItem.id?.split(":");
if (pathParts && pathParts.length === 4) {
Expand All @@ -368,11 +368,10 @@ export function activate(context: vscode.ExtensionContext) {
return;
}

const uri = vscode.Uri.parse(`isfs${readonly ? "-readonly" : ""}://${serverName}:${namespace}/${csp ? "?csp" : ""}`);
if ((vscode.workspace.workspaceFolders || [])
.filter((workspaceFolder) => workspaceFolder.uri.toString() === uri.toString())
.length === 0) {
const label = `${serverName}:${namespace}${csp ? " webfiles" : ""}${readonly ? " (read-only)" : ""}`;
const params = [ csp ? "csp" : "", project ? `project=${project}` : ""].filter(e => e != "").join("&");
const uri = vscode.Uri.parse(`isfs${readonly ? "-readonly" : ""}://${serverName}:${namespace}/${params ? `?${params}` : ""}`);
if ((vscode.workspace.workspaceFolders || []).filter((workspaceFolder) => workspaceFolder.uri.toString() === uri.toString()).length === 0) {
const label = `${project ? `${project} - ` : ""}${serverName}:${namespace}${csp ? ' web files' : ''}${readonly && project == undefined ? " (read-only)" : ""}`;
const added = vscode.workspace.updateWorkspaceFolders(
vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0,
0,
Expand Down Expand Up @@ -420,6 +419,18 @@ export function activate(context: vscode.ExtensionContext) {
}),
);

context.subscriptions.push(
vscode.commands.registerCommand(`${extensionId}.editProject`, async (projectTreeItem?: ProjectTreeItem) => {
await addWorkspaceFolderAsync(false, false, <NamespaceTreeItem>projectTreeItem?.parent?.parent, projectTreeItem?.name);
})
);

context.subscriptions.push(
vscode.commands.registerCommand(`${extensionId}.viewProject`, async (projectTreeItem?: ProjectTreeItem) => {
await addWorkspaceFolderAsync(true, false, <NamespaceTreeItem>projectTreeItem?.parent?.parent, projectTreeItem?.name);
})
);

// Listen for relevant configuration changes
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration("intersystems.servers") || e.affectsConfiguration("objectscript.conn")) {
Expand Down
Loading

0 comments on commit bb56abd

Please sign in to comment.