OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library socket.server; | 5 library socket.server; |
6 | 6 |
7 import 'package:analysis_server/protocol/protocol.dart'; | 7 import 'package:analysis_server/protocol/protocol.dart'; |
8 import 'package:analysis_server/protocol/protocol_generated.dart'; | 8 import 'package:analysis_server/protocol/protocol_generated.dart'; |
9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
10 import 'package:analysis_server/src/channel/channel.dart'; | 10 import 'package:analysis_server/src/channel/channel.dart'; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (analysisServerOptions.fileReadMode == 'as-is') { | 81 if (analysisServerOptions.fileReadMode == 'as-is') { |
82 resourceProvider = PhysicalResourceProvider.INSTANCE; | 82 resourceProvider = PhysicalResourceProvider.INSTANCE; |
83 } else if (analysisServerOptions.fileReadMode == 'normalize-eol-always') { | 83 } else if (analysisServerOptions.fileReadMode == 'normalize-eol-always') { |
84 resourceProvider = new PhysicalResourceProvider( | 84 resourceProvider = new PhysicalResourceProvider( |
85 PhysicalResourceProvider.NORMALIZE_EOL_ALWAYS); | 85 PhysicalResourceProvider.NORMALIZE_EOL_ALWAYS); |
86 } else { | 86 } else { |
87 throw new Exception( | 87 throw new Exception( |
88 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); | 88 'File read mode was set to the unknown mode: $analysisServerOptions.fi
leReadMode'); |
89 } | 89 } |
90 | 90 |
91 Index index = null; | |
92 if (!analysisServerOptions.noIndex) { | |
93 index = createMemoryIndex(); | |
94 } | |
95 | |
96 analysisServer = new AnalysisServer( | 91 analysisServer = new AnalysisServer( |
97 serverChannel, | 92 serverChannel, |
98 resourceProvider, | 93 resourceProvider, |
99 new PubPackageMapProvider(resourceProvider, defaultSdk), | 94 new PubPackageMapProvider(resourceProvider, defaultSdk), |
100 index, | 95 createMemoryIndex(), |
101 serverPlugin, | 96 serverPlugin, |
102 analysisServerOptions, | 97 analysisServerOptions, |
103 sdkManager, | 98 sdkManager, |
104 instrumentationService, | 99 instrumentationService, |
105 diagnosticServer: diagnosticServer, | 100 diagnosticServer: diagnosticServer, |
106 fileResolverProvider: fileResolverProvider, | 101 fileResolverProvider: fileResolverProvider, |
107 packageResolverProvider: packageResolverProvider, | 102 packageResolverProvider: packageResolverProvider, |
108 useSingleContextManager: useSingleContextManager, | 103 useSingleContextManager: useSingleContextManager, |
109 rethrowExceptions: false); | 104 rethrowExceptions: false); |
110 analysisServer.userDefinedPlugins = userDefinedPlugins; | 105 analysisServer.userDefinedPlugins = userDefinedPlugins; |
111 } | 106 } |
112 } | 107 } |
OLD | NEW |