microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Cannot Change Auto-Format Line Length #685

Closed loganknecht closed 5 years ago

loganknecht commented 5 years ago

Hi there,

I've tried looking around a bit for this, as well as googling. Apologies if this isn't the right place to ask.

Problem

I am using the autoformat feature, but the issue is that it automatically formats aspects over 80 characters. This would be fine, except some text is long and doesn't necessarily benefit from the formatting.

I want to bump the length from 80 to 100 in order to have some more readable code.

Efforts

To my knowledge the solution is go to: preferences -> Package Settings -> TypeScript -> Plug-in Settings - User

Then in there I should set the wrap_width attribute to 100?

I did this, and my configuration looks like this:

{
    "bold_folder_labels": true,
    "caret_style": "solid",
    "color_scheme": "Packages/User/Neon (Flake8Lint).tmTheme",
    "detect_indentation": false,
    "draw_white_space": "all",
    "ensure_newline_at_eof_on_save": true,
    "fade_fold_buttons": false,
    "folder_exclude_patterns": [],
    "font_size": 15,
    "highlight_line": true,
    "ignore_vcs_packages": "true",
    "ignored_packages": [],
    "ignored_words": [],
    "rulers": [
        80,
        100
    ],
    "show_encoding": true,
    "spell_check": false,
    "tab_size": 4,
    "theme": "Default.sublime-theme",
    "translate_tabs_to_spaces": true,
    "use_tab_stops": true,
    "vintage_start_in_command_mode": true,
    "word_wrap": false,
    "wrap_width": 100
}

However this doesn't change anything, and lines are still formatted.

Question

How do I change the auto-formatter to wrap lines at 100 or any other setting instead of the default 80?

loganknecht commented 5 years ago

I'm closing this issue because it was me being a dingus. I was using JSPretter + TypeScript, and JSPrettier was doing the auto-formatting at the wrong line length. Fixed it by changing the JSPrettier line length support.

An alternate solution is to disable jsprettier and use typescript formatting, but that didn't appear to be working when I disabled it.