Skip to content

Minor cleanups in pathCompletions.ts#19685

Merged
2 commits merged into
masterfrom
pathCompletion
Nov 3, 2017
Merged

Minor cleanups in pathCompletions.ts#19685
2 commits merged into
masterfrom
pathCompletion

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 2, 2017

  • Move all handling of CompletionInfo to completions.ts.
  • Use helper functions forEachAncestorDirectory and find

@ghost ghost requested a review from armanio123 November 2, 2017 17:58
): CompletionInfo | undefined {
if (isInReferenceComment(sourceFile, position)) {
return PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host);
const entries = PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host);
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.

not sure why is this better than what was there before?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Makes it so PathCompletions do less work related to CompletionInfo so it can focus on just getting the paths.

Comment thread src/services/pathCompletions.ts Outdated
/* @internal */
namespace ts.Completions.PathCompletions {
export function getStringLiteralCompletionEntriesFromModuleNames(node: StringLiteral, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): CompletionInfo {
export function getStringLiteralCompletionEntriesFromModuleNames(node: StringLiteral, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): CompletionEntry[] {
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.

if you gonna change the output, you should make getStringLiteralCompletionsFromModuleNames

@ghost ghost merged commit 1d7f449 into master Nov 3, 2017
@ghost ghost deleted the pathCompletion branch November 3, 2017 22:06
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
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.

1 participant