LSP-copilot icon indicating copy to clipboard operation
LSP-copilot copied to clipboard

Investigate how to supported dedicated Copilot Environments (Org Tenants)

Open TerminalFi opened this issue 2 years ago • 6 comments

At the Organization I work at, we are looking to use Copilot with a dedicated tenant. This begs the question, how can this be supported at the plugin level.

Will update here as I get more thoughts.

I am going to review the VS Code plugin and see if there is a missed setting for specifying tenant or how it may work

TerminalFi avatar Jun 26 '23 15:06 TerminalFi

Copilot has Advanced configurations. Here we can see that it checks the config setting of path advanced.authProvider

It looks for the value github-enterprise, if it matches it gets the value of uri else defaults to https://github.com

			61405: (e, t, n) => {
				"use strict";
				Object.defineProperty(t, "__esModule", { value: !0 }),
					(t.onDidChangeConfigurationHandler = t.VSCodeNetworkConfiguration =
						void 0);
				const r = n(89496),
					i = n(44197),
					o = n(42512),
					s = n(30047),
					a = "github-enterprise",
					c = "https://github.com";
				function l() {
					return r.workspace
						.getConfiguration(i.CopilotConfigPrefix)
						.get("advanced")?.authProvider === s.AuthProviderId.GitHubEnterprise
						? ra.workspace.getConfiguration(a).get("uri") ?? c
						: c;
				}

TerminalFi avatar Jun 26 '23 15:06 TerminalFi

I guess we could use the project settings(*sublime-project) for that

timfjord avatar Jun 27 '23 10:06 timfjord

I think we can have it at both locations. Main settings and project level settings. I am working to update this today as I start testing. I think it is pretty straight forward in that we only need these settings present and no other changes are required.

TerminalFi avatar Jun 27 '23 12:06 TerminalFi

Any plan to release this update, reference VS Code. I think it's easy to add some config like:

 "github.copilot.advanced": {
    "authProvider": "github-enterprise",
},
"github-enterprise.uri": "",

RaffeYang avatar Mar 10 '24 11:03 RaffeYang

Any plan to release this update, reference VS Code. I think it's easy to add some config like:

 "github.copilot.advanced": {
    "authProvider": "github-enterprise",
},
"github-enterprise.uri": "",

Feel free a create a PR if in your test, it's just to add a config to make it work.

jfcherng avatar Mar 10 '24 11:03 jfcherng

@raffeyang I've not fully tested but I believe this is already supported

Just add to your settings

{
	"command": [
		"${node_bin}",
		"${server_path}",
		"--stdio"
	],
	"schemes": [
		"file",
		"buffer",
		"res"
	],
	"settings": {
		"auto_ask_completions": true,
		"debug": false,
		"hook_to_auto_complete_command": false,
		"local_checks": false,
		"telemetry": false,
		"proxy": "",
		"completion_style": "popup",
		"github-enterprise": {
			"uri": "URI HERE"
		}
	},
	// ST4 configuration
	"selector": "source | text | embedding"
}

TerminalFi avatar Mar 13 '24 16:03 TerminalFi