Skip to content

Support Server Manager being able to handle objectscript.conn.docker-compose type connections#1471

Merged
gjsjohnmurray merged 2 commits intointersystems-community:masterfrom
gjsjohnmurray:adopt-SM187v2
Feb 6, 2025
Merged

Support Server Manager being able to handle objectscript.conn.docker-compose type connections#1471
gjsjohnmurray merged 2 commits intointersystems-community:masterfrom
gjsjohnmurray:adopt-SM187v2

Conversation

@gjsjohnmurray
Copy link
Copy Markdown
Contributor

This PR enables an incoming Server Manager enhancement to implement intersystems-community/intersystems-servermanager#187

The VSIX built from this PR should work OK with Server Manager VSIXes that don't contain the relevant change, and vice versa. However the new features will only become available when both extensions have been updated.

parts.length === 2 &&
(config("intersystems.servers").has(parts[0].toLowerCase()) ||
vscode.workspace.workspaceFolders.find(
(ws) => ws.uri.scheme === "file" && ws.name.toLowerCase() === parts[0].toLowerCase()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that someone would want to do this for non-file workspace folders?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but at this point I'm coding defensively to minimize the chance of unexpected side-effects from my changes.


// An async variant capable of resolving docker port number.
// It is exported as one of our API functions but is also used internally.
async function asyncServerForUri(uri: vscode.Uri): Promise<any> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean for Language Server? Does it have to change to support these docker compose connections?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. It will continue to ask the ObjectScript extension for the connection details (host, port, pathPrefix etc) as usual. This extension does the magic.

const uri = workspaceFolder.uri;
const { configName } = connectionTarget(uri);
const serverName = notIsfs(uri) ? config("conn", configName).server : configName;
const conn = config("conn", configName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the standard vscode.workspace.getConfiguration() API instead of this old custom one? It would be nice to phase that out in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this stage I'd prefer not to make unnecessary changes. The config(...) function does a number of things that mean I don't think vscode.workspace.getConfiguration() is a drop-in replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants