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

refactor(agent&vscode): connect vscode extension to agent via lsp. #2247

Merged
merged 4 commits into from
May 27, 2024

Conversation

icycodes
Copy link
Member

@icycodes icycodes commented May 27, 2024

Changes:

  • [TabbyAgent] Now builds the protocol typedefs, the executable LSP server for Node, and the LSP server webworker for the browser, no longer outputting js libs.
  • The completion context collection implementation has been transferred from the VSCode extension to the TabbyAgent, includes fetching git context, extracting relative declarations, searching for recently changed code snippets.
  • [VSCode] Reworked the structure for connecting to TabbyAgent via LSP.

@icycodes icycodes marked this pull request as draft May 27, 2024 03:33
@icycodes icycodes force-pushed the refactor-agent-vscode-lsp branch from c2623b5 to 76cb653 Compare May 27, 2024 06:10
this.config.on("updatedServerConfig", () => {
console.log("updatedServerConfig", { config: this.config.server });
webviewView.webview.html = this._getWebviewContent(this.config.server);
});
Copy link
Member Author

@icycodes icycodes May 27, 2024

Choose a reason for hiding this comment

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

@wwayne I added a listener for changes of server config.

Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if will affect other stuff like theme syncing, I will do more testing after merge

return `
<!DOCTYPE html>
<html lang="en">
<!--hash: ${hashObject(server)}-->
Copy link
Member Author

Choose a reason for hiding this comment

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

@wwayne I added this hash for force refreshing when server config did change.

// We don't include DOM types in typescript building config

// FIXME: This is required by `@quilted/threads` and `tabby-chat-panel`
declare type HTMLIFrameElement = unknown;
Copy link
Member Author

Choose a reason for hiding this comment

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

@wwayne I remove DOM types dependencies in this refactor. But HTMLIFrameElement is used by @quilted/threads and tabby-chat-panel. Added this dummy declaration for tsc checks.

@icycodes icycodes requested a review from wwayne May 27, 2024 06:16
@icycodes icycodes changed the title refactor(vscode): connect vscode extension to agent via lsp. refactor(agent&vscode): connect vscode extension to agent via lsp. May 27, 2024
@icycodes icycodes marked this pull request as ready for review May 27, 2024 08:29
@icycodes icycodes requested review from wsxiaoys and removed request for wwayne May 27, 2024 08:29
@wsxiaoys wsxiaoys merged commit 7205b78 into TabbyML:main May 27, 2024
3 checks passed
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