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

fix cancel callback #191

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lua/tabnine/chat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local utils = require("tabnine.utils")
local api = vim.api
local config = require("tabnine.config")
local lsp = require("tabnine.lsp")
local get_symbols_request = nil

local M = { enabled = false }

Expand Down Expand Up @@ -203,14 +202,11 @@ local function register_events(on_init)
end)

chat_binary:register_event("get_symbols", function(request, answer)
if get_symbols_request then get_symbols_request() end

if not utils.buf_support_symbols() then
answer({ workspaceSymbols = {}, documentSymbols = {} })
return
end

get_symbols_request = lsp.get_document_symbols(request.query, function(document_symbols)
lsp.get_document_symbols(request.query, function(document_symbols)
lsp.get_workspace_symbols(request.query, function(workspace_symbols)
answer({
workspaceSymbols = vim.tbl_map(function(symbol)
Expand Down
Loading