OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analysis_server.src.server_options; | 5 library analysis_server.src.server_options; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
11 import 'package:yaml/yaml.dart'; | 11 import 'package:yaml/yaml.dart'; |
12 | 12 |
13 const _optionsFileName = 'dart_analysis_server.options'; | 13 //TODO: consider renaming (https://github.com/dart-lang/sdk/issues/23927) |
| 14 const _optionsFileName = '.dart_analysis_server.yaml'; |
14 | 15 |
15 /// The shared options instance. | 16 /// The shared options instance. |
16 ServerOptions _serverOptions; | 17 ServerOptions _serverOptions; |
17 | 18 |
18 /// Server options. | 19 /// Server options. |
19 ServerOptions get serverOptions { | 20 ServerOptions get serverOptions { |
20 if (_serverOptions == null) { | 21 if (_serverOptions == null) { |
21 _serverOptions = _loadOptions(); | 22 _serverOptions = _loadOptions(); |
22 } | 23 } |
23 return _serverOptions; | 24 return _serverOptions; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 var doc = loadYaml(contents); | 102 var doc = loadYaml(contents); |
102 if (doc is YamlMap) { | 103 if (doc is YamlMap) { |
103 doc.forEach((k, v) { | 104 doc.forEach((k, v) { |
104 if (k is String) { | 105 if (k is String) { |
105 _options[k] = v; | 106 _options[k] = v; |
106 } | 107 } |
107 }); | 108 }); |
108 } | 109 } |
109 } | 110 } |
110 } | 111 } |
OLD | NEW |