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

feat(vscode): add proxy support for vscode #2921

Merged
merged 21 commits into from
Aug 30, 2024

Conversation

eryue0220
Copy link
Contributor

proxy?: {
authorization: string;
url: string;
noProxy: string | string[];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
noProxy: string | string[];

I recommend removing this option for convenient of implementation in first step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@eryue0220 eryue0220 marked this pull request as ready for review August 21, 2024 12:13
Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@@ -12,6 +12,7 @@ export type AgentConfig = {
requestTimeout: number;
};
proxy: {
proxySupport: "on" | "off";
Copy link
Member

@wsxiaoys wsxiaoys Aug 25, 2024

Choose a reason for hiding this comment

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

Suggested change
proxySupport: "on" | "off";
enabled: boolean

No need to reuse the variable name from vscode workspace, as AgentConfig is IDE / Extension agnostic.

clients/tabby-agent/src/TabbyAgent.ts Outdated Show resolved Hide resolved
clients/tabby-agent/src/lsp/Server.ts Outdated Show resolved Hide resolved
@wsxiaoys
Copy link
Member

Please also rebase against main branch

@eryue0220 eryue0220 marked this pull request as draft August 26, 2024 02:40
@eryue0220 eryue0220 marked this pull request as ready for review August 26, 2024 09:18
const fieldsToCheck = [
{
key: "server.endpoint",
validation: (key: string, x: string) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
validation: (key: string, x: string) => {
validation: (key: keyof ClientProvidedConfig, x: string) => {

Just use explict type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

},
{
key: "server.token",
validation: (key: string, x: string) => {
Copy link
Member

Choose a reason for hiding this comment

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

ditto, and the function can be reused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I just struggled with type and ignored.

Copy link
Member

@wsxiaoys wsxiaoys left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@wsxiaoys wsxiaoys requested a review from icycodes August 27, 2024 17:18
@@ -12,6 +12,8 @@ export type AgentConfig = {
requestTimeout: number;
};
proxy: {
enabled: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

I prefer to not add proxy.enabled. You can set the proxy.url to empty to disable the proxy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

clients/tabby-agent/src/lsp/Server.ts Outdated Show resolved Hide resolved
@wsxiaoys wsxiaoys merged commit 2dfd0bb into TabbyML:main Aug 30, 2024
4 checks passed
@eryue0220 eryue0220 deleted the feat/vscode-proxy-support branch August 30, 2024 10:18
icycodes pushed a commit that referenced this pull request Sep 2, 2024
* feat: add proxy support for vscode

* feat: complete proxy feature

* feat: add proxy support for vscode

* fix: remove noProxy configuration

* fix: update configuration strategy

* fix: support vscode proxy update

* [autofix.ci] apply automated fixes

* fix: cr

* feat: reactor init function

* [autofix.ci] apply automated fixes

* feat: refactor configuration init & update

* fix: format

* fix: cr

* fix: cr

* fix: cr bug

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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