Skip to content

expose code path that will use Path type to avoid redundant string conversions#8560

Merged
vladima merged 1 commit into
masterfrom
perfWork
May 11, 2016
Merged

expose code path that will use Path type to avoid redundant string conversions#8560
vladima merged 1 commit into
masterfrom
perfWork

Conversation

@vladima

@vladima vladima commented May 11, 2016

Copy link
Copy Markdown
Contributor

reduces amount of allocations on a happy path in language service when we can reuse program structure

Comment thread src/compiler/types.ts

export interface CompilerHost extends ModuleResolutionHost {
getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;
getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile;

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.

should not path be the first argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need both on the LS since file name is used to query managed side for the script snapshot. With this order it is just consistent with getSourceFile where fileName is a first argument

@mhegazy

mhegazy commented May 11, 2016

Copy link
Copy Markdown
Contributor

👍

@vladima vladima merged commit cd11d3d into master May 11, 2016
@vladima vladima deleted the perfWork branch May 11, 2016 21:25
@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.

3 participants