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

Problems with tabs #340

Closed
rickyrauch opened this issue Mar 19, 2017 · 10 comments
Closed

Problems with tabs #340

rickyrauch opened this issue Mar 19, 2017 · 10 comments

Comments

@rickyrauch
Copy link

Hello, I'm facing some issues when I have in my code.

screen shot 2017-03-19 at 5 21 08 pm

Seems like language-babel is adding a new tab after <svg>

Thanks

@rickyrauch
Copy link
Author

Unclosed tag, sorry

@rickyrauch rickyrauch reopened this Mar 19, 2017
@rickyrauch
Copy link
Author

I think the issue is when you have the in the same line, it's working when opened

screen shot 2017-03-19 at 5 33 22 pm

@rickyrauch
Copy link
Author

Same problem when the path tag is long
screen shot 2017-03-19 at 5 39 34 pm

@gandm
Copy link
Owner

gandm commented Mar 19, 2017

I'm not really sure what you are showing me. Can you add the actual code that causes an issue and indicted the line number/s that the error appears on.

@gandm
Copy link
Owner

gandm commented Mar 20, 2017

Same problem when the path tag is long

Since Atom 1.15 the atom parser only sends the first 1000 chars (the link states 500 chars but is wrong) to the grammar regex engine. It appears that your path has a d attribute that is a string over 1000 chars long. Now the atom parser misses the closing " and the ending tag and that causes the malaligned indent. I think the Atom parser is now broken for long lines! I think they have provided an escape for grammars that want to revert to the old system so I may use that.

I still don't see any issues with your other screenshots. Please provide some actual code and indicate the line mumber concerned. Thanks

@rickyrauch
Copy link
Author

rickyrauch commented Mar 20, 2017

This is an example

              <div className="logo">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 94 20">
                  <path fill="#000000" fillRule="evenodd" d="M14.7.47V11.2c0 1.78-.42 3.08-1.27 3.88-.85.8-2.2 1.21-4.05 1.21-1.85 0-3.2-.4-4.05-1.2-.85-.81-1.27-2.1-1.26-3.89V.01H.47C.17 0 0 .15 0 .47v10.91c.04 2.96.9 5.05 2.6 6.29 1.7 1.23 3.95 1.83 6.77 1.8 2.82.03 5.08-.57 6.78-1.8 1.7-1.24 2.57-3.33 2.61-6.29V.01h-3.6c-.31-.01-.47.14-.47.46zm52.04 2.65a.6.6 0 0 0 .34-.08.6.6 0 0 0 .2-.24L68.3.23c.05-.15 0-.22-.16-.22H53.7c-.66 0-1.14.1-1.43.32-.29.2-.44.54-.44 1V18c0 .38.11.66.33.85.22.18.59.27 1.1.27h13.48a.6.6 0 0 0 .34-.07.6.6 0 0 0 .2-.24l1.03-2.56c.05-.16 0-.24-.16-.24h-12.3v-3.38c-.02-.58.16-1.01.53-1.29s.99-.42 1.85-.42h5.34a.6.6 0 0 0 .33-.08.6.6 0 0 0 .2-.23l1-2.46c.05-.16 0-.24-.16-.24h-9.1v-4.8h10.9zM41.3 9.04c.78-.4 1.35-.97 1.7-1.7.35-.73.53-1.55.53-2.48-.07-2.06-.8-3.4-2.18-4.02-1.38-.62-3-.9-4.85-.83h-8.16c-.68 0-1.16.1-1.45.32-.3.2-.43.54-.42 1V18c0 .38.11.66.33.85.22.18.59.27 1.1.27h10.05c1.93.02 3.48-.39 4.66-1.21 1.18-.83 1.79-2.19 1.83-4.07 0-1.17-.26-2.18-.77-3.04a3.84 3.84 0 0 0-2.37-1.76zm-10.88-6h6.38c1.03 0 1.74.2 2.13.6.4.4.58 1.02.57 1.86 0 .83-.18 1.45-.57 1.86-.39.4-1.1.61-2.13.61H30.4V3.04zm7.11 13.05h-7.1v-3.54c-.02-.58.16-1.01.54-1.29s1-.42 1.86-.42h4.7c1.11 0 1.88.22 2.3.66.41.43.6 1.1.58 1.98.03.87-.17 1.52-.59 1.96-.41.44-1.18.65-2.29.65zm55.86 2.7l-4.3-7.35c1.1-.25 2-.8 2.74-1.64.72-.83 1.1-2.14 1.13-3.9-.03-2.28-.71-3.84-2.05-4.68C89.57.37 87.7-.03 85.28 0h-8.2c-.66 0-1.13.1-1.42.32-.3.2-.44.54-.44 1v17.34c0 .3.16.45.48.45h3.49v-5.58c-.01-.58.17-1.01.55-1.29.37-.28 1-.41 1.85-.41h3.56l3.87 6.97c.05.1.12.18.2.24.08.05.19.07.33.07h3.66c.12 0 .18-.05.2-.12a.26.26 0 0 0-.03-.21zm-7.5-9.93H79.2V3.08h6.7c1.2 0 2.03.24 2.44.72.42.48.61 1.2.59 2.17.02.98-.17 1.7-.59 2.18-.41.48-1.23.71-2.45.71z"/>
                  </svg>
                </div>

@gandm
Copy link
Owner

gandm commented Mar 20, 2017

Yes that's because the line is over 1000 characters long - 1747 in fact. Because Atom truncates the grammar parser to the first 1000 characters I miss the closing " and the closing /> and hence the tabs don't work. Atom does this to stop some grammars causing infinite backtracking when using some regex's on long lines. I could revert this behaviour to how it worked prior to Atom 1.15.

Longer term, Github are working on a new version of Atom that uses a C based incremental parsing system that won't have this issue, as well as supporting VSCode's Language Server Protocol. Hopefully, this will allow a more robust system that also works more in a background process.

@rickyrauch
Copy link
Author

latest version:
screen shot 2017-03-27 at 7 54 57 pm

@gandm
Copy link
Owner

gandm commented Mar 28, 2017

Looks like you have a line that contains more than 100 tokens. Atom has a hardcoded limit that will only allow 100 tokens on a line and will ignore any further tokens. As it is inside Atom code here https://github.com/atom/atom/blob/62c1bad39c5347010c81ee8baf6b607caaa10cb6/src/grammar-registry.coffee#L18 there isn't anything I can do about it.

@rickyrauch
Copy link
Author

ok thanks for your answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants