TypeScript-Sublime-Plugin: Plugin breaks the "use_tab_stops" option

From the default sublime settings files:

    // If translate_tabs_to_spaces is true, use_tab_stops will make tab and
    // backspace insert/delete up to the next tabstop
    "use_tab_stops": true,

When this plugin is enabled, that option does not work. When this plugin is disabled, the option is honored.

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Reactions: 8
  • Comments: 24 (5 by maintainers)

Most upvoted comments

I actually found a solution: replace all occurences of use_tab_stops: false to true in the plugin itself. In those 4 files: TypeScriptReact.sublime-settings JavaScript.sublime-settings TypeScript.sublime-settings typescript/libs/view_helpers.py

I still prefer Sublime over VS Code. I have my habits, and I’m still more efficient with Sublime.

Now the only other thing that bugs me about the TypeScript plugin is that I lost the file-scope autocomplete. When you start typing a word that is used elsewhere in the file it will show up in the autocomplete popup. I use that a lot, and it’s really useful for example when you used a new property somewhere in the file then want to declare it in the class. Especially if the property name is a long and complex name.

I think this is a covert effort to get everyone on Visual Studio Code. 😉I too was forced to use VS Code. Note: I still switch back to Sublime Text when I’m coding in other languages, but TS seems to only have true support on VS Code.

After asking for help with this problem on the Sublime forum, I was informed that I could get proper behavior by ditching the plugin in favor of just installing the Typescript syntax highlighting.

  • Select menu Sublime Text|Preferences|Browse Packages… to pull up the Sublime Packages/ directory.
  • Place the syntax highlighting file in Packages/User/.

This suits me fine because I’ve found the Typescript automatic linting to be a bit flaky.

(The Typescript syntax highlighting files are found in another repo.)

If you have translate_tabs_to_spaces set to true, then when use_tab_stops is true, pressing backspace at the point where a tab was inserted will (should) remove all the spaces inserted for that tab, instead of just a single space character.

For example, if you open a brace and press enter, the next line will auto-indent. Pressing backspace once should remove all spaces inserted for the indentation, instead of only a single space.

When this plugin is installed, that behavior does not work.