Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TS 2.4 Errors in extHost.api.impl.ts #28151

Closed
mjbvz opened this issue Jun 6, 2017 · 3 comments
Closed

Fix TS 2.4 Errors in extHost.api.impl.ts #28151

mjbvz opened this issue Jun 6, 2017 · 3 comments
Assignees
Labels
engineering VS Code - Build / issue tracking / etc.
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jun 6, 2017

Errors
In extHost.api.impl.ts:

[14:20:06] Error: /Users/matb/projects/vscode/src/vs/workbench/api/node/extHost.api.impl.ts(121,63): Type 'ExtHostSCM' does not satisfy the constraint 'ExtHostSCMShape'.
  Types of property '$provideOriginalResource' are incompatible.
    Type '(sourceControlHandle: number, uri: URI) => TPromise<Uri>' is not assignable to type '(sourceControlHandle: number, uri: URI) => TPromise<URI>'.
      Type 'TPromise<Uri>' is not assignable to type 'TPromise<URI>'.
        Type 'Uri' is not assignable to type 'URI'.
          Property '_scheme' is missing in type 'Uri'.
[14:20:06] Error: /Users/matb/projects/vscode/src/vs/workbench/api/node/extHost.api.impl.ts(300,9): Type '{ readonly activeTextEditor: ExtHostTextEditor; readonly visibleTextEditors: TextEditor[]; showTe...' is not assignable to type 'typeof window'.
  Types of property 'showInformationMessage' are incompatible.
    Type '(message: any, first: any, ...rest: any[]) => Thenable<string | MessageItem>' is not assignable to type '{ (message: string, ...items: string[]): Thenable<string>; (message: string, options: MessageOpti...'.
      Type 'Thenable<string | MessageItem>' is not assignable to type 'Thenable<string>'.
        Type 'string | MessageItem' is not assignable to type 'string'.
          Type 'MessageItem' is not assignable to type 'string'.
[14:20:06] Error: /Users/matb/projects/vscode/src/vs/workbench/api/node/extHost.api.impl.ts(378,9): Type '{ rootPath: string; asRelativePath: (pathOrUri: string | Uri) => string; findFiles: (include: str...' is not assignable to type 'typeof workspace'.
  Types of property 'onDidChangeConfiguration' are incompatible.
    Type '(listener: () => any, thisArgs?: any, disposables?: Disposable[]) => IDisposable' is not assignable to type 'Event<void>'.
      Types of parameters 'listener' and 'listener' are incompatible.

How to investigate

  • Install TS 2.4 in the vscode workspace by running npm install typescript@next
  • Make sure vscode is using the workspace version of TS for error reporting by running the Select TypeScript versions command
@mjbvz mjbvz added the engineering VS Code - Build / issue tracking / etc. label Jun 6, 2017
@mjbvz mjbvz added this to the June 2017 milestone Jun 6, 2017
joaomoreno added a commit that referenced this issue Jun 14, 2017
@joaomoreno
Copy link
Member

I fixed the first and third errors.

The second one is a TypeScript bug, IMO. Check this out:

declare function bar(): string | number;

declare namespace foo {
	export function bar(): string;
	export function bar(): number;
}

const obj: typeof foo = {
	bar() {
		return bar();
	}
}

TypeScript 2.4 can't match the type of obj with foo, which seems to be to be incorrect.

@joaomoreno joaomoreno assigned mjbvz and unassigned joaomoreno Jun 14, 2017
@mjbvz
Copy link
Contributor Author

mjbvz commented Jun 14, 2017

Thanks. I believe this is the same issue I reported here: microsoft/TypeScript#16412 which itself was marked as a duplicate of microsoft/TypeScript#14107

Not sure what the best workaround is in this case. Let me take another look

@mjbvz
Copy link
Contributor Author

mjbvz commented Jun 19, 2017

Not seeing errors using 2.4 RC anymore

@mjbvz mjbvz closed this as completed Jun 19, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc.
Projects
None yet
Development

No branches or pull requests

2 participants