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

Toggle line comment, comment as block in scss files #15013

Closed
michaeljota opened this issue Nov 4, 2016 · 5 comments
Closed

Toggle line comment, comment as block in scss files #15013

michaeljota opened this issue Nov 4, 2016 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s)

Comments

@michaeljota
Copy link

michaeljota commented Nov 4, 2016

  • VSCode Version: 1.7.1
  • OS Version: Windows 10 AU

Steps to Reproduce:

  1. Open a SCSS file
  2. Toggle line comment

I expect to be comment as a line with //, but it get surrounded by /* */ instead.
If I have a line commented with // it just surround again the line with /* */.
If I have the line surrounded with /* */ it toggle.

@rebornix
Copy link
Member

rebornix commented Nov 4, 2016

This one might be related to #14661 as well.

@michaeljota
Copy link
Author

Yep. I think it is. I would edit that an say that it does not matter where you try to toggle, it will use CSS style to comment instead of the SASS ones, cause if you invoke that from the command pallete it will have the same behavior.

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 4, 2016

@michaeljota, @rebornix,

Yes, this is fully related to #14661. VS Code 1.7.0/1.7.1 has incorrect behaviour with finding scopes at the cursor position. See @aeschli comment: #14661 (comment)

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 4, 2016

@alexandrudima, If I fully understand your code, this should help:

function toModeTransitions(topLevelModeId: string, modeTransitions: ModeTransition[], tokens: Token[]): ModeTransition[] {

    if (!modeTransitions || modeTransitions.length === 0) {
        return null;
    } else if (modeTransitions.length === 1 && modeTransitions[0].startIndex === 0 && modeTransitions[0].modeId === topLevelModeId) {
        return null;
    }

    // If tokens has embedded scopes, then return the transition modes
    for (let i = 0; i < tokens.length; i++) {
        if (tokens[i].type.indexOf('embedded') !== -1) {
            return modeTransitions;
        }
    }

    return null;
}

Works fine for all issues.

@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Nov 7, 2016
@alexdima alexdima added this to the October Recovery 2016 milestone Nov 7, 2016
@alexdima
Copy link
Member

alexdima commented Nov 8, 2016

Duplicate of #14661

@alexdima alexdima closed this as completed Nov 8, 2016
@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 8, 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
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants