Skip to content

Code folding does not appear if code is not properly formatted #4787

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

Closed
TeamGoTango opened this issue Mar 30, 2016 · 3 comments
Closed

Code folding does not appear if code is not properly formatted #4787

TeamGoTango opened this issue Mar 30, 2016 · 3 comments
Labels
feature-request Request for new features or functionality

Comments

@TeamGoTango
Copy link

  • VSCode Version:0.10.11
  • OS Version: Windows 7 Enterprise, Service pack 1

Steps to Reproduce:

//paste this code ( GO ), code folding stops working for all code after it.
func recursiveSum(array []int) int {
return sumRecursive(array, 0, len(array)-1) //no space before and after -
}

//code folding starts to work if re-written as [ notice the space after len(array) ]
func recursiveSum(array []int) int {
return sumRecursive(array, 0, len(array) - 1 ) //space after -
}

@egamma egamma added the feature-request Request for new features or functionality label Mar 30, 2016
@egamma
Copy link
Member

egamma commented Mar 30, 2016

This is as designed, the code folding is based on indentation.

Semantic based/AST based code folding is on the backlog

// @aeschli

@DmitryEfimenko
Copy link

I think it'll be an often inconvenience for developers. A common example is to disregard indentation when specifying an inline html template in a javascript file. Here is an example from angular app::

export function componentDirective(): ng.IDirective {
    return {
        template: `
<div>
    <p>There's going to be a lot of html here and having its indentation start from the beginning is helpful in this case</p>
</div>
`,
        scope: true,
        controllerAs: '$ctrl',
        bindToController: true,
        controller: componentController
    }
}

@aeschli
Copy link
Contributor

aeschli commented May 11, 2016

We have issue #3422 for adding semantic folding.

@aeschli aeschli closed this as completed May 11, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants