https://github.com/karimaziev/company-tsconfig
Company backend for tsconfig.json
https://github.com/karimaziev/company-tsconfig
company-mode tsconfig-json
Last synced: 4 months ago
JSON representation
Company backend for tsconfig.json
- Host: GitHub
- URL: https://github.com/karimaziev/company-tsconfig
- Owner: KarimAziev
- License: gpl-3.0
- Created: 2022-08-15T09:25:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-09T12:23:27.000Z (7 months ago)
- Last Synced: 2025-01-07T18:21:05.353Z (5 months ago)
- Topics: company-mode, tsconfig-json
- Language: Emacs Lisp
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* company-tsconfig
Completion backend for =company-mode= and =eldoc= support for tsconfig files.
** Requirements
+ Emacs >= 27.1
+ company
+ npm package ~typescript~ (either locally or globally installed)** Installation
Ensure that ~typescript~ installed either globally:
#+begin_src shell
npm i -g typescript
#+end_srcor locally
#+begin_src shell
npm i typescript
#+end_src*** Manually
Download the repository and it to your load path in your init file:
#+begin_src elisp :eval no
(add-to-list 'load-path "/path/to/company-tsconfig")
(require 'company-tsconfig)
#+end_src*** With use-package and straight
#+begin_src elisp :eval no
(use-package company-tsconfig
:straight (company-tsconfig
:repo "KarimAziev/company-tsconfig"
:type git
:host github)
:commands (company-tsconfig-mode))#+end_src
** Usage
You can use this library in three ways.
*** ~company-tsconfig-mode~
It will add and activate ~company-mode~ with ~company-tsconfig~ backend. Also, add ~eldoc~ functions. To disable ~eldoc~ setup, customize variable ~company-tsconfig-enable-eldoc~.
*** ~company-tsconfig~
To use only the backend without activating ~company-tsconfig-mode~, add ~company-tsconfig~ to the list of company backends.
#+begin_src emacs-lisp
(defun my-company-tsconfig-setup ()
"Locally add `company-tsconfig' to the list of company backends."
(interactive)
(require 'company)
(set (make-local-variable 'company-backends)
(append '(company-tsconfig) company-backends)))#+end_src
*** ~company-tsconfig-eldoc-funcall~
Manually enable ~eldoc-mode~ with tsconfig annotations.** Customizations
*** company-tsconfig-enable-eldoc
Whether to set up ~eldoc~ functions.