Uh oh!
There was an error while loading. Please reload this page.
JavaScript LS scaffolding + JS module inference - #5266
Merged
Conversation
There was a problem hiding this comment.
Consider extracting this out into a function.
functionshouldRecordAmdDefineName(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 unconditionallyswitch(index){case0:
returnmoduleName!=="require";case1:
returnmoduleName!=="exports";}returnindex!==2||moduleName!=="module";}MemberAuthor
There was a problem hiding this comment.
We can remove the AMD logic entirely
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.
There was a problem hiding this comment.
We usually put a blank on both sides of the | operator.
Ryan Cavanaugh (RyanCavanaugh)
commented
Oct 22, 2015
MemberAuthor
Vladimir Matveev (@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
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 freeto 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 Vladimir Matveev (@vladima) in 'services' to get the correct compilation context to Roslyn