Commit Graph

4210 Commits

Author SHA1 Message Date
isidor
0c2f93d927 Some strict property init #81574 2019-11-15 11:37:37 +01:00
Matt Bierner
5370653cf8 Use create functions for more descriptors
For #81574

This applies the fix from #84878 to a number of other descriptor classes in our codebase
2019-11-14 17:10:53 -08:00
Matt Bierner
36a8322ae8 Convert SyncActionDescriptor to use a create function (#84878)
For #81574

See #84669 for details of the problem around strict function types. This change converts `SyncActionDescriptor` to use a static `create` function. This allows us to make the `create` function generic so that it can take the correct types for strictFunctionTypes
2019-11-14 16:49:25 -08:00
Matt Bierner
84c882df68 Fix extHost crashing due to using vscode as a value (instead of only as types) 2019-11-13 14:51:14 -08:00
Matt Bierner
a77da1b1d8 For #81574 (#84669)
Our code currently uses the `IConstructorSignature` types in a two main ways:

- As argument types in functions that take a service constructor.
- As return types or property types when we expose a service constructor in the API

This first usage is not valid with strict function types. The reason is that the `IConstructorSignature` types takes a rest array of `...services: BrandedService[]` , while the concrete constructors you pass in use actual services. With strict function types, you cannot convert the concrete constructor type to an `IConstructorSignature` because this would drop important type information that the implementation needs. As an example

```ts
class Foo {
    constructor(@ILogService service: ILogService) {}
}

registerFoo(Foo);

// The type of `ctor` inlines `IConstructorSignature0`
function registerFoo(ctor: { new(....serivces: BrandedService[]): Foo}) {
   // When registerFoo(Foo) is called, the implementation here would need to know that
   // ctor needs to be invoked with exactly one `ILogService`. However the type of `IConstructorSignature0`
   // does not express this. Strict function types therefore disallows this conversion
}
```

To fix this, I have converted a few places were we were taking `IConstructorSignature` arguments so that they preserve the full type of the constructor. This fixed over half of our 900 strict function type errors. Unfortunatly I can not figure out a more elegant way to express this besides inlining the types

However, even after this change, we still need to figure out how to deal with:

- Places in the code where `IConstructorSignature` is exposed as a return type or object property
- How to deal with all of our descriptor types (such as `SyncActionDescriptor`)
2019-11-13 14:42:42 -08:00
Andre Weinand
4a61f33994 proposed API for creating debug uri 2019-11-13 18:18:46 +01:00
Johannes Rieken
0a0f2bffe5 Merge pull request #84048 from okmttdhr/snippet-choice-builder-method
Add builder-method for snippet choice
2019-11-13 16:30:10 +01:00
Joao Moreno
44a7079ed1 fix console.warn
related to #84283
2019-11-13 10:41:46 +01:00
Matt Bierner
fe7e4b231b Use log service instead of console.log in extHostwebview
For #84283
2019-11-12 23:00:29 -08:00
Matt Bierner
7e71822af3 Hook up CustomEditorModel to workingCopyService 2019-11-12 15:54:32 -08:00
Matt Bierner
c26325fb46 Support excluding subsets of code actions for codeActionsOnSave
Fixes #84602
2019-11-12 14:28:43 -08:00
Benjamin Pasero
1a1e7c9545 debt - allow extHostSearch in common (#84109)
* debt - allow extHostSearch in common

* web - implement text search provider

* fix text search

* Update extensions/vscode-api-tests/src/extension.ts

Co-Authored-By: Rob Lourens <roblourens@gmail.com>
2019-11-12 18:57:08 +01:00
Benjamin Pasero
da5f408834 workbench editor model: getResource => resource 2019-11-12 17:04:54 +01:00
Martin Aeschlimann
12b7d0aafe window.showOpenDialog throws "TypeError: Default path must be a string" with defaultUri = null. Fixes #84325 2019-11-12 16:05:18 +01:00
Johannes Rieken
a2e9c12994 use isFile-info instead of defaulting to FileType.File, fixes #84524 2019-11-12 11:45:11 +01:00
Benjamin Pasero
5ae52b61cb files - implement ctime properly as btime (fix #84525) 2019-11-12 10:42:04 +01:00
Joao Moreno
a8f5f3e0a7 add log tracing to main thread tree views 2019-11-12 10:39:46 +01:00
Alex Ross
1aa537bf59 Use log service in exthosttask and exthosttreeviews
Part of #84283
2019-11-12 10:33:21 +01:00
Benjamin Pasero
9b620f43de Enable strictPropertyInitialization (fix #78168) 2019-11-12 08:08:37 +01:00
Matt Bierner
64489f331b Webview strict init #78168 2019-11-11 10:06:15 -08:00
Johannes Rieken
f9285ac2b5 use LogService in extHostStoragePaths and extHostRequireInterceptor, #84283 2019-11-11 15:54:58 +01:00
Johannes Rieken
8e64adbbde use LogService in extHostLanguageFeatures and extHostMessageService, #84283 2019-11-11 12:22:55 +01:00
Sandeep Somavarapu
1a644f628c #84283 Use log service 2019-11-11 10:53:21 +01:00
Johannes Rieken
cb6f3e55e7 throw error when calling getWordRange with invalid regex 2019-11-11 09:54:33 +01:00
Johannes Rieken
34bf3d97eb use LogService in extHostDiagnostics, #84283 2019-11-11 09:50:05 +01:00
Johannes Rieken
41dd402156 use LogService in extHost.api.impl, #84283 2019-11-11 09:38:21 +01:00
Johannes Rieken
296d7eb378 user LogService in extHostDecorations, #84283 2019-11-11 09:35:56 +01:00
okmttdhr
92b36ffc78 Avoid unexpected value changes 2019-11-09 21:12:44 +09:00
okmttdhr
6378c89efd Fix lint warnings 2019-11-09 20:54:52 +09:00
okmttdhr
d0bc952781 Add builder-method for snippet choice 2019-11-09 20:54:52 +09:00
Johannes Rieken
ca2acdc8b6 add logging for convertered commands #84153 2019-11-08 10:23:12 +01:00
Matt Bierner
278b4f8cfa Hookup experimental undo for customEditors
This currently is not connected to any actual actions in the editor
2019-11-07 17:22:21 -08:00
Matt Bierner
b5dbace111 Better name for codeAction types file 2019-11-07 16:00:12 -08:00
Matt Bierner
454eed71c2 💄 2019-11-07 15:57:47 -08:00
Matt Bierner
bca7206f59 Forward onEdit from webviewEditor to mainthread 2019-11-07 15:57:47 -08:00
Johannes Rieken
e5719685cc implement api commands for call hierarchy, #83274 2019-11-07 14:05:50 +01:00
Benjamin Pasero
f692972925 debt - move fileSearchManager to common (for #84106) 2019-11-07 07:28:19 +01:00
Eric Amodio
2528f75970 Fixes #83410 - FsProviders causing invalid links
When more than one ext host FileSystemProvider was registered the linkification for the scheme of the provider was causing links to get incorrectly found because the link state machine was setting up the states incorrectly

Should hopefully fix MicrosoftDocs/vsonline#28 as well
2019-11-06 18:35:17 -05:00
Benjamin Pasero
87064db103 debt - untitled editor => untitled text editor 2019-11-06 12:44:59 +01:00
Daniel Imms
e41c71b0d0 Merge branch 'master' into tyriar/63052 2019-11-05 10:32:42 -08:00
Daniel Imms
1d60909d1f Implement Terminal.creationOptions API
Fixes #63052
2019-11-05 10:30:43 -08:00
Daniel Imms
fedfbacf80 Merge pull request #84000 from microsoft/tyriar/exitCode
Support Terminal.exitStatus API
2019-11-05 09:59:23 -08:00
Daniel Imms
7215e5e9f5 Pass through undefined exit codes 2019-11-05 09:17:57 -08:00
Daniel Imms
2a0d3d0140 Support Terminal.exitStatus API
Fixes #62103
2019-11-05 09:09:39 -08:00
Alex Ross
ab89935fd3 First pass at resolving task definition and passing back to custom execution (#83764)
First pass at resolving task definition and passing back to custom execution. It only currently resolves simple predefined variables, no input, command, or defaultBuildTask.

Part of #81007
2019-11-05 16:35:21 +01:00
Johannes Rieken
31e7866e59 change names to inserting/replacing #10266 2019-11-05 08:36:45 +01:00
Matt Bierner
dcecb9eea6 Documenting thoughts on direction for custom editor API
This documents the current thinking on the custom editor api. The current api proposal is not actually implemented yet
2019-11-04 15:11:54 -08:00
Matt Bierner
cd4d7e6c2b Fix more node 12 typing errors
For #82514
2019-11-04 15:11:54 -08:00
Matt Bierner
a97738297d Fixing some more node 12 typings errors 2019-11-04 15:11:54 -08:00
Johannes Rieken
aedcdc9a8e some tests for working copy events, #43768 2019-11-04 15:57:54 +01:00