Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
amirbilu committed Dec 4, 2023
1 parent 56aa641 commit 79cb3fd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lua/tabnine/chat/codelens.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
local chat = require("tabnine.chat")
local config = require("tabnine.config")
local consts = require("tabnine.consts")
local state = require("tabnine.state")
local utils = require("tabnine.utils")
local api = vim.api
local fn = vim.fn
Expand All @@ -26,7 +27,9 @@ function M.reload_buf_supports_symbols()
end

function M.should_display()
return vim.lsp.buf.server_ready()
return config.get_config().codelens_enabled
and state.active
and vim.lsp.buf.server_ready()
and not vim.tbl_contains(config.get_config().exclude_filetypes, vim.bo.filetype)
and buf_supports_symbols
end
Expand Down
2 changes: 1 addition & 1 deletion lua/tabnine/chat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ end

function M.open(on_ready)
if not M.enabled then
vim.notify("Tabnine Chat is available only for preview users")
vim.notify("Tabnine Chat is available only for Pro users")
return
end

Expand Down
1 change: 1 addition & 0 deletions lua/tabnine/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function M.set_config(o)
debounce_ms = 800,
suggestion_color = { gui = "#808080", cterm = 244 },
codelens_color = { gui = "#808080", cterm = 244 },
codelens_enabled = true,
exclude_filetypes = { "TelescopePrompt", "NvimTree" },
log_file_path = nil,
tabnine_enterprise_host = nil,
Expand Down

0 comments on commit 79cb3fd

Please sign in to comment.