Skip to content
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

code indention doesn't work somtimes #13278

Closed
ranjan-2209 opened this issue Oct 6, 2016 · 10 comments
Closed

code indention doesn't work somtimes #13278

ranjan-2209 opened this issue Oct 6, 2016 · 10 comments
Assignees

Comments

@ranjan-2209
Copy link

  • VSCode Version: 1.5.3
  • OS Version: Windows 10 Pro Version 1607 OS Build: 14393.222

Steps to Reproduce:

  1. Code indention doesn't work sometimes, e.g., <span> as shown in the snapshot
    1
@ranjan-2209
Copy link
Author

ranjan-2209 commented Oct 6, 2016

Also, another issue:

I have word wrap turned off. When i do Alt+Shift+F, the whole text is wrapped. It shouldn't be this way. This is behavior when word wrap is turned on.

@Tyriar
Copy link
Member

Tyriar commented Oct 6, 2016

@ranjan-ranjan to confirm, you're running a formatter when this occurs right? Do you have any extensions installed?

Please file another issue with info and a screenshot if you have found another bug.

@ranjan-2209
Copy link
Author

no formatter running. no extensions installed. kindly ask for more information if needed.

@ranjan-2209
Copy link
Author

ranjan-2209 commented Oct 7, 2016

Also, another issue while running the sample given in https://www.tutorialspoint.com/angularjs/angularjs_custom_directives.htm. The only thing I have changed is deleted the white space before mainApp.directive('student', function() {
This is the result:

Snapshot1:
1

Snapshot2:
2

The mainApp.controller which is outside, also gets collapsed.

@ranjan-2209
Copy link
Author

Another instance where it doesn't work:
1

@aeschli
Copy link
Contributor

aeschli commented Oct 10, 2016

It is unclear to me how you got to the shown code and how the wrong indentation has occurred.
Can you give steps on how to reproduce? Best with a smaller code example.

@ranjan-2209
Copy link
Author

Kindly note that the above snapshots are of html file with JavaScript embedded in it. So anything in <script> ... </script> won't be indented properly (which is my conclusion). The JavaScript would be indented properly only if it is in different .js file.

The code to reproduce above issue is:

<html>

<body>

    <div ng-app="mainApp" ng-controller="doctorController">
        <form name="doctorRegistrationForm" novalidate>
            <label>
                        namea
                            </label>
        </form>
    </div>
</body>

</html>

@aeschli
Copy link
Contributor

aeschli commented Oct 14, 2016

Yes, that's expected. Our html formatter does not format inside script tags. That is #12972

@aeschli aeschli closed this as completed Oct 14, 2016
@ranjan-2209
Copy link
Author

ranjan-2209 commented Oct 14, 2016

i thought the </label> should come just on the same level as <label>. and in the above code there's no <script> tag.

@ranjan-2209
Copy link
Author

Also, in this case the html doesn't gets formatted correctly. When we click on the codepen link marked in the snapshot and save it to html file. The html code doesn't gets formatted correctly.
1

@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
None yet
Projects
None yet
Development

No branches or pull requests

3 participants