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

lsp-bridge not recognizing org-src python buffer #1028

Open
hsanter opened this issue Sep 3, 2024 · 5 comments
Open

lsp-bridge not recognizing org-src python buffer #1028

hsanter opened this issue Sep 3, 2024 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@hsanter
Copy link

hsanter commented Sep 3, 2024

GNU Emacs 28.0.50 (build 1, aarch64-apple-darwin20.5.0, NS appkit-2022.50 Version 11.4 (Build 20F71)) of 2021-07-19

  (add-to-list 'load-path "/Users/aosc/.emacs.d/elpa/lsp-bridge/lsp-bridge")

  (require 'yasnippet)
  (yas-global-mode 1)

  (require 'lsp-bridge)
  ;; (global-lsp-bridge-mode)
  (setq lsp-bridge-enable-diagnostics nil)
  (define-key acm-mode-map (kbd "C-j") 'acm-select-next) 
  (define-key acm-mode-map (kbd "C-k") 'acm-select-prev)


...

  (add-hook 'elpy-mode-hook 'lsp-bridge-mode)


lsp-bridge correctly turns on when opening a .py file. The following gets logged in Messages buffer the first time file is opened:

[LSP-Bridge] found language server: /Users/aosc/opt/anaconda3/bin/basedpyright-langserver
[LSP-Bridge] Active file '.py’, enjoy hacking!

Screen Shot 2024-09-03 at 2 49 17 PM

However, when opening an org-src block with C-c ', I do not get that message and do not get any python-specific completion suggestions:

Screen Shot 2024-09-03 at 2 58 24 PM

Is this normal behavior? If so, is there a way to enable lsp-bridge to recognize python major-mode buffers created from C-c '?

Thank you!

@manateelazycat
Copy link
Owner

You can got completion in org-src block directly, don't need C-c C-c

@hsanter
Copy link
Author

hsanter commented Sep 5, 2024

How do I do this? By default the only completions I get within src-blocks are for dictionary words at the moment with only the config above as far as lsp-bridge goes. No language-specific suggestions happen.
Screen Shot 2024-09-05 at 2 20 15 PM

@manateelazycat
Copy link
Owner

Move cursor to org-src block, and check lang-name in

(defun lsp-bridge-org-babel-get-single-lang-server ()

@hsanter
Copy link
Author

hsanter commented Sep 6, 2024

lang-name in that function is being set to nil right now based on running M-x debug-on-entry for that function and then running it with cursor in the python org src-block.

My org-src-lang-modes does contain ("python" . python) which I believe is appropriate.

Evaluating (org-element-property :language lsp-bridge-org-babel--info-cache) by itself with cursor in the src-block also returns nil.

@manateelazycat
Copy link
Owner

Can you try emacs -Q and only load lsp-bridge for test?

@manateelazycat manateelazycat added the help wanted Extra attention is needed label Sep 22, 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