JavaScript LS scaffolding + JS module inference#5266
Merged
RyanCavanaugh merged 14 commits intomasterfrom Nov 10, 2015
Merged
Conversation
src/services/services.ts
Outdated
Member
There was a problem hiding this comment.
Consider extracting this out into a function.
function shouldRecordAmdDefineName(index: number, moduleName: string) {
// record first item in the list only if its name is not "require"
// record second item in the list only if its name is not "exports"
// record third item in the list only if its name is not "module"
// record all other items in the list unconditionally
switch (index) {
case 0:
return moduleName !== "require";
case 1:
return moduleName !== "exports";
}
return index !== 2 || moduleName !== "module";
}
Member
Author
There was a problem hiding this comment.
We can remove the AMD logic entirely
src/compiler/checker.ts
Outdated
Member
There was a problem hiding this comment.
Don't think you need the declaration.parent.kind test. There should never be a case where that isn't true.
src/compiler/binder.ts
Outdated
Member
There was a problem hiding this comment.
We usually put a blank on both sides of the | operator.
Member
Author
|
@vladima can you address the comments in program.ts? |
# Conflicts: # tests/webTestServer.ts
# Conflicts: # lib/lib.es6.d.ts # lib/tsc.js # lib/tsserver.js # lib/typescript.d.ts # lib/typescript.js # lib/typescriptServices.d.ts # lib/typescriptServices.js # src/compiler/binder.ts # src/compiler/checker.ts # src/compiler/parser.ts # src/compiler/program.ts # src/harness/fourslash.ts
# Conflicts: # src/compiler/parser.ts
RyanCavanaugh
added a commit
that referenced
this pull request
Nov 10, 2015
JavaScript LS scaffolding + JS module inference
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a subset of the prior PR that carves out only the code we need to get a) JavaScript intellisense in general and b) CommonJS module inference in JavaScript files.
Includes work by @vladima in 'services' to get the correct compilation context to Roslyn