Skip to content

Fix space tab indentation#8487

Merged
mhegazy merged 3 commits into
microsoft:masterfrom
ziacik:fix-space-tab-indentation
May 6, 2016
Merged

Fix space tab indentation#8487
mhegazy merged 3 commits into
microsoft:masterfrom
ziacik:fix-space-tab-indentation

Conversation

@ziacik

@ziacik ziacik commented May 5, 2016

Copy link
Copy Markdown
Contributor

Fixes #8426
Pls review and merge if possible. The issue hasn't been labeled yet.

@msftclas

msftclas commented May 5, 2016

Copy link
Copy Markdown

Hi @ziacik, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.

TTYL, MSBOT;

if (indentation !== tokenStart.character) {
let startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile);
let startLinePosition = getStartPositionOfLine(tokenStart.line, sourceFile);
if (indentation !== tokenStart.character || indentationIsDifferent(indentationString, startLinePosition)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just indentationString === soruceFile.text.substr(startLinePosition , indentationString.length);

@ziacik

ziacik commented May 5, 2016

Copy link
Copy Markdown
Contributor Author

Well, I guess I did some overengineering here, lol. Looking at the rest of the source code which does work with charcodes a lot maybe I thought it would be better to do it like that and maybe that it would have a better performance than creating a substring. That's just a very blind guess, probably. I can change it to your way by another commit.

@mhegazy

mhegazy commented May 5, 2016

Copy link
Copy Markdown
Contributor

the change looks good to me. if you can get that comparison simplified we should be good to go.

thanks for taking the time to fix this issue.

@ziacik

ziacik commented May 6, 2016

Copy link
Copy Markdown
Contributor Author

I have added the simplification commit.

@mhegazy mhegazy merged commit de177d4 into microsoft:master May 6, 2016
@mhegazy

mhegazy commented May 6, 2016

Copy link
Copy Markdown
Contributor

thanks!

@ziacik ziacik deleted the fix-space-tab-indentation branch May 7, 2016 21:31
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants