Commit Graph

34 Commits

Author SHA1 Message Date
Johannes Rieken
c92ce4014f move extHost.protocol to common, #70319 2019-03-19 15:46:01 +01:00
Johannes Rieken
5c02b50383 extHost.protocol should not depend on extHostTypes, #70319 2019-03-19 15:13:50 +01:00
Matt Bierner
37167ef695 Use nullToUndefined more widely 2019-03-11 13:49:16 -07:00
Matt Bierner
52556f9742 Auto converting let -> const where possible in mainthread and extHost
Const provides better type guards and can make logic clearer
2019-03-05 16:53:41 -08:00
Matt Bierner
aef80e8070 Auto marking fields as readonly in mainThread files 2019-03-05 16:53:40 -08:00
Alex Dima
b164459bf8 Tweaks for #62079 2019-02-18 16:41:01 +01:00
David Lechner
5f70fddbfa Add editor.indentSize option
This is an attempt to address issue #10339.

Background:

Currently, the `editor.tabSize` option does two things - it specifies the width of the tab character and it specifies how many columns to advance when the tab key is pressed. However, there is code in the wild that has a mix of spaces and tabs that expects these two values to be different.

These generally use and indent size of 2 or 4 and spaces are used for indentation until the indent becomes >= 8. The tab character size is excpected to be 8 and groups of 8 spaces are replaced with a tab character. Indent levels end up looking like 2 spaces, 4 spaces, 6 spaces, 1 tab, 1 tab + 2 spaces, and so on.

Implementation:

In the editor options, a new option, `editor.indentSize` is added. This, in conjunction with `editor.tabSize` has the same semantics as `indent_size` and `tab_width` in the well known [EditorConfig specification][1].

> indent_size: a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to "tab", the value of tab_width (if specified) will be used.
>
> tab_width: a whole number defining the number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified.

[1]: editorconfig.org

The new `indentSize` option takes a numeric value or "tab" just as EditorConfig's `indent_size`. The default value is set to "tab" so that current default behavior of VS Code does not change and existing user settings will not break.

When getting the new `indentSize` option programatically, it always returns a numeric value (just as `tabSize` does when set to the deprecated "auto" value).

In the text editor model, a new property is added for `indentSize`. Unlike the configuration options where the value of one property influences the other, In this code `tabSize` now should only mean "the width of the tab character" and `indentSize` should only mean "how may columns is one indent".

The cursor operations and shift command are updated to reflect these new semantics.
2019-02-18 12:17:13 +01:00
Matt Bierner
6d973fef89 Strict null work on main thread 2019-02-11 09:31:13 -08:00
Matt Bierner
5076c35a53 Strict null work on mainThread and extHost 2019-02-07 09:54:21 -08:00
Alex Dima
17454d4e88 Organize imports 2018-10-23 09:54:11 +02:00
Matt Bierner
29d97683a1 Add null annotations for x: T[] = null
This code pattern indicates that the type should be nullable
2018-10-11 14:25:11 -07:00
Matt Bierner
8087b0a8d8 Remove use strict directives in main vs code ts files (part 2)
We compile using the alwaysStrict flag so these directives are not needed

This part removes most `use strict` directives that are right after the file header
2018-10-02 16:11:05 -07:00
Benjamin Pasero
c460ac4787 grid - make platform editor service specific for code editors 2018-05-16 12:08:29 +02:00
Alex Dima
aac0b16646 Fixes #23539 2018-05-04 16:47:51 +02:00
Alex Dima
292732cd19 Clarify editor focus related methods 2018-05-04 15:22:56 +02:00
isidor
f470ce19e7 textModel: add isForSimpleWidget property so these model are not synchronized 2018-03-20 16:25:10 +01:00
Matt Bierner
81767beaca Make Event a named export
There are many places in the code that do `import Event, { ...} from '.../event'`.
2018-03-14 14:25:30 -07:00
Matt Bierner
f94cea3742 Mark private emitters as readonly 2018-03-14 13:57:38 -07:00
Matt Bierner
2279b4d252 Scroll sync markdown editor with markdown preview (#44454)
Fixes #19459

Syncs the markdown preview's viewport with the markdown editor's using the proposed visible ranges API
2018-02-26 16:46:54 -08:00
Alex Dima
5133a79e40 Avoid NPE 2018-02-26 22:12:18 +01:00
Alex Dima
20ed3d9632 Fixes #44424: Add proposed API - TextEditor.visibleRanges 2018-02-26 21:28:09 +01:00
Alex Dima
6aadb1ad40 Send text editor properties updates in a single event 2018-02-26 16:51:57 +01:00
Alex Dima
45fee5691b Simplify IIdentifiedSingleEditOperation 2018-01-05 11:10:54 +02:00
Alex Dima
54e7055c12 Rename IModel to ITextModel 2018-01-04 16:44:40 +02:00
Alex Dima
0721df783d Extract model types out of editorCommon.ts 2018-01-04 16:27:58 +02:00
Alex Dima
2393d4e3c2 Simplify renderLineNumbers implementation 2017-11-14 16:55:04 +01:00
Alex Dima
e499dc62b5 Reduce usages of ICommonCodeEditor (#37834) 2017-11-10 10:08:39 +01:00
Alex Dima
8a79656f6a vs/editor/contrib is /browser/ by convention (#37834) 2017-11-08 22:54:31 +01:00
Alex Dima
324650128e Add fast path for vscode.TextEditor.setDecorations 2017-10-16 22:48:45 +02:00
Alex Dima
e070afceab Editor: reveal* family of methods take a ScrollType which can be Smooth or Immediate 2017-08-30 16:18:21 +02:00
Benjamin Pasero
8b7a2e6d2b Editor model creation options do not honour folder scope yet (#32695)
* Editor model creation options do not honour folder scope yet (fixes #29119)

* fix tests
2017-08-24 08:02:21 +02:00
Jens Hausdorf
544d44350b remove double semicolons (#28110) 2017-06-06 13:51:23 -07:00
Johannes Rieken
8b86237a81 wire up new controller and main thread editor 2017-05-12 11:33:36 +02:00
Johannes Rieken
b548d2128d split things up into api/node and api/electron-browser 2017-05-12 11:24:22 +02:00