Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ecopilot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ula
research
ecopilot
Commits
5cd27b02
Commit
5cd27b02
authored
3 months ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Remove code left over by previous cleanup
parent
89a04cf6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
copilot.el
+2
-8
2 additions, 8 deletions
copilot.el
with
2 additions
and
8 deletions
copilot.el
+
2
−
8
View file @
5cd27b02
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
(
inhibit-quit
t
)
(
inhibit-quit
t
)
(
curfile
(
buffer-file-name
))
(
curfile
(
buffer-file-name
))
(
lang
(
file-name-extension
curfile
))
(
lang
(
file-name-extension
curfile
))
(
promptfile
(
concat
curfile
".prompt"
))
;; extract the entire buffer up to the current position
;; extract the entire buffer up to the current position
(
code
(
save-excursion
(
code
(
save-excursion
(
beginning-of-buffer
)
(
beginning-of-buffer
)
...
@@ -91,9 +91,6 @@ Only output the missing parts of the code. \
...
@@ -91,9 +91,6 @@ Only output the missing parts of the code. \
Generate
%s
code
to
complete
the
following
snippet:\n
```
%s\n%s
"
Generate
%s
code
to
complete
the
following
snippet:\n
```
%s\n%s
"
system context lang lang code)))
system context lang lang code)))
;; write out the prompt to a temporary file
(write-region prompt nil promptfile 'silent)
;; run ollama streaming stdout into buffer catching ctrl-g
;; run ollama streaming stdout into buffer catching ctrl-g
(with-local-quit
(with-local-quit
(copilot--run-ollama prompt))
(copilot--run-ollama prompt))
...
@@ -109,10 +106,7 @@ Generate %s code to complete the following snippet:\n```%s\n%s"
...
@@ -109,10 +106,7 @@ Generate %s code to complete the following snippet:\n```%s\n%s"
(goto-char spot)
(goto-char spot)
(while (re-search-forward "
```
[a-z]*
" end t)
(while (re-search-forward "
```
[a-z]*
" end t)
(setq end (- end (length (match-string 0))))
(setq end (- end (length (match-string 0))))
(replace-match ""))))
(replace-match ""))))))
;; remove temporary files
(delete-file promptfile)))
;; define `ctrl-c ctrl-k` keybinding for llm code completion
;; define `ctrl-c ctrl-k` keybinding for llm code completion
(defun copilot-c-hook ()
(defun copilot-c-hook ()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment