Skip to content

Commit

Permalink
Merge pull request manateelazycat#1085 from kongds/master
Browse files Browse the repository at this point in the history
fix codeium failed with 500
  • Loading branch information
manateelazycat authored Oct 21, 2024
2 parents c4decea + 27af743 commit 6ff35fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion core/codeium.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def complete(
insert_spaces,
prefix,
language,
file_path
):
self.get_info()
self.run_local_server()
Expand All @@ -77,6 +78,7 @@ def complete(
"cursor_offset": cursor_offset,
"editor_language": editor_language,
"text": text,
"absolute_path_migrate_me_to_uri": file_path,
"language": language,
},
"editor_options": {"insert_spaces": True if insert_spaces else False, "tab_size": tab_size},
Expand Down Expand Up @@ -291,5 +293,5 @@ def post_request(self, url, data):
response_data = response.read().decode("utf-8")
return parse_json_content(response_data)
except Exception as e:
logger.exception(e)
print("Codeium request error", e, url)
return {}
6 changes: 4 additions & 2 deletions lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -2783,15 +2783,17 @@ We need exclude `markdown-code-fontification:*' buffer in `lsp-bridge-monitor-be
all-text
(not indent-tabs-mode)
(acm-get-input-prefix)
language))
language
(buffer-file-name)))
(lsp-bridge-call-async "codeium_complete"
(1- (point))
(symbol-name major-mode)
tab-width
all-text
(not indent-tabs-mode)
(acm-get-input-prefix)
language))))
language
(buffer-file-name)))))

(defun lsp-bridge-copilot-complete ()
(interactive)
Expand Down
4 changes: 2 additions & 2 deletions lsp_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,8 @@ def copilot_complete(self, position, editor_mode, file_path, relative_path, tab_
self.copilot.complete(position, editor_mode, file_path, relative_path, tab_size, text, insert_spaces)

@threaded
def codeium_complete(self, cursor_offset, editor_language, tab_size, text, insert_spaces, prefix, language):
self.codeium.complete(cursor_offset, editor_language, tab_size, text, insert_spaces, prefix, language)
def codeium_complete(self, cursor_offset, editor_language, tab_size, text, insert_spaces, prefix, language, file_path):
self.codeium.complete(cursor_offset, editor_language, tab_size, text, insert_spaces, prefix, language, file_path)

def codeium_completion_accept(self, id):
self.codeium.accept(id)
Expand Down

0 comments on commit 6ff35fd

Please sign in to comment.