4 ms·
I'm not sure I understand the significance of this library. Can it help implement something like a Visual Studio Code Language Server?
by watersb 5y ago
I'm not sure I understand the significance of this library.
Can it help implement something like a Visual Studio Code Language Server?
- ninkendo 5y agoI was really hoping I could use it to implement some complex automated refactoring of a pretty large swift codebase (mainly from completion handlers into async/await) but alas, the docs on "Syntax Rewriters" is just a "TODO". I think this is an area where software engineering is severely lacking: the ability to "code your code", but with something more advanced than regexes. Why can't I do something like this pseudocode: functions .where(params.last.isClosure) .where(returnType: Void.self) .forEach { f in f.setReturnType(f.params.last?.asClosure.paramsTuple) f.setAsync(true) f.setThrows() } to take functions which take a completion handler and convert them to being async? (I know it's a bunch more work than that but I feel like, even if the resulting code doesn't compile, I can fix up the resulting issues faster than having to do all of this myself.)
- b3morales 5y agoThere's already an LSP server for Swift (also made for Apple): https://github.com/apple/sourcekit-lsp https://github.com/apple/sourcekit-lsp This library is intended for syntactic tools: formatters, highlighters, that kind of thing.