-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VScode has some hard-coded assumptions of how a LSP binary is called: https://github.com/microsoft/vscode-languageserver-node/blob/0cb3812e7d540ef3a904e96df795bc37a21de9b0/client/src/node/main.ts#L378-L387 Therefore, we adjust the command line args.
- Loading branch information
Showing
5 changed files
with
240 additions
and
49 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
local M = { | ||
is_triggered = function(lsp_range) | ||
return true | ||
end, | ||
|
||
action_name = function() | ||
return "Answer below" | ||
end, | ||
|
||
process_answer = function(llm_response, lsp_range) | ||
return llm_response | ||
end, | ||
|
||
create_prompt = function(lsp_range) | ||
local question_text = active_doc:text_from_range(lsp_range) | ||
local prompt = table.concat({ | ||
[=====[ Human: | ||
You are a professional Assistant. Answer the given question. Your output can contain markdown. You output the assistant response. | ||
Here is the question: | ||
<question> ]=====], question_text, [=====[ | ||
</question> | ||
Assistant: ]=====] }) | ||
print(prompt) | ||
return prompt | ||
end, | ||
|
||
placement_range = function(lsp_range) | ||
-- place below | ||
return { | ||
start_line = lsp_range.end_line + 1, | ||
start_character = 0, | ||
end_line = lsp_range.end_line + 1, | ||
end_character = 0, | ||
} | ||
end | ||
} | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters