brackets-typescript
brackets-typescript copied to clipboard
Indentation in Brackets 1.3 does not work as expected
After Brackets update to 1.3, TS code indentation started behaving strangely. Example:
- I type if ( - right after I open parenthesis, the whole line jumps one or two tabs to the right
- I continue typing 2 > 1) { - right after the brace the whole line jumps to the column 1 (all indentation spaces are removed)
- afterwards the line remains there, subsequent lines are aligned to it
When I downgrade Brackets to 1.2, everything is fine again. Looks like a breaking change in 1.3.
So far the solution is to stay on 1.2. The problem needs a solution though. Meanwhile, is there a way to disable the formatting in the plugin with some configuration options? I had a look into the sources, but I have not found anything.
Also having indentation problems, but only when with the : sign. Everytime I use a colon, the whole line is un-indented by either 1 indent or all indents. In the below example, adding a colon to bar, would un-indent it by 2 spaces.
interface HTMLElement {
foo: boolean;
bar
}
This example is more deeply indented. Adding a colon to foo, would un-indent the entire line.
export class ApplicationDetail {
application: st.response.applications.ApplicationInfo;
timeline: Array<TimelineItem>;
foo
Just updated Brackets to 1.4 and still get the problems described by rasmk and SenHeng, it makes using typescript in Brackets quite a pain.
Having the same problems in Brackets 1.4. After typing ":" or "{" it moves line indent to left. After pressing "(" it adds extra indent to right. Seeing as how common those symbols are, it makes editing quite painful. I also could not find a way to disable the auto-indentation in Brackets.
Only way to disable auto-indent in Brackets is through the preferences file. I remember it being something like 'auto-indent' but all I could find in my prefs was smartIndent. I guess maybe the name was changed?
"smartIndent": false,
Here's a useful plug-in that shows a list of all current preferences and their default values. Should make finding the relevant tags easier.
Still not working as of 1.5
turning smartIndent to false didn't help.
Has anyone found a solution?
It worked for me when I turned off smartIndent, but it will be very helpful if there is a workaround for turn it off just when is a TypeScript file.
Thanks SenHeng! it works on Brackets 1.5.