-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider pilfering functionality #181
Comments
Our lexer needs to analyze the type of tokens and required to parse both forward and backward, rather than just skipping forward. It also needs to parse various constructs other than types. Hiding bodies would be useful, but why not just use Besides,
Other than that, Apple's
|
On Nov 19, 2022, at 2:31 AM, taku0 ***@***.***> wrote:
Hiding bodies would be useful, but why not just use hs-hide-all or hs-hide-level?
hs-hide-all hides too much (the methods and properties of every type); I was unable to make hs-hide-level do anything useful in my Swift file.
Those functions can handle other types of blocks and parenthesis. For example, swift-hide-bodies doesn't hide let definitions in Parser.swift <https://github.com/val-lang/val/blob/a4afd99/Sources/Compiler/Parse/Parser.swift> while hs-hide-level handles parenthesized expressions well.
? let definitions don’t ever have bodies in Swift. A body is a block surrounded by braces at the top level of a declaration.
Hiding everything but the summary of doc comments can also be extremely useful.
I’m aware code hasn’t been updated in many years as Swift syntax has evolved, and if it or the features it implements are of no use to you, that’s perfectly fine with me. I just thought I’d offer.
Cheers,
Dave
|
|
I was the primary developer of this file when I was on the Swift project, and there are some nice bits in there that might benefit your mode. In particular, the
-skip-
functions approximately parse swift pretty reliably and efficiently (I see you have your own code for that and I haven't tried to compare it, but the hangs withwhich-function
mode make me suspect you might want to try a different approach), and there are useful functions for folding away the details of files when you want to easily understand an API.I sucked those into my personal configuration so I could still use that functionality with your mode.
If there's any interest, I'm happy to help. OTOH, if you've already evaluated what's in there and decided none of it is useful, then, sorry for the noise!
The text was updated successfully, but these errors were encountered: