skip to Main Content

I’m trying to change the line length for Code wrapping in VSCode I’ve tried a lot of solutions here in Stackoverflow but it didn’t work out for me, something weird.
This is an image of a dart code shows the code wrapped if it exceeded that column:

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    It took me long to find but finally here in Stackoverflow. changing only editor.wordwrap in settings.json won't do it for Dart code/formatter, these setting I think is for general Vscode but should be added also:

    {
       "editor.wordWrap": "wordWrapColumn",
       "editor.wordWrapColumn": 120,
       "editor.rulers": [120]
    }
    

    As for it to work for "Dart" code, these settings should be added:

    "dart.lineLength": 120,
    "[dart]": {
        "editor.rulers": [
            120
        ],
    }
    

    Thanks for all who answered in that question: Changing wordwrapping and formatting for Dart code in VSCode


  2. You can try to add these (adjust the numbers yourself) in your settings.json:

    {
        "editor.wordWrap": "wordWrapColumn",
        "editor.wordWrapColumn": 120,
        "editor.rulers": [120]
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search