feat: Checking for multiline import statements in js/ts files#893
feat: Checking for multiline import statements in js/ts files#893stevematney wants to merge 7 commits intovim-test:masterfrom
Conversation
fdbdb53 to
d243dca
Compare
|
Thank you for this. Will read through this when I get the chance. |
|
I've had a quick look through this, and I really appreciate all the improvements you've added. However, could you please break this up so it's just adds support multiline imports. I've already got a draft PR (#891) for handling Windows paths, and if your PR is focused on multiline imports it makes it easier for me review. |
You got it! I just wanted to be able to run tests locally to ensure I wasn't breaking things, but now that that's done, I can remove the Windows support portions. |
a9ad500 to
1721a89
Compare
1721a89 to
9eb263f
Compare
|
I was able to remove all the OS-normalization testing code. I left some OS-related items in the actual implementation since those changes are related to the plugin and the new code functioning properly in a Windows environment. |
| return empty(l:current_file) ? getcwd() : fnamemodify(l:current_file, ':h') | ||
| endfunction | ||
|
|
||
| function! s:find_file_upward(pattern, Callback = {path -> 1}) abort |
There was a problem hiding this comment.
What's the purpose and context for this? Is this for handling monorepos? Currently the plug-in assumes that the working directory is root directory of a project containing the usual files ie package.json
There was a problem hiding this comment.
Yes, this is for monorepos. In those contexts, it's not reliable to assume the base package.json has the correct dependencies, as that's much more likely to appear in the workspace package.json.
Given the intent of the plugin to be as configuration-free as possible, this should more reliably automatically select the correct runner based on the file being tested. It also shouldn't break on repos without workspaces. In that case, it should work exactly the same as it already does.
There was a problem hiding this comment.
Is it possible for this pull request the focus is on dealing with multi-line imports and we can split up the work for monorepos and workspaces into different pull requests? I've got some ideas about that and we could discuss them in an issue or a discussion if that works.
There was a problem hiding this comment.
Sorry for my slowness to reply! I will get to this! I just have been quite busy with other things in the meantime.
This also adds some test helpers and minor
base.vimupdates for Windows path normalization.Make sure these boxes are checked before submitting your pull request:
doc/test.txt(Not needed.)