File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,16 @@ impl<'a> AnalyzeContext<'a> {
461461 parent. add_named_entity ( literal_ent, diagnostics) ;
462462 }
463463
464- parent. add_named_entity ( enum_type. into ( ) , diagnostics) ;
464+ parent. add_named_entity ( enum_type. clone ( ) . into ( ) , diagnostics) ;
465+
466+ if !self . is_standard_package ( ) {
467+ let standard = self . expect_standard_package_analysis ( ) . unwrap ( ) ;
468+ let standard_region =
469+ StandardRegion :: new ( & self . root . symbols , & standard. result ( ) . region ) ;
470+
471+ parent
472+ . add_named_entity ( standard_region. create_to_string ( enum_type) , diagnostics) ;
473+ }
465474 }
466475 TypeDefinition :: ProtectedBody ( ref mut body) => {
467476 body. type_reference . clear_reference ( ) ;
Original file line number Diff line number Diff line change @@ -72,6 +72,18 @@ end package;
7272 ) ;
7373}
7474
75+ #[ test]
76+ fn adds_to_string_for_enum_types ( ) {
77+ check_code_with_no_diagnostics (
78+ "
79+ package pkg is
80+ type enum_t is (alpha, beta);
81+ alias my_to_string is to_string[enum_t return string];
82+ end package;
83+ " ,
84+ ) ;
85+ }
86+
7587#[ test]
7688fn no_error_for_duplicate_alias_of_implicit ( ) {
7789 check_code_with_no_diagnostics (
Original file line number Diff line number Diff line change @@ -854,12 +854,18 @@ end package;
854854
855855 let config_uri = write_config (
856856 & root_uri,
857- "
857+ format ! (
858+ "
858859[libraries]
860+ std.files = [
861+ '{}/../vhdl_libraries/std/*.vhd',
862+ ]
859863lib.files = [
860864 '*.vhd'
861865]
862866" ,
867+ std:: env:: var( "CARGO_MANIFEST_DIR" ) . unwrap( )
868+ ) ,
863869 ) ;
864870
865871 expect_loaded_config_messages ( & mock, & config_uri) ;
You can’t perform that action at this time.
0 commit comments