Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在LaTeX中无法使用路径补全 #834

Open
Perseus-Ljf opened this issue Jan 18, 2024 · 3 comments
Open

在LaTeX中无法使用路径补全 #834

Perseus-Ljf opened this issue Jan 18, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@Perseus-Ljf
Copy link

在LaTeX中不能使用路径补全,在其他语言(julia, python, fortran ,cpp)中都可以。

下图是在LaTeX当中的情况:
t1

期望得到:
t2

最小配置:

(setq package-archives
      '(("melpa"  . "https://melpa.org/packages/")
        ("gnu"    . "https://elpa.gnu.org/packages/")
        ("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(setq package-enable-at-startup nil)
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

;; Should set before loading `use-package'
(eval-and-compile
  (setq use-package-always-ensure t)
  (setq use-package-always-defer t)
  (setq use-package-expand-minimally t)
  (setq use-package-enable-imenu-support t))

(eval-when-compile
  (require 'use-package))

;; (use-package diminish)
;; (use-package bind-key)
;; Update GPG keyring for GNU ELPA
(use-package gnu-elpa-keyring-update)
(use-package quelpa)

(unless (package-installed-p 'quelpa-use-package)
  (quelpa
   '(quelpa-use-package
     :fetcher git
     :url "https://github.com/quelpa/quelpa-use-package.git")))

(use-package quelpa-use-package
  :init
  (setq quelpa-use-package-inhibit-loading-quelpa t)
  :demand t)

(use-package yasnippet
  :ensure t
  :init
  (yas-global-mode 1))

(use-package lsp-bridge
  :quelpa (lsp-bridge :fetcher github :repo "manateelazycat/lsp-bridge"
                      :files ("*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources"))
  :init
  (setq lsp-bridge-tex-lsp-server 'digestif)
  (global-lsp-bridge-mode)
  :config
  (setq acm-enable-copilot t)
  (setq lsp-bridge-enable-completion-in-string t)
  (setq lsp-bridge-enable-hover-diagnostic t)
  )

(provide 'test)
@manateelazycat
Copy link
Owner

Can you give example code to me for test?

@Perseus-Ljf
Copy link
Author

Can you give example code to me for test?

Hello,

Thank you for your response. The issue I'm experiencing in latex-mode is with the path completion feature, which is a non-LSP functionality. I'm not entirely sure, but it seems that this might not be heavily related to the type of programming language I'm using. So I don't know how to give you code example.

Nonetheless, I can provide a use case where I want to enable this feature in latex-mode. For instance, when I use the \includegraphics command, I want to be able to quickly complete the file path based on the current directory:

\documentclass{article}
\begin{document}

Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.

\includegraphics[width=5cm]{"./test.png"}
\end{document}

I hope this example helps you understand the issue better. Please let me know if you need any further information.

@manateelazycat
Copy link
Owner

我不使用 LaTeX, 你可以在 lsp-bridge-not-in-string 函数中打印, 看看哪里出错了? 欢迎发送补丁。

@manateelazycat manateelazycat added the help wanted Extra attention is needed label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants