diff options
author | Jose Antonio Ortega Ruiz <jao@Mac.home> | 2025-09-22 23:02:36 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@Mac.home> | 2025-09-22 23:02:36 +0100 |
commit | 0a88bd27308e3ca3a62b6c933cdb97a4884237ea (patch) | |
tree | c1c423700788aec0ade82286c857254e0a2a134b /elisp/geiser-capf.el | |
parent | c8b862f00e208f2c09bf2a2b2436af0a466a2531 (diff) | |
download | geiser-0a88bd27308e3ca3a62b6c933cdb97a4884237ea.tar.gz geiser-0a88bd27308e3ca3a62b6c933cdb97a4884237ea.tar.bz2 |
fix: returning proper locations for company
Should address issue #76. Thanks, Daniel.
Diffstat (limited to 'elisp/geiser-capf.el')
-rw-r--r-- | elisp/geiser-capf.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/elisp/geiser-capf.el b/elisp/geiser-capf.el index a3c47a3..cf0b3dc 100644 --- a/elisp/geiser-capf.el +++ b/elisp/geiser-capf.el @@ -1,6 +1,6 @@ ;;; geiser-capf.el --- Setup for Geiser's CAPFs -*- lexical-binding: t; -*- -;; Copyright (c) 2022 Jose Antonio Ortega Ruiz +;; Copyright (c) 2022, 2025 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -18,6 +18,7 @@ (require 'geiser-doc) (require 'geiser-completion) (require 'geiser-edit) +(require 'geiser-syntax) (defun geiser-capf--company-docsig (id) (condition-case err @@ -40,10 +41,13 @@ (defun geiser-capf--company-location (id) (condition-case _err (when (and geiser-impl--implementation (not (geiser-autodoc--inhibit))) - (let ((id (make-symbol id))) - (condition-case nil - (geiser-edit-module id 'noselect) - (error (geiser-edit-symbol id 'noselect))))) + (let ((id (if (stringp id) (geiser-syntax--form-from-string id) id))) + (if-let* ((mloc (geiser-edit-module-location id)) + (f (geiser-edit--location-file mloc))) + (cons f 1) + (if-let* ((sloc (geiser-edit-symbol-location id)) + (f (geiser-edit--location-file sloc))) + (cons f (or (geiser-edit--location-line sloc) 1)))))) (error (message "Location not found for %s" id)))) (defun geiser-capf--thing-at-point (module &optional _predicate) |