Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

remove usages of `Default::default()`

author
Giacomo Cavalieri
committer
Louis Pilfold
date (Jun 24, 2026, 8:29 PM +0100) commit a1f346e1 parent de9bc743 change-id twrnoxpz
+206 -190
+1 -1
compiler-cli/src/fs.rs
··· 96 96 impl ProjectIO { 97 97 pub fn new() -> Self { 98 98 Self { 99 - beam_compiler: Default::default(), 99 + beam_compiler: Arc::new(Mutex::new(None)), 100 100 } 101 101 } 102 102
+1
compiler-cli/src/lib.rs
··· 23 23 clippy::option_option, 24 24 clippy::verbose_file_reads, 25 25 clippy::unnested_or_patterns, 26 + clippy::default_trait_access, 26 27 rust_2018_idioms, 27 28 missing_debug_implementations, 28 29 missing_copy_implementations,
+2 -2
compiler-cli/src/publish.rs
··· 987 987 fn prevent_publish_local_dependency() { 988 988 let config = PackageConfig { 989 989 dependencies: [("provided".into(), Requirement::path("./path/to/package"))].into(), 990 - ..Default::default() 990 + ..PackageConfig::default() 991 991 }; 992 992 assert_eq!( 993 993 metadata_config(&config, &HashMap::new(), &[], &[]), ··· 1005 1005 Requirement::git("https://github.com/gleam-lang/gleam.git", "da6e917"), 1006 1006 )] 1007 1007 .into(), 1008 - ..Default::default() 1008 + ..PackageConfig::default() 1009 1009 }; 1010 1010 assert_eq!( 1011 1011 metadata_config(&config, &HashMap::new(), &[], &[]),
+2 -1
compiler-core/src/build/package_compiler.rs
··· 11 11 use crate::io::files_with_extension; 12 12 use crate::line_numbers::{self, LineNumbers}; 13 13 use crate::type_::PRELUDE_MODULE_NAME; 14 + use crate::type_::printer::Names; 14 15 use crate::{ 15 16 Error, Result, Warning, 16 17 ast::{SrcSpan, TypedModule, UntypedModule}, ··· 720 721 let _ = failed_modules.insert( 721 722 name.clone(), 722 723 FailedModule { 723 - names: Default::default(), 724 + names: Box::new(Names::new()), 724 725 path: path.clone(), 725 726 src: code.clone(), 726 727 errors,
+1 -1
compiler-core/src/build/package_loader.rs
··· 1685 1685 ) -> Self { 1686 1686 Self { 1687 1687 package, 1688 - collection: Default::default(), 1688 + collection: HashMap::new(), 1689 1689 already_defined_modules, 1690 1690 } 1691 1691 }
+9 -8
compiler-core/src/build/package_loader/tests.rs
··· 11 11 io::{FileSystemWriter, memory::InMemoryFileSystem}, 12 12 line_numbers, 13 13 parse::extra::ModuleExtra, 14 + type_::References, 14 15 warning::NullWarningEmitterIO, 15 16 }; 16 17 ··· 57 58 name: name.into(), 58 59 origin: Origin::Src, 59 60 package: "my_package".into(), 60 - types: Default::default(), 61 - types_value_constructors: Default::default(), 62 - values: Default::default(), 63 - accessors: Default::default(), 61 + types: HashMap::new(), 62 + types_value_constructors: HashMap::new(), 63 + values: HashMap::new(), 64 + accessors: HashMap::new(), 64 65 line_numbers: line_numbers.clone(), 65 66 is_internal: false, 66 67 src_path: Utf8PathBuf::from(format!("/src/{}.gleam", name)), 67 68 warnings: vec![], 68 69 minimum_required_version: Version::new(0, 1, 0), 69 - type_aliases: Default::default(), 70 - documentation: Default::default(), 70 + type_aliases: HashMap::new(), 71 + documentation: vec![], 71 72 contains_echo: false, 72 - references: Default::default(), 73 - inline_functions: Default::default(), 73 + references: References::default(), 74 + inline_functions: HashMap::new(), 74 75 }; 75 76 let path = Utf8Path::new("/artefact").join(format!("{artefact_name}.cache")); 76 77 fs.write_bytes(&path, &metadata::encode(&cache).unwrap())
+4 -4
compiler-core/src/call_graph/into_dependency_order_tests.rs
··· 27 27 .map(|name| Arg { 28 28 names: crate::ast::ArgNames::Named { 29 29 name: EcoString::from(*name), 30 - location: Default::default(), 30 + location: SrcSpan::default(), 31 31 }, 32 - location: Default::default(), 32 + location: SrcSpan::default(), 33 33 annotation: None, 34 34 type_: (), 35 35 }) ··· 37 37 body: crate::parse::parse_statement_sequence(src) 38 38 .expect("syntax error") 39 39 .to_vec(), 40 - location: Default::default(), 40 + location: SrcSpan::default(), 41 41 body_start: None, 42 42 return_annotation: None, 43 43 publicity: Publicity::Public, ··· 63 63 let const_value = crate::parse::parse_const_value(value).expect("syntax error"); 64 64 ModuleConstant { 65 65 documentation: None, 66 - location: Default::default(), 66 + location: SrcSpan::default(), 67 67 publicity: Publicity::Public, 68 68 name: EcoString::from(*name), 69 69 name_location: SrcSpan::default(),
+12 -12
compiler-core/src/config.rs
··· 722 722 impl Default for PackageConfig { 723 723 fn default() -> Self { 724 724 Self { 725 - name: Default::default(), 725 + name: EcoString::new(), 726 726 version: default_version(), 727 - gleam_version: Default::default(), 728 - description: Default::default(), 729 - documentation: Default::default(), 730 - dependencies: Default::default(), 731 - erlang: Default::default(), 732 - javascript: Default::default(), 733 - repository: Default::default(), 734 - dev_dependencies: Default::default(), 735 - licences: Default::default(), 736 - links: Default::default(), 737 - internal_modules: Default::default(), 727 + gleam_version: None, 728 + description: EcoString::new(), 729 + documentation: Docs::default(), 730 + dependencies: HashMap::new(), 731 + erlang: ErlangConfig::default(), 732 + javascript: JavaScriptConfig::default(), 733 + repository: None, 734 + dev_dependencies: HashMap::new(), 735 + licences: vec![], 736 + links: vec![], 737 + internal_modules: None, 738 738 target: Target::Erlang, 739 739 } 740 740 }
+2 -2
compiler-core/src/dependency.rs
··· 312 312 locked, 313 313 remote, 314 314 exact_only, 315 - optional_dependencies: RefCell::new(Default::default()), 315 + optional_dependencies: RefCell::new(HashMap::new()), 316 316 } 317 317 } 318 318 ··· 384 384 ))); 385 385 } 386 386 387 - let mut deps: Map<PackageName, PubgrubRange> = Default::default(); 387 + let mut deps: Map<PackageName, PubgrubRange> = Map::default(); 388 388 for (name, dependency) in &release.requirements { 389 389 let mut range = dependency.requirement.to_pubgrub().clone(); 390 390 let mut opt_deps = self.optional_dependencies.borrow_mut();
+5 -4
compiler-core/src/docs/tests.rs
··· 20 20 config::{DocsPage, PackageConfig, Repository}, 21 21 docs::{DocContext, search_item_for_module, search_item_for_type, search_item_for_value}, 22 22 io::{FileSystemWriter, memory::InMemoryFileSystem}, 23 + parse::extra::ModuleExtra, 23 24 paths::ProjectPaths, 24 25 type_, 25 26 uid::UniqueIdGenerator, ··· 164 165 input_path: "/".into(), 165 166 origin: Origin::Src, 166 167 ast: module, 167 - extra: Default::default(), 168 - dependencies: Default::default(), 168 + extra: ModuleExtra::new(), 169 + dependencies: vec![], 169 170 }; 170 171 171 172 let source_links = SourceLinker::new(&paths, &config, &build_module); ··· 1297 1298 input_path: "/".into(), 1298 1299 origin: Origin::Src, 1299 1300 ast: module, 1300 - extra: Default::default(), 1301 - dependencies: Default::default(), 1301 + extra: ModuleExtra::new(), 1302 + dependencies: vec![], 1302 1303 }; 1303 1304 1304 1305 let source_links = SourceLinker::new(&paths, &config, &build_module);
+2 -2
compiler-core/src/io/memory.rs
··· 381 381 pub fn directory() -> Self { 382 382 Self { 383 383 node: InMemoryFileNode::Directory, 384 - ..Default::default() 384 + ..Self::default() 385 385 } 386 386 } 387 387 ··· 418 418 impl Default for InMemoryFile { 419 419 fn default() -> Self { 420 420 Self { 421 - node: InMemoryFileNode::File(Default::default()), 421 + node: InMemoryFileNode::File(Rc::new(RefCell::new(vec![]))), 422 422 // We use a fixed time here so that the tests are deterministic. In 423 423 // future we may want to inject this in some fashion. 424 424 modification_time: SystemTime::UNIX_EPOCH + Duration::from_secs(663112800),
+1 -1
compiler-core/src/javascript.rs
··· 138 138 module, 139 139 src_path, 140 140 tracker: UsageTracker::default(), 141 - module_scope: Default::default(), 141 + module_scope: im::HashMap::new(), 142 142 typescript, 143 143 source_map_builder: if source_map { 144 144 let module_name = module.name.clone();
+1 -1
compiler-core/src/javascript/decision.rs
··· 461 461 .current_scope 462 462 .user_variables() 463 463 .clone(), 464 - DecisionKind::LetAssert { .. } => Default::default(), 464 + DecisionKind::LetAssert { .. } => im::HashMap::new(), 465 465 }; 466 466 let old_names = self.variables.scoped_variable_names.clone(); 467 467 let old_segments = self.variables.segment_values.clone();
+1 -1
compiler-core/src/javascript/expression.rs
··· 162 162 fn new(user_variables: im::HashMap<EcoString, usize>) -> Self { 163 163 Self { 164 164 user_variables, 165 - ..Default::default() 165 + ..Self::default() 166 166 } 167 167 } 168 168
+2 -2
compiler-core/src/javascript/import.rs
··· 124 124 fn new(path: EcoString) -> Self { 125 125 Self { 126 126 path, 127 - aliases: Default::default(), 128 - unqualified: Default::default(), 127 + aliases: HashSet::new(), 128 + unqualified: vec![], 129 129 } 130 130 } 131 131
+1
compiler-core/src/lib.rs
··· 24 24 clippy::option_option, 25 25 clippy::verbose_file_reads, 26 26 clippy::unnested_or_patterns, 27 + clippy::default_trait_access, 27 28 rust_2018_idioms, 28 29 missing_debug_implementations, 29 30 missing_copy_implementations,
+4 -4
compiler-core/src/manifest.rs
··· 223 223 impl Default for ManifestPackage { 224 224 fn default() -> Self { 225 225 Self { 226 - name: Default::default(), 227 - build_tools: Default::default(), 228 - otp_app: Default::default(), 229 - requirements: Default::default(), 226 + name: EcoString::new(), 227 + build_tools: vec![], 228 + otp_app: None, 229 + requirements: vec![], 230 230 version: Version::new(1, 0, 0), 231 231 source: ManifestPackageSource::Hex { 232 232 outer_checksum: Base16Checksum(vec![]),
+56 -56
compiler-core/src/metadata/tests.rs
··· 82 82 83 83 fn bit_array_segment_option_module(option: TypedConstantBitArraySegmentOption) -> ModuleInterface { 84 84 constant_module(Constant::BitArray { 85 - location: Default::default(), 85 + location: SrcSpan::default(), 86 86 segments: vec![BitArraySegment { 87 - location: Default::default(), 87 + location: SrcSpan::default(), 88 88 value: Box::new(Constant::Int { 89 - location: Default::default(), 89 + location: SrcSpan::default(), 90 90 value: "1".into(), 91 91 int_value: 1.into(), 92 92 }), ··· 163 163 TypeConstructor { 164 164 type_: type_::list(type_::int()), 165 165 publicity: Publicity::Private, 166 - origin: Default::default(), 166 + origin: SrcSpan::default(), 167 167 module: "the/module".into(), 168 168 parameters: vec![], 169 169 deprecation: Deprecation::NotDeprecated, ··· 200 200 TypeConstructor { 201 201 type_: type_::list(type_::int()), 202 202 publicity: Publicity::Public, 203 - origin: Default::default(), 203 + origin: SrcSpan::default(), 204 204 module: "the/module".into(), 205 205 parameters: vec![], 206 206 deprecation: Deprecation::NotDeprecated, ··· 237 237 TypeConstructor { 238 238 type_: type_::fn_(vec![type_::nil(), type_::float()], type_::int()), 239 239 publicity: Publicity::Public, 240 - origin: Default::default(), 240 + origin: SrcSpan::default(), 241 241 module: "the/module".into(), 242 242 parameters: vec![], 243 243 deprecation: Deprecation::NotDeprecated, ··· 274 274 TypeConstructor { 275 275 type_: type_::tuple(vec![type_::nil(), type_::float(), type_::int()]), 276 276 publicity: Publicity::Public, 277 - origin: Default::default(), 277 + origin: SrcSpan::default(), 278 278 module: "the/module".into(), 279 279 parameters: vec![], 280 280 deprecation: Deprecation::NotDeprecated, ··· 317 317 TypeConstructor { 318 318 type_: type_::tuple(vec![t1.clone(), t1.clone(), t2.clone()]), 319 319 publicity: Publicity::Public, 320 - origin: Default::default(), 320 + origin: SrcSpan::default(), 321 321 module: "the/module".into(), 322 322 parameters: vec![t1, t2], 323 323 deprecation: Deprecation::NotDeprecated, ··· 359 359 TypeConstructor { 360 360 type_, 361 361 publicity: Publicity::Public, 362 - origin: Default::default(), 362 + origin: SrcSpan::default(), 363 363 module: "a".into(), 364 364 parameters: vec![], 365 365 deprecation: Deprecation::NotDeprecated, ··· 401 401 TypeConstructor { 402 402 type_, 403 403 publicity: Publicity::Public, 404 - origin: Default::default(), 404 + origin: SrcSpan::default(), 405 405 module: "a".into(), 406 406 parameters: vec![], 407 407 deprecation: Deprecation::NotDeprecated, ··· 1050 1050 #[test] 1051 1051 fn constant_int() { 1052 1052 let module = constant_module(Constant::Int { 1053 - location: Default::default(), 1053 + location: SrcSpan::default(), 1054 1054 value: "100".into(), 1055 1055 int_value: 100.into(), 1056 1056 }); ··· 1061 1061 #[test] 1062 1062 fn constant_float() { 1063 1063 let module = constant_module(Constant::Float { 1064 - location: Default::default(), 1064 + location: SrcSpan::default(), 1065 1065 value: "1.0".into(), 1066 1066 float_value: LiteralFloatValue::ONE, 1067 1067 }); ··· 1072 1072 #[test] 1073 1073 fn constant_string() { 1074 1074 let module = constant_module(Constant::String { 1075 - location: Default::default(), 1075 + location: SrcSpan::default(), 1076 1076 value: "hello".into(), 1077 1077 }); 1078 1078 ··· 1083 1083 fn constant_tuple() { 1084 1084 let int_float_tuple_type = type_::tuple(vec![type_::int(), type_::float()]); 1085 1085 let module = constant_module(Constant::Tuple { 1086 - location: Default::default(), 1086 + location: SrcSpan::default(), 1087 1087 type_: type_::tuple(vec![ 1088 1088 type_::int(), 1089 1089 type_::float(), ··· 1091 1091 ]), 1092 1092 elements: vec![ 1093 1093 Constant::Int { 1094 - location: Default::default(), 1094 + location: SrcSpan::default(), 1095 1095 value: "1".into(), 1096 1096 int_value: 1.into(), 1097 1097 }, 1098 1098 Constant::Float { 1099 - location: Default::default(), 1099 + location: SrcSpan::default(), 1100 1100 value: "1.0".into(), 1101 1101 float_value: LiteralFloatValue::ONE, 1102 1102 }, 1103 1103 Constant::Tuple { 1104 - location: Default::default(), 1104 + location: SrcSpan::default(), 1105 1105 type_: int_float_tuple_type, 1106 1106 elements: vec![ 1107 1107 Constant::Int { 1108 - location: Default::default(), 1108 + location: SrcSpan::default(), 1109 1109 value: "1".into(), 1110 1110 int_value: 1.into(), 1111 1111 }, 1112 1112 Constant::Float { 1113 - location: Default::default(), 1113 + location: SrcSpan::default(), 1114 1114 value: "1.0".into(), 1115 1115 float_value: LiteralFloatValue::ONE, 1116 1116 }, ··· 1125 1125 #[test] 1126 1126 fn constant_list() { 1127 1127 let module = constant_module(Constant::List { 1128 - location: Default::default(), 1128 + location: SrcSpan::default(), 1129 1129 type_: type_::int(), 1130 1130 elements: vec![ 1131 1131 Constant::Int { 1132 - location: Default::default(), 1132 + location: SrcSpan::default(), 1133 1133 value: "1".into(), 1134 1134 int_value: 1.into(), 1135 1135 }, 1136 1136 Constant::Int { 1137 - location: Default::default(), 1137 + location: SrcSpan::default(), 1138 1138 value: "2".into(), 1139 1139 int_value: 2.into(), 1140 1140 }, 1141 1141 Constant::Int { 1142 - location: Default::default(), 1142 + location: SrcSpan::default(), 1143 1143 value: "3".into(), 1144 1144 int_value: 3.into(), 1145 1145 }, 1146 1146 ], 1147 1147 tail: Some(Box::new(Constant::List { 1148 - location: Default::default(), 1148 + location: SrcSpan::default(), 1149 1149 type_: type_::list(type_::int()), 1150 1150 elements: vec![ 1151 1151 Constant::Int { 1152 - location: Default::default(), 1152 + location: SrcSpan::default(), 1153 1153 value: "4".into(), 1154 1154 int_value: 4.into(), 1155 1155 }, 1156 1156 Constant::Int { 1157 - location: Default::default(), 1157 + location: SrcSpan::default(), 1158 1158 value: "5".into(), 1159 1159 int_value: 5.into(), 1160 1160 }, ··· 1169 1169 #[test] 1170 1170 fn constant_record() { 1171 1171 let module = constant_module(Constant::Record { 1172 - location: Default::default(), 1172 + location: SrcSpan::default(), 1173 1173 module: None, 1174 1174 name: "".into(), 1175 1175 arguments: Some(vec![ 1176 1176 CallArg { 1177 1177 implicit: None, 1178 1178 label: None, 1179 - location: Default::default(), 1179 + location: SrcSpan::default(), 1180 1180 value: Constant::Float { 1181 - location: Default::default(), 1181 + location: SrcSpan::default(), 1182 1182 value: "0.0".into(), 1183 1183 float_value: LiteralFloatValue::ZERO, 1184 1184 }, ··· 1186 1186 CallArg { 1187 1187 implicit: None, 1188 1188 label: None, 1189 - location: Default::default(), 1189 + location: SrcSpan::default(), 1190 1190 value: Constant::Int { 1191 - location: Default::default(), 1191 + location: SrcSpan::default(), 1192 1192 value: "1".into(), 1193 1193 int_value: 1.into(), 1194 1194 }, ··· 1205 1205 #[test] 1206 1206 fn constant_var() { 1207 1207 let one_original = Constant::Int { 1208 - location: Default::default(), 1208 + location: SrcSpan::default(), 1209 1209 value: "1".into(), 1210 1210 int_value: 1.into(), 1211 1211 }; 1212 1212 1213 1213 let one = Constant::Var { 1214 - location: Default::default(), 1214 + location: SrcSpan::default(), 1215 1215 module: None, 1216 1216 name: "one_original".into(), 1217 1217 type_: type_::int(), ··· 1309 1309 #[test] 1310 1310 fn constant_bit_array() { 1311 1311 let module = constant_module(Constant::BitArray { 1312 - location: Default::default(), 1312 + location: SrcSpan::default(), 1313 1313 segments: vec![], 1314 1314 }); 1315 1315 assert_eq!(roundtrip(&module), module); ··· 1318 1318 #[test] 1319 1319 fn constant_bit_array_unit() { 1320 1320 let module = bit_array_segment_option_module(BitArrayOption::Unit { 1321 - location: Default::default(), 1321 + location: SrcSpan::default(), 1322 1322 value: 234, 1323 1323 }); 1324 1324 assert_eq!(roundtrip(&module), module); ··· 1327 1327 #[test] 1328 1328 fn constant_bit_array_float() { 1329 1329 let module = bit_array_segment_option_module(BitArrayOption::Float { 1330 - location: Default::default(), 1330 + location: SrcSpan::default(), 1331 1331 }); 1332 1332 assert_eq!(roundtrip(&module), module); 1333 1333 } ··· 1335 1335 #[test] 1336 1336 fn constant_bit_array_int() { 1337 1337 let module = bit_array_segment_option_module(BitArrayOption::Int { 1338 - location: Default::default(), 1338 + location: SrcSpan::default(), 1339 1339 }); 1340 1340 assert_eq!(roundtrip(&module), module); 1341 1341 } ··· 1343 1343 #[test] 1344 1344 fn constant_bit_array_size() { 1345 1345 let module = bit_array_segment_option_module(BitArrayOption::Size { 1346 - location: Default::default(), 1346 + location: SrcSpan::default(), 1347 1347 value: Box::new(Constant::Int { 1348 - location: Default::default(), 1348 + location: SrcSpan::default(), 1349 1349 value: "1".into(), 1350 1350 int_value: 1.into(), 1351 1351 }), ··· 1357 1357 #[test] 1358 1358 fn constant_bit_array_size_short_form() { 1359 1359 let module = bit_array_segment_option_module(BitArrayOption::Size { 1360 - location: Default::default(), 1360 + location: SrcSpan::default(), 1361 1361 value: Box::new(Constant::Int { 1362 - location: Default::default(), 1362 + location: SrcSpan::default(), 1363 1363 value: "1".into(), 1364 1364 int_value: 1.into(), 1365 1365 }), ··· 1371 1371 #[test] 1372 1372 fn constant_bit_array_bit_arry() { 1373 1373 let module = bit_array_segment_option_module(BitArrayOption::Bits { 1374 - location: Default::default(), 1374 + location: SrcSpan::default(), 1375 1375 }); 1376 1376 assert_eq!(roundtrip(&module), module); 1377 1377 } ··· 1379 1379 #[test] 1380 1380 fn constant_bit_array_utf8() { 1381 1381 let module = bit_array_segment_option_module(BitArrayOption::Utf8 { 1382 - location: Default::default(), 1382 + location: SrcSpan::default(), 1383 1383 }); 1384 1384 assert_eq!(roundtrip(&module), module); 1385 1385 } ··· 1387 1387 #[test] 1388 1388 fn constant_bit_array_utf16() { 1389 1389 let module = bit_array_segment_option_module(BitArrayOption::Utf16 { 1390 - location: Default::default(), 1390 + location: SrcSpan::default(), 1391 1391 }); 1392 1392 assert_eq!(roundtrip(&module), module); 1393 1393 } ··· 1395 1395 #[test] 1396 1396 fn constant_bit_array_utf32() { 1397 1397 let module = bit_array_segment_option_module(BitArrayOption::Utf32 { 1398 - location: Default::default(), 1398 + location: SrcSpan::default(), 1399 1399 }); 1400 1400 assert_eq!(roundtrip(&module), module); 1401 1401 } ··· 1403 1403 #[test] 1404 1404 fn constant_bit_array_utf8codepoint() { 1405 1405 let module = bit_array_segment_option_module(BitArrayOption::Utf8Codepoint { 1406 - location: Default::default(), 1406 + location: SrcSpan::default(), 1407 1407 }); 1408 1408 assert_eq!(roundtrip(&module), module); 1409 1409 } ··· 1411 1411 #[test] 1412 1412 fn constant_bit_array_utf16codepoint() { 1413 1413 let module = bit_array_segment_option_module(BitArrayOption::Utf16Codepoint { 1414 - location: Default::default(), 1414 + location: SrcSpan::default(), 1415 1415 }); 1416 1416 assert_eq!(roundtrip(&module), module); 1417 1417 } ··· 1419 1419 #[test] 1420 1420 fn constant_bit_array_utf32codepoint() { 1421 1421 let module = bit_array_segment_option_module(BitArrayOption::Utf32Codepoint { 1422 - location: Default::default(), 1422 + location: SrcSpan::default(), 1423 1423 }); 1424 1424 assert_eq!(roundtrip(&module), module); 1425 1425 } ··· 1427 1427 #[test] 1428 1428 fn constant_bit_array_signed() { 1429 1429 let module = bit_array_segment_option_module(BitArrayOption::Signed { 1430 - location: Default::default(), 1430 + location: SrcSpan::default(), 1431 1431 }); 1432 1432 assert_eq!(roundtrip(&module), module); 1433 1433 } ··· 1435 1435 #[test] 1436 1436 fn constant_bit_array_unsigned() { 1437 1437 let module = bit_array_segment_option_module(BitArrayOption::Unsigned { 1438 - location: Default::default(), 1438 + location: SrcSpan::default(), 1439 1439 }); 1440 1440 assert_eq!(roundtrip(&module), module); 1441 1441 } ··· 1443 1443 #[test] 1444 1444 fn constant_bit_array_big() { 1445 1445 let module = bit_array_segment_option_module(BitArrayOption::Big { 1446 - location: Default::default(), 1446 + location: SrcSpan::default(), 1447 1447 }); 1448 1448 assert_eq!(roundtrip(&module), module); 1449 1449 } ··· 1451 1451 #[test] 1452 1452 fn constant_bit_array_little() { 1453 1453 let module = bit_array_segment_option_module(BitArrayOption::Little { 1454 - location: Default::default(), 1454 + location: SrcSpan::default(), 1455 1455 }); 1456 1456 assert_eq!(roundtrip(&module), module); 1457 1457 } ··· 1459 1459 #[test] 1460 1460 fn constant_bit_array_native() { 1461 1461 let module = bit_array_segment_option_module(BitArrayOption::Native { 1462 - location: Default::default(), 1462 + location: SrcSpan::default(), 1463 1463 }); 1464 1464 assert_eq!(roundtrip(&module), module); 1465 1465 } ··· 1477 1477 TypeConstructor { 1478 1478 type_: type_::list(type_::int()), 1479 1479 publicity: Publicity::Public, 1480 - origin: Default::default(), 1480 + origin: SrcSpan::default(), 1481 1481 module: "the/module".into(), 1482 1482 parameters: vec![], 1483 1483 deprecation: Deprecation::Deprecated { ··· 1807 1807 publicity: Publicity::Internal { 1808 1808 attribute_location: Some(SrcSpan::new(0, 10)), 1809 1809 }, 1810 - origin: Default::default(), 1810 + origin: SrcSpan::default(), 1811 1811 module: "the/module".into(), 1812 1812 parameters: vec![], 1813 1813 deprecation: Deprecation::NotDeprecated, ··· 1853 1853 arity: 1, 1854 1854 deprecation: Deprecation::NotDeprecated, 1855 1855 documentation: Some("Some documentation".into()), 1856 - origin: Default::default(), 1856 + origin: SrcSpan::default(), 1857 1857 parameters: vec![type_::generic_var(0)], 1858 1858 }, 1859 1859 )]
+1 -1
compiler-core/src/package_interface/tests.rs
··· 142 142 let package: Package = package_from_module(module); 143 143 serde_json::to_string_pretty(&PackageInterface::from_package( 144 144 &package, 145 - &Default::default(), 145 + &im::HashMap::new(), 146 146 )) 147 147 .expect("to json") 148 148 }
+5 -4
compiler-core/src/parse.rs
··· 79 79 use crate::type_::Deprecation; 80 80 use crate::type_::error::{VariableDeclaration, VariableOrigin, VariableSyntax}; 81 81 use crate::type_::expression::{Implementations, Purity}; 82 + use crate::type_::printer::Names; 82 83 use crate::warning::{DeprecatedSyntaxWarning, WarningEmitter}; 83 84 use camino::Utf8PathBuf; 84 85 use ecow::EcoString; ··· 87 88 use num_bigint::BigInt; 88 89 use serde::{Deserialize, Serialize}; 89 90 use std::cmp::Ordering; 90 - use std::collections::VecDeque; 91 + use std::collections::{HashSet, VecDeque}; 91 92 use std::hash::{Hash, Hasher}; 92 93 use std::str::FromStr; 93 94 pub use token::Token; ··· 261 262 documentation: vec![], 262 263 type_info: (), 263 264 definitions, 264 - names: Default::default(), 265 - unused_definition_positions: Default::default(), 265 + names: Names::new(), 266 + unused_definition_positions: HashSet::new(), 266 267 }; 267 268 Ok(Parsed { 268 269 module, 269 - extra: Default::default(), 270 + extra: ModuleExtra::new(), 270 271 }) 271 272 } 272 273
+1 -1
compiler-core/src/parse/extra.rs
··· 19 19 20 20 impl ModuleExtra { 21 21 pub fn new() -> Self { 22 - Default::default() 22 + Self::default() 23 23 } 24 24 25 25 /// Detects if a byte index is in a comment context
+1 -1
compiler-core/src/type_/error.rs
··· 30 30 31 31 impl Problems { 32 32 pub fn new() -> Self { 33 - Default::default() 33 + Self::default() 34 34 } 35 35 36 36 /// Sort the warnings and errors by their location.
+9 -9
compiler-core/src/type_/prelude.rs
··· 256 256 match t { 257 257 PreludeType::BitArray => { 258 258 let v = TypeConstructor { 259 - origin: Default::default(), 259 + origin: SrcSpan::default(), 260 260 parameters: vec![], 261 261 type_: bit_array(), 262 262 module: PRELUDE_MODULE_NAME.into(), ··· 322 322 let _ = prelude.types.insert( 323 323 BOOL.into(), 324 324 TypeConstructor { 325 - origin: Default::default(), 325 + origin: SrcSpan::default(), 326 326 parameters: vec![], 327 327 type_: bool(), 328 328 module: PRELUDE_MODULE_NAME.into(), ··· 337 337 let _ = prelude.types.insert( 338 338 FLOAT.into(), 339 339 TypeConstructor { 340 - origin: Default::default(), 340 + origin: SrcSpan::default(), 341 341 parameters: vec![], 342 342 type_: float(), 343 343 module: PRELUDE_MODULE_NAME.into(), ··· 354 354 TypeConstructor { 355 355 parameters: vec![], 356 356 type_: int(), 357 - origin: Default::default(), 357 + origin: SrcSpan::default(), 358 358 module: PRELUDE_MODULE_NAME.into(), 359 359 publicity: Publicity::Public, 360 360 deprecation: NotDeprecated, ··· 368 368 let _ = prelude.types.insert( 369 369 LIST.into(), 370 370 TypeConstructor { 371 - origin: Default::default(), 371 + origin: SrcSpan::default(), 372 372 parameters: vec![list_parameter.clone()], 373 373 type_: list(list_parameter), 374 374 module: PRELUDE_MODULE_NAME.into(), ··· 399 399 let _ = prelude.types.insert( 400 400 NIL.into(), 401 401 TypeConstructor { 402 - origin: Default::default(), 402 + origin: SrcSpan::default(), 403 403 parameters: vec![], 404 404 type_: nil(), 405 405 module: PRELUDE_MODULE_NAME.into(), ··· 430 430 let _ = prelude.types.insert( 431 431 RESULT.into(), 432 432 TypeConstructor { 433 - origin: Default::default(), 433 + origin: SrcSpan::default(), 434 434 parameters: vec![result_value.clone(), result_error.clone()], 435 435 type_: result(result_value.clone(), result_error.clone()), 436 436 module: PRELUDE_MODULE_NAME.into(), ··· 508 508 let _ = prelude.types.insert( 509 509 STRING.into(), 510 510 TypeConstructor { 511 - origin: Default::default(), 511 + origin: SrcSpan::default(), 512 512 parameters: vec![], 513 513 type_: string(), 514 514 module: PRELUDE_MODULE_NAME.into(), ··· 523 523 let _ = prelude.types.insert( 524 524 UTF_CODEPOINT.into(), 525 525 TypeConstructor { 526 - origin: Default::default(), 526 + origin: SrcSpan::default(), 527 527 parameters: vec![], 528 528 type_: utf_codepoint(), 529 529 module: PRELUDE_MODULE_NAME.into(),
+1 -1
compiler-core/src/type_/pretty.rs
··· 29 29 30 30 impl Printer { 31 31 pub fn new() -> Self { 32 - Default::default() 32 + Self::default() 33 33 } 34 34 35 35 pub fn with_names(&mut self, names: im::HashMap<u64, EcoString>) {
+11 -11
compiler-core/src/type_/printer.rs
··· 1 1 // SPDX-License-Identifier: Apache-2.0 2 2 // SPDX-FileCopyrightText: 2024 The Gleam contributors 3 3 4 - use bimap::BiMap; 4 + use bimap::{BiHashMap, BiMap}; 5 5 use ecow::{EcoString, eco_format}; 6 6 use im::HashMap; 7 7 use std::{collections::HashSet, sync::Arc}; ··· 164 164 impl Names { 165 165 pub fn new() -> Self { 166 166 Self { 167 - local_types: Default::default(), 168 - imported_modules: Default::default(), 169 - type_variables: Default::default(), 170 - local_value_constructors: Default::default(), 171 - reexport_aliases: Default::default(), 167 + local_types: BiHashMap::new(), 168 + imported_modules: HashMap::new(), 169 + type_variables: HashMap::new(), 170 + local_value_constructors: BiHashMap::new(), 171 + reexport_aliases: HashMap::new(), 172 172 } 173 173 } 174 174 ··· 408 408 pub fn new(names: &'a Names) -> Self { 409 409 Printer { 410 410 names, 411 - uid: Default::default(), 412 - printed_type_variables: Default::default(), 411 + uid: 0, 412 + printed_type_variables: HashMap::new(), 413 413 printed_type_variable_names: names.type_variables.values().cloned().collect(), 414 414 } 415 415 } ··· 435 435 pub fn new_without_type_variables(names: &'a Names) -> Self { 436 436 Printer { 437 437 names, 438 - uid: Default::default(), 439 - printed_type_variables: Default::default(), 440 - printed_type_variable_names: Default::default(), 438 + uid: 0, 439 + printed_type_variables: HashMap::new(), 440 + printed_type_variable_names: HashSet::new(), 441 441 } 442 442 } 443 443
+22 -22
compiler-core/src/type_/tests.rs
··· 571 571 let (error, names) = match outcome { 572 572 Outcome::Ok(_) => panic!("should infer an error"), 573 573 Outcome::PartialFailure(ast, errors) => (errors.into(), ast.names), 574 - Outcome::TotalFailure(errors) => (errors.into(), Default::default()), 574 + Outcome::TotalFailure(errors) => (errors.into(), Names::new()), 575 575 }; 576 576 577 577 let error = Error::Type { ··· 611 611 let (error, names) = match outcome { 612 612 Outcome::Ok(_) => panic!("should infer an error"), 613 613 Outcome::PartialFailure(ast, errors) => (errors.into(), ast.names), 614 - Outcome::TotalFailure(errors) => (errors.into(), Default::default()), 614 + Outcome::TotalFailure(errors) => (errors.into(), Names::new()), 615 615 }; 616 616 617 617 let error = Error::Type { ··· 688 688 arguments: vec![ 689 689 CallArg { 690 690 implicit: None, 691 - location: Default::default(), 691 + location: SrcSpan::default(), 692 692 label: None, 693 693 value: int("1"), 694 694 }, 695 695 CallArg { 696 696 implicit: None, 697 - location: Default::default(), 697 + location: SrcSpan::default(), 698 698 label: None, 699 699 value: int("2"), 700 700 }, 701 701 CallArg { 702 702 implicit: None, 703 - location: Default::default(), 703 + location: SrcSpan::default(), 704 704 label: None, 705 705 value: int("3"), 706 706 }, ··· 709 709 expected_arguments: vec![ 710 710 CallArg { 711 711 implicit: None, 712 - location: Default::default(), 712 + location: SrcSpan::default(), 713 713 label: None, 714 714 value: int("1"), 715 715 }, 716 716 CallArg { 717 717 implicit: None, 718 - location: Default::default(), 718 + location: SrcSpan::default(), 719 719 label: None, 720 720 value: int("2"), 721 721 }, 722 722 CallArg { 723 723 implicit: None, 724 - location: Default::default(), 724 + location: SrcSpan::default(), 725 725 label: None, 726 726 value: int("3"), 727 727 }, ··· 735 735 arguments: vec![ 736 736 CallArg { 737 737 implicit: None, 738 - location: Default::default(), 738 + location: SrcSpan::default(), 739 739 label: None, 740 740 value: int("1"), 741 741 }, 742 742 CallArg { 743 743 implicit: None, 744 - location: Default::default(), 744 + location: SrcSpan::default(), 745 745 label: None, 746 746 value: int("2"), 747 747 }, 748 748 CallArg { 749 749 implicit: None, 750 - location: Default::default(), 750 + location: SrcSpan::default(), 751 751 label: Some("last".into()), 752 752 value: int("3"), 753 753 }, ··· 756 756 expected_arguments: vec![ 757 757 CallArg { 758 758 implicit: None, 759 - location: Default::default(), 759 + location: SrcSpan::default(), 760 760 label: None, 761 761 value: int("1"), 762 762 }, 763 763 CallArg { 764 764 implicit: None, 765 - location: Default::default(), 765 + location: SrcSpan::default(), 766 766 label: None, 767 767 value: int("2"), 768 768 }, 769 769 CallArg { 770 770 implicit: None, 771 - location: Default::default(), 771 + location: SrcSpan::default(), 772 772 label: Some("last".into()), 773 773 value: int("3"), 774 774 }, ··· 784 784 name: "ok".into(), 785 785 definitions: vec![], 786 786 type_info: (), 787 - names: Default::default(), 788 - unused_definition_positions: Default::default(), 787 + names: Names::new(), 788 + unused_definition_positions: HashSet::new(), 789 789 }; 790 790 let direct_dependencies = HashMap::from_iter(vec![]); 791 791 let ids = UniqueIdGenerator::new(); ··· 2942 2942 type_: fn_(vec![], int()), 2943 2943 variant: ValueConstructorVariant::ModuleConstant { 2944 2944 documentation: None, 2945 - location: Default::default(), 2945 + location: SrcSpan::default(), 2946 2946 module: "module".into(), 2947 2947 literal: Constant::Int { 2948 - location: Default::default(), 2948 + location: SrcSpan::default(), 2949 2949 value: "1".into(), 2950 2950 int_value: 1.into(), 2951 2951 }, ··· 2976 2976 field_map: None, 2977 2977 arity: 1, 2978 2978 documentation: None, 2979 - location: Default::default(), 2979 + location: SrcSpan::default(), 2980 2980 module: "module".into(), 2981 2981 external_erlang: None, 2982 2982 external_javascript: None, ··· 3007 3007 field_map: None, 3008 3008 arity: 0, 3009 3009 documentation: None, 3010 - location: Default::default(), 3010 + location: SrcSpan::default(), 3011 3011 module: "module".into(), 3012 3012 external_erlang: None, 3013 3013 external_javascript: None, ··· 3038 3038 field_map: None, 3039 3039 arity: 0, 3040 3040 documentation: None, 3041 - location: Default::default(), 3041 + location: SrcSpan::default(), 3042 3042 module: "module".into(), 3043 3043 external_erlang: Some(("wibble".into(), "wobble".into())), 3044 3044 external_javascript: Some(("wobble".into(), "wibble".into())), ··· 3069 3069 field_map: None, 3070 3070 arity: 0, 3071 3071 documentation: None, 3072 - location: Default::default(), 3072 + location: SrcSpan::default(), 3073 3073 module: "module".into(), 3074 3074 external_erlang: Some(("wibble".into(), "wobble".into())), 3075 3075 external_javascript: Some(("wobble".into(), "wibble".into())),
+1 -1
compiler-wasm/src/lib.rs
··· 177 177 name: "library".into(), 178 178 version: Version::new(1, 0, 0), 179 179 target, 180 - ..Default::default() 180 + ..PackageConfig::default() 181 181 }; 182 182 183 183 let target = match target {
+9 -9
language-server/src/completer.rs
··· 637 637 range: Range { start, end }, 638 638 new_text: name.to_string(), 639 639 })), 640 - ..Default::default() 640 + ..CompletionItem::default() 641 641 }) 642 642 .collect() 643 643 } ··· 682 682 detail: Some("Type".into()), 683 683 kind: Some(CompletionItemKind::Class), 684 684 sort_text, 685 - ..Default::default() 685 + ..CompletionItem::default() 686 686 }); 687 687 } 688 688 } ··· 909 909 detail: Some(PRELUDE_MODULE_NAME.into()), 910 910 kind: Some(kind), 911 911 sort_text, 912 - ..Default::default() 912 + ..CompletionItem::default() 913 913 }); 914 914 }; 915 915 ··· 1219 1219 detail, 1220 1220 kind: Some(CompletionItemKind::Field), 1221 1221 sort_text, 1222 - ..Default::default() 1222 + ..CompletionItem::default() 1223 1223 } 1224 1224 }) 1225 1225 .collect() ··· 1274 1274 TypeMatch::Matching, 1275 1275 )), 1276 1276 text_edit: cursor_surrounding.to_text_edit(label), 1277 - ..Default::default() 1277 + ..CompletionItem::default() 1278 1278 } 1279 1279 } 1280 1280 ··· 1321 1321 documentation, 1322 1322 sort_text: Some(sort_text(priority, &label, type_match)), 1323 1323 text_edit: cursor_surrounding.to_text_edit(label), 1324 - ..Default::default() 1324 + ..CompletionItem::default() 1325 1325 } 1326 1326 } 1327 1327 ··· 1334 1334 kind: Some(CompletionItemKind::Field), 1335 1335 detail: Some(type_), 1336 1336 sort_text: Some(sort_text(CompletionKind::FieldAccessor, label, type_match)), 1337 - ..Default::default() 1337 + ..CompletionItem::default() 1338 1338 } 1339 1339 } 1340 1340 } ··· 1385 1385 detail: Some("Type".into()), 1386 1386 sort_text: Some(sort_text(priority, &label, TypeMatch::Unknown)), 1387 1387 text_edit: cursor_surrounding.to_text_edit(completion_text), 1388 - ..Default::default() 1388 + ..CompletionItem::default() 1389 1389 } 1390 1390 } 1391 1391 ··· 1510 1510 range: insert_range, 1511 1511 new_text: label.clone(), 1512 1512 })), 1513 - ..Default::default() 1513 + ..CompletionItem::default() 1514 1514 } 1515 1515 } 1516 1516 }
+1 -1
language-server/src/feedback.rs
··· 28 28 /// No feedback at all. 29 29 /// 30 30 pub fn none() -> Feedback { 31 - Default::default() 31 + Feedback::default() 32 32 } 33 33 34 34 /// Add all the content of another feedback to this feedback.
+1
language-server/src/lib.rs
··· 22 22 clippy::option_option, 23 23 clippy::verbose_file_reads, 24 24 clippy::unnested_or_patterns, 25 + clippy::default_trait_access, 25 26 rust_2018_idioms, 26 27 missing_debug_implementations, 27 28 missing_copy_implementations,
+2 -2
language-server/src/rename.rs
··· 75 75 kind: VariableReferenceKind, 76 76 ) -> RenameOutcome { 77 77 let new_name = EcoString::from(&params.new_name); 78 - if name::check_name_case(Default::default(), &new_name, Named::Variable).is_err() { 78 + if name::check_name_case(SrcSpan::default(), &new_name, Named::Variable).is_err() { 79 79 return RenameOutcome::InvalidName { name: new_name }; 80 80 } 81 81 ··· 518 518 name: EcoString, 519 519 ) -> RenameOutcome { 520 520 let new_name = EcoString::from(&params.new_name); 521 - if name::check_name_case(Default::default(), &new_name, Named::TypeVariable).is_err() { 521 + if name::check_name_case(SrcSpan::default(), &new_name, Named::TypeVariable).is_err() { 522 522 return RenameOutcome::InvalidName { name: new_name }; 523 523 } 524 524
+6 -6
language-server/src/tests.rs
··· 69 69 70 70 fn default_manifest_package() -> ManifestPackage { 71 71 ManifestPackage { 72 - name: Default::default(), 73 - build_tools: Default::default(), 74 - otp_app: Default::default(), 75 - requirements: Default::default(), 72 + name: EcoString::new(), 73 + build_tools: vec![], 74 + otp_app: None, 75 + requirements: vec![], 76 76 version: Version::new(1, 0, 0), 77 77 source: ManifestPackageSource::Hex { 78 78 outer_checksum: Base16Checksum(vec![]), ··· 83 83 impl LanguageServerTestIO { 84 84 fn new() -> Self { 85 85 Self { 86 - io: Default::default(), 87 - actions: Default::default(), 86 + io: InMemoryFileSystem::default(), 87 + actions: Arc::new(Mutex::new(vec![])), 88 88 paths: ProjectPaths::at_filesystem_root(), 89 89 manifest: Manifest { 90 90 requirements: HashMap::new(),
+12 -9
language-server/src/tests/definition.rs
··· 1 1 // SPDX-License-Identifier: Apache-2.0 2 2 // SPDX-FileCopyrightText: 2024 The Gleam contributors 3 3 4 - use lsp_types::{DefinitionParams, Location, Position, Range, TypeDefinitionParams, Uri as Url}; 4 + use lsp_types::{ 5 + DefinitionParams, Location, PartialResultParams, Position, Range, TypeDefinitionParams, 6 + Uri as Url, WorkDoneProgressParams, 7 + }; 5 8 6 9 use super::*; 7 10 ··· 9 12 tester.at(position, |engine, param, _| { 10 13 let params = DefinitionParams { 11 14 text_document_position_params: param, 12 - work_done_progress_params: Default::default(), 13 - partial_result_params: Default::default(), 15 + work_done_progress_params: WorkDoneProgressParams::default(), 16 + partial_result_params: PartialResultParams::default(), 14 17 }; 15 18 let response = engine.goto_definition(params); 16 19 response.result.unwrap() ··· 27 30 tester.at(position, |engine, param, _| { 28 31 let params = TypeDefinitionParams { 29 32 text_document_position_params: param, 30 - work_done_progress_params: Default::default(), 31 - partial_result_params: Default::default(), 33 + work_done_progress_params: WorkDoneProgressParams::default(), 34 + partial_result_params: PartialResultParams::default(), 32 35 }; 33 36 let response = engine.goto_type_definition(params); 34 37 ··· 447 450 448 451 let params = DefinitionParams { 449 452 text_document_position_params: position_param.clone(), 450 - work_done_progress_params: Default::default(), 451 - partial_result_params: Default::default(), 453 + work_done_progress_params: WorkDoneProgressParams::default(), 454 + partial_result_params: PartialResultParams::default(), 452 455 }; 453 456 let response = engine.goto_definition(params.clone()); 454 457 let response = response.result.unwrap(); ··· 521 524 522 525 let params = DefinitionParams { 523 526 text_document_position_params: position_param.clone(), 524 - work_done_progress_params: Default::default(), 525 - partial_result_params: Default::default(), 527 + work_done_progress_params: WorkDoneProgressParams::default(), 528 + partial_result_params: PartialResultParams::default(), 526 529 }; 527 530 528 531 let response = engine.goto_definition(params.clone());
+5 -3
language-server/src/tests/document_symbols.rs
··· 2 2 // SPDX-FileCopyrightText: 2024 The Gleam contributors 3 3 4 4 use insta::assert_debug_snapshot; 5 - use lsp_types::{DocumentSymbol, DocumentSymbolParams}; 5 + use lsp_types::{ 6 + DocumentSymbol, DocumentSymbolParams, PartialResultParams, WorkDoneProgressParams, 7 + }; 6 8 7 9 use super::*; 8 10 ··· 10 12 tester.at(Position::default(), |engine, param, _| { 11 13 let params = DocumentSymbolParams { 12 14 text_document: param.text_document, 13 - work_done_progress_params: Default::default(), 14 - partial_result_params: Default::default(), 15 + work_done_progress_params: WorkDoneProgressParams::default(), 16 + partial_result_params: PartialResultParams::default(), 15 17 }; 16 18 let response = engine.document_symbol(params); 17 19
+5 -3
language-server/src/tests/folding_range.rs
··· 1 1 // SPDX-License-Identifier: Apache-2.0 2 2 // SPDX-FileCopyrightText: 2026 The Gleam contributors 3 3 4 - use lsp_types::{FoldingRange, FoldingRangeKind, FoldingRangeParams}; 4 + use lsp_types::{ 5 + FoldingRange, FoldingRangeKind, FoldingRangeParams, PartialResultParams, WorkDoneProgressParams, 6 + }; 5 7 6 8 use super::*; 7 9 ··· 9 11 tester.at(Position::default(), |engine, param, _| { 10 12 let params = FoldingRangeParams { 11 13 text_document: param.text_document, 12 - work_done_progress_params: Default::default(), 13 - partial_result_params: Default::default(), 14 + work_done_progress_params: WorkDoneProgressParams::default(), 15 + partial_result_params: PartialResultParams::default(), 14 16 }; 15 17 let response = engine.folding_range(params); 16 18
+4 -2
language-server/src/tests/hover.rs
··· 1 1 // SPDX-License-Identifier: Apache-2.0 2 2 // SPDX-FileCopyrightText: 2023 The Gleam contributors 3 3 4 - use lsp_types::{Contents, Hover, HoverParams, MarkedString, Position, Range}; 4 + use lsp_types::{ 5 + Contents, Hover, HoverParams, MarkedString, Position, Range, WorkDoneProgressParams, 6 + }; 5 7 6 8 use super::*; 7 9 ··· 9 11 tester.at(position, |engine, param, _| { 10 12 let params = HoverParams { 11 13 text_document_position_params: param, 12 - work_done_progress_params: Default::default(), 14 + work_done_progress_params: WorkDoneProgressParams::default(), 13 15 }; 14 16 let response = engine.hover(params); 15 17
+2 -2
language-server/src/tests/signature_help.rs
··· 4 4 use super::*; 5 5 use lsp_types::{ 6 6 ActiveParameter, ParameterInformation, ParameterInformationLabel, SignatureHelp, 7 - SignatureHelpParams, SignatureInformation, 7 + SignatureHelpParams, SignatureInformation, WorkDoneProgressParams, 8 8 }; 9 9 10 10 fn signature_help(tester: TestProject<'_>, position: Position) -> Option<SignatureHelp> { ··· 12 12 let params = SignatureHelpParams { 13 13 context: None, 14 14 text_document_position_params: param, 15 - work_done_progress_params: Default::default(), 15 + work_done_progress_params: WorkDoneProgressParams::default(), 16 16 }; 17 17 let response = engine.signature_help(params); 18 18