Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add max_configs_to_run param #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ By default, the plugin uses the default `tsc` command with the `--noEmit` flag t
use_trouble_qflist = false,
use_diagnostics = false,
run_as_monorepo = false,
max_configs_to_run = 20,
bin_path = utils.find_tsc_bin(),
enable_progress_notifications = true,
enable_error_notifications = true,
Expand Down
4 changes: 3 additions & 1 deletion lua/tsc/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end
--- @field use_trouble_qflist? boolean - (false) When true the quick fix list will be opened in Trouble if it is installed
--- @field use_diagnostics? boolean - (false) When true the errors will be set as diagnostics
--- @field run_as_monorepo? boolean - (false) When true the `tsc` process will be started mode for each tsconfig in the current working directory
--- @field max_configs_to_run? number - (20) Will not run `tsc` if number of found tsconfig files is greater.
--- @field bin_path? string - Path to the tsc binary if it is not in the projects node_modules or globally
--- @field enable_progress_notifications? boolean - (true) When false progress notifications will not be shown
--- @field enable_error_notifications? boolean - (true) When false error notifications will not be shown
Expand All @@ -36,6 +37,7 @@ local DEFAULT_CONFIG = {
enable_progress_notifications = true,
enable_error_notifications = true,
run_as_monorepo = false,
max_configs_to_run = 20,
flags = {
noEmit = true,
project = nil,
Expand Down Expand Up @@ -112,7 +114,7 @@ M.run = function()
end
end

if #configs_to_run > 20 then
if #configs_to_run > config.max_configs_to_run then
vim.notify_once("Too many tsconfigs found: " .. #configs_to_run, vim.log.levels.ERROR, get_notify_options())
return
end
Expand Down
Loading