Skip to content

feat: TSCMono#77

Open
davidmh wants to merge 1 commit intodmmulroy:mainfrom
davidmh:feature/tsc-mono
Open

feat: TSCMono#77
davidmh wants to merge 1 commit intodmmulroy:mainfrom
davidmh:feature/tsc-mono

Conversation

@davidmh
Copy link
Contributor

@davidmh davidmh commented Jan 15, 2026

Exposes a new user command to run tsc in the monorepo mode.

We're making the following assumptions around the nature of a monorepo:

  • When finding all the available tsconfig files, we're searching from the monorepo root.

  • We find the monorepo root using the option monorepo_root_patterns, which is passed as the marker param to vim.fs.root, and defaults to { ".git" }.

    We're making it configurable in case someone uses some other vcs.

  • Using each tsconfig directory as the project root

    When working on a monorepo, it's common to jump across projects, which can also mean changing the working directory in order to accommodate LSP clients, direnv callbacks, etc. See vim-rooter.

    That means that by the time we get the results from tsc, we might already be in a different working directory. Since the results from tsc use relative paths, the quickfix entries will be broken.

    To fix that issue, we're making all the project paths absolute, so we can:

    • Run each tsc command from its corresponding directory
    • Build an absolute path for the resulting errors

    That guarantees a valid file path in the quickfix, regardless of what the current working directory is by then.

Let me know what you think, open to suggestions!


Resolves #56

@davidmh davidmh marked this pull request as draft January 15, 2026 07:13
@davidmh
Copy link
Contributor Author

davidmh commented Jan 15, 2026

There's something off with the regular TSC run, I'll look into it tomorrow.

Done

Exposes a new user command to run tsc in the monorepo mode.

We're making the following assumptions around the nature of a monorepo:

- When finding all the available tsconfig files, we're searching from
  the monorepo root.

- We find the monorepo root using the option `monorepo_root_patterns`,
  which is passed as the marker param to `vim.fs.root`, and defaults to
  `{ ".git" }`.

  We're making it configurable in case someone uses some other vcs.

- Using each tsconfig directory as the project root

  When working on a monorepo, it's common to jump across projects, which
  can also mean changing the working directory in order to accommodate
  LSP clients, direnv callbacks, etc. See vim-rooter.

  That means that by the time we get the results from tsc, we might
  already be in a different working directory. Since the results from
  tsc use relative paths, the quickfix entries will be broken.

  To fix that issue, we're making all the project paths absolute, so we
  can:

  - Run each tsc command from its corresponding directory
  - Build an absolute path for the resulting errors

  That guarantees a valid file path in the quickfix, regardless of what
  the current working directory is by then.
@davidmh davidmh marked this pull request as ready for review January 15, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion TSCMono

1 participant