fix: SSHConfig: check for multiple start/end blocks#510
Merged
bcpeinhardt merged 8 commits intomainfrom May 23, 2025
Merged
Conversation
09777c5 to
eda19a2
Compare
bcpeinhardt
reviewed
May 20, 2025
mafredri
approved these changes
May 21, 2025
Member
mafredri
left a comment
There was a problem hiding this comment.
Small suggestion but otherwise LGTM 👍🏻
| count++ | ||
| pos = haystack.indexOf(needle, pos + needle.length) | ||
| } | ||
| return count |
Member
There was a problem hiding this comment.
I think this could be simplified, like so?
return [...haystack.matchAll(needle)].length
Member
Author
There was a problem hiding this comment.
It looks way better, but matchAll wants a RegExp, which means needle would need to be properly un-escaped first.
Member
There was a problem hiding this comment.
Oh yeah, forgot not all these methods are string | RegExp. That can be simply amended with RegExp.escape(needle).
Member
Author
There was a problem hiding this comment.
Only available in Node 24 and current version of VSCode is on 23.11.0 if I'm not mistaken 🥲
Contributor
|
Note to self: add changelog updates in separate PR so we don't force reapproval. |
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.
Relates to #504
What this does:
Ports over the existing checks in
coder config-sshto handle malformed blocks.Now, if your SSH config is malformed, you will see an error similar to the below upon attempting to connect:
If one of the automatically generated blocks is missing a start or end comment, you will see the below error:

If there is more than one block with a given label, you will see the below error:

In both cases, it will unfortunately be necessary to edit the SSH config and fix the issue manually.