]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(compiler): allow customizing exe and args for tsc
authorKonfekt <Konfekt@users.noreply.github.com>
Tue, 11 Mar 2025 20:40:04 +0000 (21:40 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 11 Mar 2025 20:40:04 +0000 (21:40 +0100)
closes: #16853

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/compiler/tsc.vim
runtime/doc/quickfix.txt
runtime/doc/tags

index 76f525baa6a5f76ed2aba8da14a160956e662d52..9922cd7dfaec6e9d4bd75f3947e3fec02bf49a31 100644 (file)
@@ -2,6 +2,7 @@
 " Compiler:    TypeScript Compiler
 " Maintainer:  Doug Kearns <dougkearns@gmail.com>
 " Last Change: 2024 Apr 03
+"              2025 Mar 11 by The Vim Project (add comment for Dispatch, add tsc_makeprg variable)
 
 if exists("current_compiler")
   finish
@@ -11,9 +12,9 @@ let current_compiler = "tsc"
 let s:cpo_save = &cpo
 set cpo&vim
 
+" CompilerSet makeprg=tsc
 " CompilerSet makeprg=npx\ tsc
-
-CompilerSet makeprg=tsc
+execute $'CompilerSet makeprg={escape(get(b:, 'tsc_makeprg', get(g:, 'tsc_makeprg', 'tsc')), ' \|"')}'
 CompilerSet errorformat=%f\ %#(%l\\,%c):\ %trror\ TS%n:\ %m,
                       \%trror\ TS%n:\ %m,
                       \%-G%.%#
index 834f0e1b6ee86db3c26772db62db4755c79113bf..91e48637ab862911ed37dbed9d2515a18bdbfc07 100644 (file)
@@ -1,4 +1,4 @@
-*quickfix.txt*  For Vim version 9.1.  Last change: 2025 Jan 11
+*quickfix.txt*  For Vim version 9.1.  Last change: 2025 Mar 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1722,6 +1722,13 @@ shells and OSes and also does not allow to use other available TeX options,
 if any.  If your TeX doesn't support "-interaction=nonstopmode", please
 report it with different means to express \nonstopmode from the command line.
 
+TSC COMPILER                                           *compiler-tsc*
+
+The executable and compiler options can be added to 'makeprg' by setting the
+b/g:tsc_makeprg variable.  For example: >
+
+       let b:tsc_makeprg = "npx tsc --noEmit"
+
 TYPST COMPILER                                         *compiler-typst*
 
 Vim includes a compiler plugin for Typst files. This compiler is enabled
index 0f4804b5150ee81d41337a31087a30eb90899195..11ad3dd5a5ab342bb566e7e63b35dbf013c75fea 100644 (file)
@@ -6590,6 +6590,7 @@ compiler-ruff     quickfix.txt    /*compiler-ruff*
 compiler-select        quickfix.txt    /*compiler-select*
 compiler-spotbugs      quickfix.txt    /*compiler-spotbugs*
 compiler-tex   quickfix.txt    /*compiler-tex*
+compiler-tsc   quickfix.txt    /*compiler-tsc*
 compiler-typst quickfix.txt    /*compiler-typst*
 compiler-vaxada        ft_ada.txt      /*compiler-vaxada*
 compl-current  insert.txt      /*compl-current*