File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ require('copilot').setup({
159
159
copilot_node_command = ' node' , -- Node.js version must be > 20
160
160
workspace_folders = {},
161
161
copilot_model = " " ,
162
+ disable_limit_reached_message = false , -- Set to `true` to suppress completion limit reached popup
162
163
root_dir = function ()
163
164
return vim .fs .dirname (vim .fs .find (" .git" , { upward = true })[1 ])
164
165
end ,
Original file line number Diff line number Diff line change @@ -35,6 +35,19 @@ function M.get_handlers()
35
35
})
36
36
end
37
37
38
+ if config .disable_limit_reached_message then
39
+ handlers [" window/showMessageRequest" ] = (function (overridden )
40
+ return function (err , params , ctx )
41
+ if params .message :match ([[ ^You've reached.*limit.*Upgrade.*$]] ) then
42
+ -- ignore
43
+ logger .trace (" API limited:" , params .message )
44
+ return vim .NIL
45
+ end
46
+ return overridden (err , params , ctx )
47
+ end
48
+ end )(vim .lsp .handlers [" window/showMessageRequest" ])
49
+ end
50
+
38
51
return handlers
39
52
end
40
53
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ local logger = require("copilot.logger")
13
13
--- @field root_dir RootDirFuncOrString Root directory for the project , defaults to the nearest .git directory
14
14
--- @field should_attach ShouldAttachFunc Function to determine if Copilot should attach to the buffer
15
15
--- @field copilot_node_command string Path to the Node.js executable , defaults to " node"
16
+ --- @field disable_limit_reached_message boolean Disable the limit reached message , defaults to false
16
17
17
18
local initialized = false
18
19
@@ -30,6 +31,7 @@ local M = {
30
31
server_opts_overrides = {},
31
32
copilot_model = nil ,
32
33
copilot_node_command = " node" ,
34
+ disable_limit_reached_message = false ,
33
35
}
34
36
35
37
--- @param user_configs CopilotConfig
You can’t perform that action at this time.
0 commit comments