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

Duplicate, Using code actions freezes emacs #827

Closed
Kenneth-Mata opened this issue Jan 11, 2024 · 5 comments
Closed

Duplicate, Using code actions freezes emacs #827

Kenneth-Mata opened this issue Jan 11, 2024 · 5 comments

Comments

@Kenneth-Mata
Copy link

Using the lsp-bridge-code-action while having lsp-bridge-code-action-enable-popup-menu enabled will cause emacs to freeze, it will not respond to keyboard input (but mouse input, at least on wayland) will still work

I tried using this configuration

(setq package-enable-at-startup nil)
(setq straight-check-for-modifications nil)

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name
        "straight/repos/straight.el/bootstrap.el"
        (or (bound-and-true-p straight-base-dir)
            user-emacs-directory)))
      (bootstrap-version 7))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(use-package straight
  :config
  (setopt straight-use-package-by-default t))
(use-package yasnippet :config (yas-global-mode 1))
(use-package yasnippet-snippets)
(use-package markdown-mode)
(use-package lsp-bridge
  :straight '(lsp-bridge :type git :host github :repo "manateelazycat/lsp-bridge"
						 :files (:defaults "*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
						 :build (:not compile))
  :init
  (global-lsp-bridge-mode)
  :config
(setopt lsp-bridge-enable-log t)  
(setopt lsp-bridge-python-command "/home/kenneth/.conda/envs/py_env/bin/python"))
Screencast_20240111_181830-1.webm

This is the lsp-bridge buffer after the code action

Screenshot_20240111_182200

It was previously mentioned here

I'm not very knowledgeable in either elisp or python, but i think this is worth mentioning, or disabling the popup by default / removing the option if it doesn't work properly.

@Kenneth-Mata
Copy link
Author

Tried with a different language, it also happens with gopls

Screencast_20240111_184822.webm

The lsp-bridge buffer

Screenshot_20240111_185024

@manateelazycat
Copy link
Owner

can you send example code to me?

@Kenneth-Mata
Copy link
Author

#include <stdio.h>
/* ANSI C doesn't require int to be the return of the main function*/
main() {
	float fahr, celsius, upper, lower, step;
	step = 20;
	upper = 500;
	lower = 0;

	fahr = lower;
	printf("%s", "Fahrenheit to Celsius Table\n");
	while (fahr <= upper) {
		celsius = (5.0 / 9.0) * (fahr - 32);
		printf("%6.2d   %9.1f\n" ,fahr, celsius);
		fahr = fahr + step;
	}
}

This is from the C Programming Book 2nd, clangd will highlight that %6.2d should be %6.2f, but freeze after selecting the fix

@manateelazycat
Copy link
Owner

I used the above code to test locally. The code action ran normally and there was no freezing problem. Please use emacs -Q to load only lsp-bridge for testing to eliminate the influence of other plug-ins.

@Kenneth-Mata
Copy link
Author

Kenneth-Mata commented Jan 12, 2024

I'm using --init-directory for the tests

(add-to-list 'load-path "/home/kenneth/.config/emm/lsp-bridge")

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

(require 'lsp-bridge)
(global-lsp-bridge-mode)

(setopt lsp-bridge-enable-log t)
(setq lsp-bridge-python-command "/home/kenneth/.conda/envs/py_env/bin/python")

i tried with this configuration, directly download the lsp-bridge repo and still got the freezing behavior

Screenshot_20240112_122143

I'll try to replicate this behavior on a VM and/or my windows machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants