Skip to content

Commit

Permalink
57
Browse files Browse the repository at this point in the history
  • Loading branch information
luozhiya committed Jan 28, 2025
1 parent d8e4ff6 commit 9ecd455
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lua/fittencode/client/api_key_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function APIKeyManager.new(options)
key = options.key,
storage = options.storage,
}
local _, keyring = pcall(vim.fn.json_decode, self.storage.get(self.key))
local _, keyring = pcall(vim.fn.json_decode, self.storage:get(self.key))
if keyring then
self.keyring = keyring
end
Expand Down Expand Up @@ -61,13 +61,13 @@ end
function APIKeyManager:update(keyring)
if keyring then
self.keyring = keyring
self.storage.store(self.key, vim.fn.json_encode(keyring))
self.storage:store(self.key, vim.fn.json_encode(keyring))
end
end

function APIKeyManager:clear()
self.keyring = nil
self.storage.delete(self.key)
self.storage:delete(self.key)
end

---@param token_type string
Expand Down
2 changes: 1 addition & 1 deletion lua/fittencode/client/plain_storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function PlainStorage.new(options)
self._data_file = Fn.normalize_path(self._storage_dir .. '/' .. self._filename)

-- 创建存储目录
local ok, err = pcall(vim.uv.fs_mkdir, self._storage_dir, 448, true)
local ok, err = pcall(vim.uv.fs_mkdir, self._storage_dir, 448)
if not ok and err ~= 'EEXIST' then
error('Create directory failed: ' .. err)
end
Expand Down
2 changes: 1 addition & 1 deletion lua/fittencode/inline/project_completion_service.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local Config = require('fittencode.config')
local ProjectCompletionFactory = require('fittencode.inline.project_completion_factory')
local ProjectCompletionFactory = require('fittencode.inline.project_completion')
local Promise = require('fittencode.concurrency.promise')
local Fn = require('fittencode.fn')
local Client = require('fittencode.client')
Expand Down
2 changes: 1 addition & 1 deletion lua/fittencode/session/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local Protocol = require('fittencode.client.protocol')
local Server = require('fittencode.client.server')
local LocalizationAPI = require('fittencode.client.localization_api')
local HTTP = require('fittencode.http')
local Promise = require('fittencode.promise')
local Promise = require('fittencode.concurrency.promise')
local Log = require('fittencode.log')
local Translate = require('fittencode.translate')
local Fn = require('fittencode.fn')
Expand Down

0 comments on commit 9ecd455

Please sign in to comment.