You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finding acceptable ways to shorten the above is an ongoing, high profile discussion in the Golang community, and I think there's an opportunity for editors like VSCode to help provide a solution.
The current folding behaviour in VSCode could collapse the above to:
result, err := someFunction()
if err != nil {...
Which is not helpful, as it hides the action taken in the case of an error.
Where check is some name that represents what folding behaviour has been applied.
The code could then be read as if it were written with some kind of macro (which golang deliberately does not support), but the actual file text would be standard Golang code.
I'd also like the above to somehow be folded automatically. For example, once I have the folding configured, a new file I open has these regions folded by default, and once I type a new block and save the file, the new block is folded as well.
(This suggestion is similar to #70794, but I'm looking for a solution to a very well defined use case, with an entire language community that would love to see this implemented. #31966 and #69078 are also related)
The text was updated successfully, but these errors were encountered:
Context
Golang code can be quite verbose, a standard function call is written as:
Finding acceptable ways to shorten the above is an ongoing, high profile discussion in the Golang community, and I think there's an opportunity for editors like VSCode to help provide a solution.
The current folding behaviour in VSCode could collapse the above to:
Which is not helpful, as it hides the action taken in the case of an error.
What I'd love to see
Somehow enable the folding behaviour to display:
Where
check
is some name that represents what folding behaviour has been applied.The code could then be read as if it were written with some kind of macro (which golang deliberately does not support), but the actual file text would be standard Golang code.
I'd also like the above to somehow be folded automatically. For example, once I have the folding configured, a new file I open has these regions folded by default, and once I type a new block and save the file, the new block is folded as well.
(This suggestion is similar to #70794, but I'm looking for a solution to a very well defined use case, with an entire language community that would love to see this implemented. #31966 and #69078 are also related)
The text was updated successfully, but these errors were encountered: