emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/drepl 794b95da68 1/3: Rename position arguments from of


From: ELPA Syncer
Subject: [elpa] externals/drepl 794b95da68 1/3: Rename position arguments from offset pos
Date: Mon, 8 Apr 2024 15:57:50 -0400 (EDT)

branch: externals/drepl
commit 794b95da68acd92f434293bd796d151b1bcd5af6
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>

    Rename position arguments from offset pos
---
 README.org       |  6 +++---
 drepl-ipython.py |  8 ++++----
 drepl-lua.lua    |  2 +-
 drepl.el         | 18 +++++++++---------
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/README.org b/README.org
index e7c4b09a60..69b5276756 100644
--- a/README.org
+++ b/README.org
@@ -113,8 +113,8 @@ Get completions at point.
 
 Parameters:
 - =code=: A code snippet containing the completion point.
-- =offset=: The offset (zero-based) from start of =code= to
-  the point of completion.
+- =pos=: The offset (zero-based) from start of =code= to the point of
+  completion.
 
 Response:
 - =candidates= (optional): A list of objects, each containing the
@@ -145,7 +145,7 @@ Obtain information on the symbol at point.
 
 Parameters:
 - =code=: A code snippet.
-- =offset=: An offset (zero-based) from start of =code= containing the
+- =pos=: An offset (zero-based) from start of =code= containing the
   symbol of interest.
 
 Result: The response may be empty (no information on the symbol) or as
diff --git a/drepl-ipython.py b/drepl-ipython.py
index c5b3e52643..5beb67b9e2 100644
--- a/drepl-ipython.py
+++ b/drepl-ipython.py
@@ -155,11 +155,11 @@ class Drepl(InteractiveShell):
         r = self.run_cell(code)
         sendmsg(id=id)
 
-    def drepl_complete(self, id, code, offset):
+    def drepl_complete(self, id, code, pos):
         with provisionalcompleter():
             r = [
                 {"text": c.text, "annot": c.signature}
-                for c in self.Completer.completions(code, offset)
+                for c in self.Completer.completions(code, pos)
             ]
         sendmsg(id=id, candidates=r or None)
 
@@ -168,8 +168,8 @@ class Drepl(InteractiveShell):
         prompt = 
sys.ps2.format(self.execution_count).rjust(len(self.current_ps1))
         sendmsg(id=id, status=status, indent=indent, prompt=prompt)
 
-    def drepl_describe(self, id, code, offset):
-        name = token_at_cursor(code, offset)
+    def drepl_describe(self, id, code, pos):
+        name = token_at_cursor(code, pos)
         try:
             info = self.object_inspect(name)
             defn = info["definition"]
diff --git a/drepl-lua.lua b/drepl-lua.lua
index 524a5e5c70..55378c4c40 100644
--- a/drepl-lua.lua
+++ b/drepl-lua.lua
@@ -76,7 +76,7 @@ function drepl:drepl_checkinput(args)
 end
 
 function drepl:drepl_complete(args)
-  local prefix = args.code:sub(1, args.offset)
+  local prefix = args.code:sub(1, args.pos)
   local cands = {}
   self:complete(
     prefix,
diff --git a/drepl.el b/drepl.el
index 973c90126d..d487f094f6 100644
--- a/drepl.el
+++ b/drepl.el
@@ -336,12 +336,12 @@ interactively."
   (or (bounds-of-thing-at-point 'symbol)
       (cons (point) (point))))
 
-(defun drepl--completion-cadidates (repl code offset)
-  "Ask REPL for possible completions of CODE with point at OFFSET."
+(defun drepl--completion-cadidates (repl code pos)
+  "Ask REPL for possible completions of CODE with point at POS."
   (let ((response (while-no-input
                     (drepl--communicate repl 'sync 'complete
                                         :code code
-                                        :offset offset))))
+                                        :pos pos))))
     (when (listp response)
       (mapcar (lambda (c)
                 (let-alist c
@@ -356,9 +356,9 @@ interactively."
              (code (buffer-substring-no-properties
                     (cdr comint-last-prompt)
                     (point-max)))
-             (offset (- (point) (cdr comint-last-prompt)))
-             (cands (when (>= offset 0)
-                      (drepl--completion-cadidates repl code offset)))
+             (pos (- (point) (cdr comint-last-prompt)))
+             (cands (when (>= pos 0)
+                      (drepl--completion-cadidates repl code pos)))
              (metadata '(metadata
                          (category . drepl)
                          (annotation-function . drepl--capf-annotate)))
@@ -461,12 +461,12 @@ See that variable's docstring for a description of 
CALLBACK."
   (when-let ((repl (when (derived-mode-p 'drepl-mode)
                      (drepl--get-repl 'ready)))
              (start (cdr comint-last-prompt))
-             (offset (- (point) start))
-             (code (when (>= offset 0)
+             (pos (- (point) start))
+             (code (when (>= pos 0)
                      (buffer-substring-no-properties start (point-max))))
              (cb (lambda (data)
                    (apply callback (drepl--format-eldoc repl data)))))
-    (drepl--communicate repl cb 'describe :code code :offset offset)))
+    (drepl--communicate repl cb 'describe :code code :pos pos)))
 
 ;;; REPL restart
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]