Skip to content

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

Closed

Description

  • 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.

Activity

  1. rebornix commented on Nov 4, 2016

    @rebornix
    Contributor

    This one might be related to #14661 as well.

  2. michaeljota commented on Nov 4, 2016

    @michaeljota
    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.

  3. mrmlnc commented on Nov 4, 2016

    @mrmlnc
    Contributor

    Michael De Abreu (@michaeljota), Peng Lyu (@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 Martin Aeschlimann (@aeschli) comment: #14661 (comment)

  4. mrmlnc commented on Nov 4, 2016

    @mrmlnc
    Contributor

    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.

  5. added
    bug
    on Nov 7, 2016
  6. alexdima commented on Nov 8, 2016

    @alexdima
    Member

    Duplicate of #14661

  7. added
    *duplicate
    on Nov 8, 2016
  8. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatebug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions