Languages with +lsp have weird behavior autocompletting

What happened?

Hello all, I’m using Doom Emacs for the last weeks for web development and I was curious to learn more about other languages, so I decided to enable clojure and rust to try. I enabled the two with +lsp, and this is where the weird behaviour appear: when I start writting and press space to go to the next word, anything that the lsp suggests get completed instead and the cursor jumps to the start of the word. I did a small video of the problem.

ezgif.com-gif-maker

What did you expect to happen?

When I press space after entering a word, the text should not be replaced by the first suggestion from the autocompetion.

Steps to reproduce

  • install Emacs 28
  • install Doom Emacs
  • edit init.el to enable lsp and any language with lsp support, eg. (clojure/rust +lsp)
  • run Doom sync
  • start Emacs and try to edit a source code file for the language enabled

System information

generated  jul 14, 2022 10:16:14
system     "openSUSE Leap 15.4" Linux 5.14.21-150400.22-default x86_64 x
emacs      27.2 ~/.emacs.d/ -> ~/.emacs.d/
doom       3.0.0-dev HEAD -> master 33c5f372 2022-07-09 21:10:40 +0200 ~/.doom.d/ ->
           ~/.doom.d/
shell      /usr/bin/zsh
features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY
           ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
           TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD
           JSON PDUMPER LCMS2 GMP
traits     gui server-running envvar-file custom-file
custom     delete-selection-mode package-selected-packages
modules    :completion company vertico :ui doom doom-dashboard (emoji +unicode)
           hl-todo indent-guides minimap modeline ophints (popup +all +defaults)
           treemacs unicode vc-gutter vi-tilde-fringe workspaces zen :editor (evil
           +everywhere) file-templates fold snippets :emacs dired electric ibuffer
           undo vc :term eshell vterm :checkers syntax :tools debugger editorconfig
           (eval +overlay) lookup lsp magit rgb :lang (cc +lsp) (clojure +lsp)
           emacs-lisp (go +lsp) (graphql +lsp) json (java +lsp) javascript latex lua
           markdown (org +pretty +journal -dragndrop +hugo +roam +pandoc +present) php
           plantuml (rust +lsp) sh web yaml :config (default +bindings +smartparens)
packages   (tldr) (eslintd-fix) (elisp-format)
elpa       eslintd-fix dash

My config file if this helps

;; Setup do emacs
(setq doom-theme 'doom-palenight)
(setq doom-font (font-spec :size 16))
(setq display-line-numbers-type 'relative)
(setq-default tab-width 2)
(setq highlight-indent-guides-character ?>)
(setq highlight-indent-guides-delay 0.3)
(setq highlight-indent-guides-method 'character)
(add-hook 'window-setup-hook #'toggle-frame-maximized)

(setq lsp-lens-enable 1
      lsp-completion-enable t
      lsp-enable-indentation t
      cider-dynamic-indentation t)

;; Tide customização
(setq tide-completion-enable-autoimport-suggestions t
  tide-save-buffer-after-code-edit nil
  tide-completion-show-source t
  tide-hl-identifier-mode t
  tide-hl-identifier-idle-time 0.5
  tide-recenter-after-jump t
  tide-filter-out-warning-completions t
  tide-sort-completions-by-kind t
  tide-sync-request-timeout 1
  tide-server-max-response-length 5242880)
(map! :leader :desc "Code fix at position" "c f" #'tide-fix)

;; rust
(setq rustic-cargo-bin "~/.cargo/bin/cargo"
      rustic-rustfmt-bin "~/.cargo/bin/rustfmt")

(setq gc-cons-threshold 100000000)
(setq jit-lock-defer-time 0)

;; Company
(setq company-idle-delay 0)
(setq company-auto-complete t)
(setq company-show-quick-access t)
(setq company-selection-wrap-around t)
(setq company-tooltip-idle-delay 1)
(setq company-async-timeout 5)
(setq company-minimum-prefix-length 2)

;; Debug
;; (setq tide-tsserver-process-environment '("TSS_LOG=-level verbose -file ~/tide-tsserver.log"))

;; eslint
(setq flycheck-javascript-eslint-executable "eslint_d")
(setq eslintd-fix-executable "/usr/local/bin/eslint_d")

(add-hook 'typescript-tsx-mode-hook 'eslintd-fix-mode)
(add-hook 'typescript-mode-hook 'eslintd-fix-mode)
(add-hook 'web-mode-hook 'eslintd-fix-mode)