File tree 13 files changed +244
-105
lines changed
tests/baselines/reference 13 files changed +244
-105
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,22 @@ module ts {
10
10
/** The version of the TypeScript compiler release */
11
11
export let version = "1.5.0.0" ;
12
12
13
+ export function findConfigFile ( searchPath : string ) : string {
14
+ var fileName = "tsconfig.json" ;
15
+ while ( true ) {
16
+ if ( sys . fileExists ( fileName ) ) {
17
+ return fileName ;
18
+ }
19
+ var parentPath = getDirectoryPath ( searchPath ) ;
20
+ if ( parentPath === searchPath ) {
21
+ break ;
22
+ }
23
+ searchPath = parentPath ;
24
+ fileName = "../" + fileName ;
25
+ }
26
+ return undefined ;
27
+ }
28
+
13
29
export function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost {
14
30
let currentDirectory : string ;
15
31
let existingDirectories : Map < boolean > = { } ;
Original file line number Diff line number Diff line change @@ -132,23 +132,6 @@ module ts {
132
132
return typeof JSON === "object" && typeof JSON . parse === "function" ;
133
133
}
134
134
135
- function findConfigFile ( ) : string {
136
- var searchPath = normalizePath ( sys . getCurrentDirectory ( ) ) ;
137
- var fileName = "tsconfig.json" ;
138
- while ( true ) {
139
- if ( sys . fileExists ( fileName ) ) {
140
- return fileName ;
141
- }
142
- var parentPath = getDirectoryPath ( searchPath ) ;
143
- if ( parentPath === searchPath ) {
144
- break ;
145
- }
146
- searchPath = parentPath ;
147
- fileName = "../" + fileName ;
148
- }
149
- return undefined ;
150
- }
151
-
152
135
export function executeCommandLine ( args : string [ ] ) : void {
153
136
var commandLine = parseCommandLine ( args ) ;
154
137
var configFileName : string ; // Configuration file name (if any)
@@ -198,7 +181,8 @@ module ts {
198
181
}
199
182
}
200
183
else if ( commandLine . fileNames . length === 0 && isJSONSupported ( ) ) {
201
- configFileName = findConfigFile ( ) ;
184
+ var searchPath = normalizePath ( sys . getCurrentDirectory ( ) ) ;
185
+ configFileName = findConfigFile ( searchPath ) ;
202
186
}
203
187
204
188
if ( commandLine . fileNames . length === 0 && ! configFileName ) {
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -550,11 +550,11 @@ module ts.server {
550
550
}
551
551
552
552
return completions . entries . reduce ( ( result : protocol . CompletionEntry [ ] , entry : ts . CompletionEntry ) => {
553
- if ( completions . isMemberCompletion || entry . name . indexOf ( prefix ) == 0 ) {
553
+ if ( completions . isMemberCompletion || ( entry . name . toLowerCase ( ) . indexOf ( prefix . toLowerCase ( ) ) == 0 ) ) {
554
554
result . push ( entry ) ;
555
555
}
556
556
return result ;
557
- } , [ ] ) ;
557
+ } , [ ] ) . sort ( ( a , b ) => a . name . localeCompare ( b . name ) ) ;
558
558
}
559
559
560
560
getCompletionEntryDetails ( line : number , offset : number ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "module" : " commonjs" ,
4
+ "noImplicitAny" : true ,
5
+ "removeComments" : true ,
6
+ "preserveConstEnums" : true ,
7
+ "out" : " ../../built/local/tsserver.js" ,
8
+ "sourceMap" : true
9
+ },
10
+ "files" : [
11
+ " node.d.ts" ,
12
+ " editorServices.ts" ,
13
+ " protocol.d.ts" ,
14
+ " server.ts" ,
15
+ " session.ts"
16
+ ]
17
+ }
Original file line number Diff line number Diff line change @@ -1475,6 +1475,7 @@ declare module "typescript" {
1475
1475
declare module "typescript " {
1476
1476
/** The version of the TypeScript compiler release */
1477
1477
let version : string ;
1478
+ function findConfigFile ( searchPath : string ) : string ;
1478
1479
function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost ;
1479
1480
function getPreEmitDiagnostics ( program : Program ) : Diagnostic [ ] ;
1480
1481
function flattenDiagnosticMessageText ( messageText : string | DiagnosticMessageChain , newLine : string ) : string ;
Original file line number Diff line number Diff line change @@ -4736,6 +4736,10 @@ declare module "typescript" {
4736
4736
let version: string;
4737
4737
>version : string
4738
4738
4739
+ function findConfigFile(searchPath: string): string;
4740
+ >findConfigFile : (searchPath: string) => string
4741
+ >searchPath : string
4742
+
4739
4743
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
4740
4744
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
4741
4745
>options : CompilerOptions
Original file line number Diff line number Diff line change @@ -1506,6 +1506,7 @@ declare module "typescript" {
1506
1506
declare module "typescript " {
1507
1507
/** The version of the TypeScript compiler release */
1508
1508
let version : string ;
1509
+ function findConfigFile ( searchPath : string ) : string ;
1509
1510
function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost ;
1510
1511
function getPreEmitDiagnostics ( program : Program ) : Diagnostic [ ] ;
1511
1512
function flattenDiagnosticMessageText ( messageText : string | DiagnosticMessageChain , newLine : string ) : string ;
Original file line number Diff line number Diff line change @@ -4882,6 +4882,10 @@ declare module "typescript" {
4882
4882
let version: string;
4883
4883
>version : string
4884
4884
4885
+ function findConfigFile(searchPath: string): string;
4886
+ >findConfigFile : (searchPath: string) => string
4887
+ >searchPath : string
4888
+
4885
4889
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
4886
4890
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
4887
4891
>options : CompilerOptions
Original file line number Diff line number Diff line change @@ -1507,6 +1507,7 @@ declare module "typescript" {
1507
1507
declare module "typescript " {
1508
1508
/** The version of the TypeScript compiler release */
1509
1509
let version : string ;
1510
+ function findConfigFile ( searchPath : string ) : string ;
1510
1511
function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost ;
1511
1512
function getPreEmitDiagnostics ( program : Program ) : Diagnostic [ ] ;
1512
1513
function flattenDiagnosticMessageText ( messageText : string | DiagnosticMessageChain , newLine : string ) : string ;
Original file line number Diff line number Diff line change @@ -4832,6 +4832,10 @@ declare module "typescript" {
4832
4832
let version: string;
4833
4833
>version : string
4834
4834
4835
+ function findConfigFile(searchPath: string): string;
4836
+ >findConfigFile : (searchPath: string) => string
4837
+ >searchPath : string
4838
+
4835
4839
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
4836
4840
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
4837
4841
>options : CompilerOptions
Original file line number Diff line number Diff line change @@ -1544,6 +1544,7 @@ declare module "typescript" {
1544
1544
declare module "typescript " {
1545
1545
/** The version of the TypeScript compiler release */
1546
1546
let version : string ;
1547
+ function findConfigFile ( searchPath : string ) : string ;
1547
1548
function createCompilerHost ( options : CompilerOptions , setParentNodes ?: boolean ) : CompilerHost ;
1548
1549
function getPreEmitDiagnostics ( program : Program ) : Diagnostic [ ] ;
1549
1550
function flattenDiagnosticMessageText ( messageText : string | DiagnosticMessageChain , newLine : string ) : string ;
Original file line number Diff line number Diff line change @@ -5005,6 +5005,10 @@ declare module "typescript" {
5005
5005
let version: string;
5006
5006
>version : string
5007
5007
5008
+ function findConfigFile(searchPath: string): string;
5009
+ >findConfigFile : (searchPath: string) => string
5010
+ >searchPath : string
5011
+
5008
5012
function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost;
5009
5013
>createCompilerHost : (options: CompilerOptions, setParentNodes?: boolean) => CompilerHost
5010
5014
>options : CompilerOptions
You can’t perform that action at this time.
0 commit comments