Skip to content

Make it possible to cancel requests to get diagnostics.#3561

Merged
CyrusNajmabadi merged 7 commits into
masterfrom
cancellableDiagnostics
Jul 6, 2015
Merged

Make it possible to cancel requests to get diagnostics.#3561
CyrusNajmabadi merged 7 commits into
masterfrom
cancellableDiagnostics

Conversation

@CyrusNajmabadi

Copy link
Copy Markdown
Contributor

If a diagnostic request is actually canceled, we will throw away the type checker as we cannot be certain that it is still in a usable state.

I recommend reviewing this with ?w=1 to make the diff easier to understand.

Conflicts:
	src/compiler/checker.ts
	src/compiler/program.ts
	src/compiler/types.ts
	src/services/services.ts
Comment thread src/compiler/program.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we passing a cancellation token here. the program has access to the host, and the host has a cancellation token already.

Conflicts:
	src/services/services.ts
	src/services/shims.ts
CyrusNajmabadi added a commit that referenced this pull request Jul 6, 2015
Make it possible to cancel requests to get diagnostics.
@CyrusNajmabadi CyrusNajmabadi merged commit 9b2d44a into master Jul 6, 2015
@CyrusNajmabadi CyrusNajmabadi deleted the cancellableDiagnostics branch July 6, 2015 22:58
@mihailik

mihailik commented Jul 7, 2015

Copy link
Copy Markdown
Contributor

Assume I queue an operation on a large file, and cancel half way through. Would that make subsequent operations any faster?

I understand majority of the caching is thrown away on cancellation. But is it a majority or all of it?

Say, do you keep any parsing state, identifier/string tables etc.?

@JsonFreeman

Copy link
Copy Markdown
Contributor

The only thing that can be cancelled here is getting errors, which triggers a type check of the program. When that is cancelled, the type checker and all objects it created are thrown away. The parse trees and interned string tables are not associated with the type checker, so those stick around.

But keep in mind that the most common reason for cancellation is an edit, so there may be other things that get discarded as a result of the edit.

@mhegazy

mhegazy commented Jul 7, 2015

Copy link
Copy Markdown
Contributor

@CyrusNajmabadi why was that merged. i have not signed off on it, nor have we discussed it in person!

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants