Skip to content

For import completion of default import, convert module name to identifier#19875

Merged
2 commits merged into
masterfrom
completionsDefault
Nov 9, 2017
Merged

For import completion of default import, convert module name to identifier#19875
2 commits merged into
masterfrom
completionsDefault

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 9, 2017

Fixes #19841

@ghost ghost requested a review from armanio123 November 9, 2017 17:49
@ghost ghost force-pushed the completionsDefault branch from 8b0163b to d3bd8ea Compare November 9, 2017 18:07
Comment thread src/compiler/types.ts Outdated
YieldKeyword,
// Contextual keywords
AbstractKeyword,
/* @internal */ FirstContextualKeyword = AbstractKeyword,
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.

we keep them all at the bottom..

Comment thread src/services/codefixes/importFixes.ts Outdated
return moduleSpecifierToValidIdentifier(removeFileExtension(getBaseFileName(moduleSymbol.name)));
}

function moduleSpecifierToValidIdentifier(moduleSpecifier: string): string {
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.

pass in the compilerOptions, and use the target when calling isIdentifierStart

if (isValid) {
let char = String.fromCharCode(ch);
if (!lastCharWasValid) {
char = char.toUpperCase();
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.

:)

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Nov 9, 2017

We also need to port this to release-2.6

@ghost ghost merged commit 65a191f into master Nov 9, 2017
@ghost ghost deleted the completionsDefault branch November 9, 2017 21:13
ghost pushed a commit that referenced this pull request Nov 9, 2017
…ifier (#19875)

* For import completion of default import, convert module name to identifier

* Suggestions from code review
ghost pushed a commit that referenced this pull request Nov 9, 2017
…ifier (#19875) (#19883)

* For import completion of default import, convert module name to identifier

* Suggestions from code review
@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