Commit Graph

742 Commits

Author SHA1 Message Date
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
52f8705214 Strict null work for quick input 2019-02-14 14:33:56 -08:00
Martin Aeschlimann
dd40499fda Use URI for linkDTO 2019-02-14 18:24:32 +01:00
Johannes Rieken
3283483974 add formatter call, use it for no-formatter-case for now #41882 2019-02-14 11:16:32 +01:00
Peng Lyu
54c75aa50b support icons 2019-02-13 19:34:35 -08:00
Johannes Rieken
a45fb4099c make insets fit into layering scheme 2019-02-13 16:23:52 +01:00
Johannes Rieken
ac03e62afc last round of making changes smaller 2019-02-13 15:20:29 +01:00
Johannes Rieken
58d2b5be06 disable event for now, remove extension location from provider 2019-02-13 14:46:31 +01:00
Johannes Rieken
44b7588362 remove getNamedCustomer, connect MainThreadWebview with CodeInsetController 2019-02-13 12:47:46 +01:00
Johannes Rieken
8246c1648f workbenchs/parts became workbench/contrib 2019-02-13 12:47:46 +01:00
Johannes Rieken
ace73c05b7 move rest code code inset to workbench out of (monaco) editor 2019-02-13 12:47:46 +01:00
Rob DeLine
066dfef8f7 Add Code Inset Feature 2019-02-13 12:46:25 +01:00
Matt Bierner
14e4835a55 Strict null extHostWorkspace 2019-02-11 16:41:59 -08:00
Matt Bierner
f9687fc5ec Strict null work on extHostLanguageFeatures 2019-02-11 09:31:13 -08:00
Matt Bierner
9ee6077373 Strict null work in extHost 2019-02-11 09:31:13 -08:00
Daniel Imms
c7f83b2c85 Strict null check mainThreadTerminalService
Part of #60565
2019-02-11 04:35:20 -08:00
Johannes Rieken
d50b568d87 multiple cursor in internal api of smart select, #41838 2019-02-11 11:34:09 +01:00
Sandeep Somavarapu
16a2c2e3fa Merge branch 'master' into sandy081/remoteMRWorkspace 2019-02-11 10:23:58 +01:00
Benjamin Pasero
7c1fe9a7d6 debt - move search out of platform 2019-02-09 17:02:31 +01:00
Matt Bierner
fdc710af64 Strict null work for main thread debug, tasks, and output 2019-02-08 17:16:08 -08:00
Johannes Rieken
b6da3af518 make sure to gc-track commands of code lens objects 2019-02-08 16:58:51 +01:00
Alex Dima
2ba52db77a Reroute activation for hosted extensions 2019-02-08 11:54:23 +01:00
Matt Bierner
1cd1f81106 Strict null check extensionHost.ts 2019-02-07 15:35:15 -08:00
Matt Bierner
5076c35a53 Strict null work on mainThread and extHost 2019-02-07 09:54:21 -08:00
Johannes Rieken
0693cb7afc debt - don't track recursive but explict, #67694 2019-02-07 13:56:26 +01:00
Sandeep Somavarapu
db81580e7f Merge branch 'master' into sandy081/remoteMRWorkspace 2019-02-07 12:41:42 +01:00
Benjamin Pasero
35523f6c51 debt - workbench/parts => workbench/contrib (update imports and scripts) 2019-02-07 11:48:58 +01:00
Matt Bierner
ea577a79e4 Strict null check more mainThread and extHost files 2019-02-06 18:22:33 -08:00
Matt Bierner
96e13e6cbf Unblock mainThread and extHost files from being strict null checked 2019-02-06 17:54:31 -08:00
Matt Bierner
b6087b2021 Fixing more strict null errros in extHost and related files 2019-02-05 15:59:38 -08:00
Daniel Imms
98eb895141 Implement onDidChangeTerminalDimensions
Fixes #55718
2019-02-05 04:44:13 -08:00
Daniel Imms
8846757657 Move cwd ownership into terminal process 2019-01-28 06:06:36 -08:00
Johannes Rieken
f824581042 fix #67120 2019-01-28 14:04:43 +01:00
Sandeep Somavarapu
aba0fcbb58 Delay extension host until workspace is completely initialized 2019-01-28 10:54:45 +01:00
Peng Lyu
130fdbee2b reaction api 2019-01-27 15:06:33 -08:00
Alex Dima
b2736fdc7c Capture console log and send it through the extension host protocol 2019-01-22 20:03:24 +01:00
Alex Dima
c16d569a32 Add IInitData.resolvedExtensions 2019-01-22 20:01:56 +01:00
Johannes Rieken
97ed8aba29 add developer command that prints available formatters to console, #41882 2019-01-21 18:19:02 -08:00
Johannes Rieken
232006c427 use electron openExternal, return boolean-promise, rename to 'open', #66741 2019-01-21 17:03:15 -08:00
Matt Bierner
bcc2281e45 Rename CodeAction.canAutoApply -> CodeAction.preferred
Part of #62110

Use the more generic name as suggested in https://github.com/Dart-Code/Dart-Code/issues/1393. This makes the intent of the field more clear and also allows us to extend the concept of preferred code actions to refactorings and other classes of code actions

Experimentally also allows a `preferred` value for `apply` when configuring code aciton keyboard shortcuts. This applies the preferred code action returned from the list of code actions returned
2019-01-21 14:09:30 -08:00
Johannes Rieken
f9d0c4b2cb wire up read/write correctly, #66759 2019-01-18 18:51:39 -08:00
Johannes Rieken
073aba1923 first cut proposed api for vscode.open, #66741 2019-01-18 11:27:26 -08:00
Alex Dima
ae72d6983d Handle added/removed extensions in bulk 2019-01-18 17:16:46 +01:00
isidor
7bd16e21c8 label service new structure for formatters 2019-01-17 18:04:37 +01:00
Matt Bierner
1904cd8d84 Prototype auto fixable quick fixes
Part of #62110

- Adds a new field `canAutoApply` to code actions. This field indicates that a code action can be applied without additional user input. For quick fixes, this should be set if the fix properly addresses the error

- Enable auto fixes for TS spelling errors

- Added a `editor.action.autoFix` command to triggers auto fixes at the current cursor position
2019-01-16 17:56:22 -08:00
Alex Dima
924b7a1fea Handle the case of removing an extension from the extension host 2019-01-15 23:04:45 +01:00
Alex Dima
471a786cf3 Activate newly installed/enabled extensions 2019-01-15 13:51:15 +01:00
Alex Dima
2fe9de8511 Initialize configuration data through ExtHostConfiguration 2019-01-14 17:28:14 +01:00
Gabriel DeBacker
e1d8493f28 Implement creating a razzle terminal with approved API changes 2019-01-11 10:27:18 -08:00
Johannes Rieken
14ce5183db renames, #58649 2019-01-11 16:18:56 +01:00