Open
Conversation
Contributor
Author
|
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.
d978ffa to
fcc3cfc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 tovim.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:
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