An open API service indexing awesome lists of open source software.

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

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_src

or 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.