From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: lester Newsgroups: gmane.emacs.help Subject: Need help with autocompletion with company and lsp-mode Date: Tue, 4 Apr 2023 06:30:51 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12168"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 04 06:32:00 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjYKu-0002vX-93 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 04 Apr 2023 06:32:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pjYKI-00023G-9H; Tue, 04 Apr 2023 00:31:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjYKG-000232-22 for help-gnu-emacs@gnu.org; Tue, 04 Apr 2023 00:31:20 -0400 Original-Received: from smtpo46.poczta.onet.pl ([213.180.142.177]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pjYKD-0008Kx-As for help-gnu-emacs@gnu.org; Tue, 04 Apr 2023 00:31:19 -0400 Original-Received: from [192.168.6.77] (public-gprs373770.centertel.pl [37.47.91.75]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: lester29@gazeta.pl) by smtp.gazeta.pl (Onet) with ESMTPSA id 4PrFFQ2RrBzlgNn8 for ; Tue, 4 Apr 2023 06:31:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gazeta.pl; s=2013; t=1680582666; bh=rMdCYcIvO+E2bpoNMIf0jBK/faZJ0WkGqIjmhOXe9rU=; h=Date:To:From:Subject:From; b=hxDO2t/ItJIsIbgPh79G+l2CTpJVbS8XGPrPdcf5jaAhimCaxFZOwbqYA1414dxSn E+kNmRQNIsKZM6JzXozouh9jghgfB3wvq6nzVlUvDYEzU+45boC843LenCy7YrXBhg pHbFChRiLoomzzj5KFMjfxXx2UlOvbzCYpsEMbsM= Content-Language: en-US Received-SPF: pass client-ip=213.180.142.177; envelope-from=lester29@gazeta.pl; helo=smtpo46.poczta.onet.pl X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143211 Archived-At: Hey I've an problem with auto completion not working. I tested it in the different file modes like Emacs Lisp and C++. Any help is appreciated. My config: ;;; init.el --- my gnu emacs config ;;; Commentary: ;;; Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; use straight.el for package management (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 6)) (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)) ;; install use-package using straight.el (straight-use-package 'use-package) ;; configure use-package to use straight.el by default (use-package straight :custom (straight-use-package-by-default t)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; utf-8 everywhere (prefer-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) ;; backwards compatibility as default-buffer-file-coding-system ;; is deprecated in 23.2. (if (boundp 'buffer-file-coding-system) (setq-default buffer-file-coding-system 'utf-8) (setq default-buffer-file-coding-system 'utf-8)) ;; Treat clipboard input as UTF-8 string first; compound text next, etc. (setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; disable startup screen (setq inhibit-startup-screen t) ;; disable menu bar, scroll bar, and tool bar (menu-bar-mode -1) (scroll-bar-mode -1) (tool-bar-mode -1) ;; disable dialog boxes (setq use-dialog-box nil) ;; set custom color scheme (use-package doom-themes) (use-package doom-moonfly-theme :straight (:host github :repo "stackmystack/doom-moonfly-theme" :branch "master")) (load-theme 'doom-moonfly t) ;; set default font (set-face-attribute 'default nil :family "MesloLGS Nerd Font Mono" :height 130 :weight 'normal :width 'normal) ;; always ask using y or n instead yes or no (defalias 'yes-or-no-p 'y-or-n-p) ;; disable annoying bell (setq ring-bell-function 'ignore) ;; auto close bracket insertion (electric-pair-mode 1) ;; display line numbers (require 'display-line-numbers) (defcustom display-line-numbers-exempt-modes '(vterm-mode eshell-mode shell-mode term-mode ansi-term-mode) "Major modes on which to disable line numbers." :group 'display-line-numbers :type 'list :version "green") (defun display-line-numbers--turn-on () "Turn on line numbers except for certain major modes. Exempt major modes are defined in `display-line-numbers-exempt-modes'." (unless (or (minibufferp) (member major-mode display-line-numbers-exempt-modes)) (display-line-numbers-mode))) (global-display-line-numbers-mode) ;; C-x C-; is not properly handled in terminal emulator so let's ;; add custom key binding for toggling comments in line (defun toggle-comment-on-line () "Comment or uncomment current line." (interactive) (comment-or-uncomment-region (line-beginning-position) (line-end-position))) (global-set-key (kbd "C-c ;") #'toggle-comment-on-line) ;; change indentation level for languages with C-like syntax (setq-default c-basic-offset 4) ;; lsp-mode (use-package lsp-mode :commands (lsp lsp-deferred) :custom (lsp-auto-guess-root t) (lsp-log-io t) (read-process-output-max (* 1024 1024)) (lsp-idle-delay 0.5) (lsp-prefer-flymake nil)) ;; company (use-package company :after lsp-mode :bind (:map company-active-map ("" . company-complete-selection)) (:map lsp-mode-map ("" . company-indent-or-complete-common)) :custom (company-minimum-prefix-length 1) (company-idle-delay 0.0) ;; default is 0.2 :hook ((text-mode . company-mode) (prog-mode . company-mode) (org-mode . company-mode) ;(company-mode . yas-minor-mode))) (lsp-mode . company-mode))) ;; flycheck (use-package flycheck :ensure t :init (global-flycheck-mode)) (use-package flycheck-color-mode-line) (eval-after-load "flycheck" '(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode)) (use-package flycheck-pos-tip) (with-eval-after-load 'flycheck (flycheck-pos-tip-mode)) (add-to-list 'display-buffer-alist `(,(rx bos "*Flycheck errors*" eos) (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (reusable-frames . visible) (window-height . 0.33))) ;; sudoers mode (use-package etc-sudoers-mode) ;; systemd mode (use-package systemd) (provide 'init) ;;; init.el ends here