1+ import glob
12import os
23import sys
34from dataclasses import dataclass , field
@@ -214,17 +215,18 @@ def on_robot_initialized(sender) -> None: ...
214215
215216 def server_initialized (self , sender : Any ) -> None :
216217 for folder in self .workspace .workspace_folders :
217- config : RobotConfig = self .workspace .get_configuration (RobotConfig , folder .uri )
218218
219219 for p in self .robot_profile .python_path or []:
220220 pa = Path (str (p ))
221221 if not pa .is_absolute ():
222222 pa = Path (folder .uri .to_path (), pa )
223223
224224 absolute_path = str (pa .absolute ())
225- if absolute_path not in sys .path :
226- sys .path .insert (0 , absolute_path )
225+ for f in glob .glob (absolute_path ):
226+ if Path (f ).is_dir () and f not in sys .path :
227+ sys .path .insert (0 , f )
227228
229+ config : RobotConfig = self .workspace .get_configuration (RobotConfig , folder .uri )
228230 if config is not None :
229231 if config .env :
230232 for k , v in config .env .items ():
@@ -237,7 +239,8 @@ def server_initialized(self, sender: Any) -> None:
237239 pa = Path (folder .uri .to_path (), pa )
238240
239241 absolute_path = str (pa .absolute ())
240- if absolute_path not in sys .path :
241- sys .path .insert (0 , absolute_path )
242+ for f in glob .glob (absolute_path ):
243+ if Path (f ).is_dir () and f not in sys .path :
244+ sys .path .insert (0 , f )
242245
243246 self .on_robot_initialized (self )
0 commit comments