1
+ import glob
1
2
import os
2
3
import sys
3
4
from dataclasses import dataclass , field
@@ -214,17 +215,18 @@ def on_robot_initialized(sender) -> None: ...
214
215
215
216
def server_initialized (self , sender : Any ) -> None :
216
217
for folder in self .workspace .workspace_folders :
217
- config : RobotConfig = self .workspace .get_configuration (RobotConfig , folder .uri )
218
218
219
219
for p in self .robot_profile .python_path or []:
220
220
pa = Path (str (p ))
221
221
if not pa .is_absolute ():
222
222
pa = Path (folder .uri .to_path (), pa )
223
223
224
224
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 )
227
228
229
+ config : RobotConfig = self .workspace .get_configuration (RobotConfig , folder .uri )
228
230
if config is not None :
229
231
if config .env :
230
232
for k , v in config .env .items ():
@@ -237,7 +239,8 @@ def server_initialized(self, sender: Any) -> None:
237
239
pa = Path (folder .uri .to_path (), pa )
238
240
239
241
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 )
242
245
243
246
self .on_robot_initialized (self )
0 commit comments