NSHipster / SwiftSyntaxHighlighter

A syntax highlighter for Swift code that uses SwiftSyntax to generate Pygments-compatible HTML.
https://nshipster.com/swiftsyntax/
MIT License
275 stars 12 forks source link

Add support for Swift 5.3 #9

Closed mattt closed 3 years ago

mattt commented 3 years ago

Retargeted from #8. See https://github.com/NSHipster/SwiftSyntaxHighlighter/pull/8#issuecomment-698512685

mattt commented 3 years ago

Well, that didn't help. https://github.com/NSHipster/SwiftSyntaxHighlighter/pull/9/checks?check_run_id=1162106566#step:5:145

I'll continue to look for other ways to debug this. Linux support for 5.3 is a blocker for the next release of swift-doc.

mattt commented 3 years ago

I'll tell you what, Codespaces is really something else. With a little effort, I was able to run and debug the Linux test bundle, and after a bit of trial and error, I was able to trace the error back to CommandTests — specifically, this line:

https://github.com/NSHipster/SwiftSyntaxHighlighter/blob/a8a92e5db3c4a710036b47d24a5fc9b98901582a/Tests/SwiftSyntaxHighlighterTests/CommandTests.swift#L18

Screen Shot 2020-09-24 at 12 32 07

Looking back at the logs, I could have figured that out from the information available, but tightening up the feedback loop with an interactive terminal and debugger got me there pretty quick.

Generating LinuxMain.swift and XCTestManifests.swift instead of running with --enable-test-discovery gives us an easy way to ignore the problematic tests for now. My priority is to remove this blocker for swift-doc; we can revisit with a proper fix at some point down the road.

MaxDesiatov commented 3 years ago

Thanks for the overview, this is great! Did you set up your Codespaces environment from scratch? I tried to use it previously, but was a bit disappointed there were no popular pre-made Codespace definitions for Swift.

mattt commented 3 years ago

@MaxDesiatov I adapted my setup from this PR. For the debug setup, I followed this article by @vknabel (Vielen dank!).

Coming away from this first real experience with Codespaces, I feel like I have a ton of backlog documentation about VSCode to read in order to understand how everything really works, and how to make the most of it next time.