@@ -11,6 +11,7 @@ use crate::completion::{list_completion_options, CompletionItem};
1111use crate :: config:: Config ;
1212use crate :: lint:: dead_code:: UnusedDeclarationsLinter ;
1313use crate :: named_entity:: { AnyEnt , EntRef } ;
14+ use crate :: standard:: VHDLStandard ;
1415use crate :: syntax:: VHDLParser ;
1516use crate :: { data:: * , EntHierarchy , EntityId } ;
1617use fnv:: { FnvHashMap , FnvHashSet } ;
@@ -28,8 +29,8 @@ pub struct Project {
2829}
2930
3031impl Project {
31- pub fn new ( ) -> Project {
32- let parser = VHDLParser :: default ( ) ;
32+ pub fn new ( vhdl_standard : VHDLStandard ) -> Project {
33+ let parser = VHDLParser :: new ( vhdl_standard ) ;
3334 Project {
3435 root : DesignRoot :: new ( parser. symbols . clone ( ) ) ,
3536 files : FnvHashMap :: default ( ) ,
@@ -47,7 +48,7 @@ impl Project {
4748 /// Create instance from given configuration.
4849 /// Files referred by configuration are parsed into corresponding libraries.
4950 pub fn from_config ( config : Config , messages : & mut dyn MessageHandler ) -> Project {
50- let mut project = Project :: new ( ) ;
51+ let mut project = Project :: new ( config . standard ( ) ) ;
5152 let files = project. load_files_from_config ( & config, messages) ;
5253 project. parse_and_add_files ( files, messages) ;
5354 project. config = config;
@@ -58,7 +59,7 @@ impl Project {
5859 /// The design state is reset, new files are added and parsed. Existing source files will be
5960 /// kept and parsed from in-memory source (required for incremental document updates).
6061 pub fn update_config ( & mut self , config : Config , messages : & mut dyn MessageHandler ) {
61- self . parser = VHDLParser :: default ( ) ;
62+ self . parser = VHDLParser :: new ( config . standard ( ) ) ;
6263 self . root = DesignRoot :: new ( self . parser . symbols . clone ( ) ) ;
6364
6465 // Reset library associations for known files,
@@ -344,12 +345,6 @@ fn multiply<T: Clone>(value: T, n: usize) -> Vec<T> {
344345 }
345346}
346347
347- impl Default for Project {
348- fn default ( ) -> Self {
349- Self :: new ( )
350- }
351- }
352-
353348pub struct SourceFile {
354349 library_names : FnvHashSet < Symbol > ,
355350 source : Source ,
0 commit comments