KarimAziev / company-tsconfig

Company backend for tsconfig.json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

npm i -g typescript

or locally

npm i typescript

Manually

Download the repository and it to your load path in your init file:

(add-to-list 'load-path "/path/to/company-tsconfig")
(require 'company-tsconfig)

With use-package and straight

(use-package company-tsconfig
  :straight (company-tsconfig
             :repo "KarimAziev/company-tsconfig"
             :type git
             :host github)
  :commands (company-tsconfig-mode))

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.

(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)))

company-tsconfig-eldoc-funcall

Manually enable eldoc-mode with tsconfig annotations.

Customizations

company-tsconfig-enable-eldoc

Whether to set up eldoc functions.

About

Company backend for tsconfig.json

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%