cmds.projects.CmdCreateFile: Add subdirs src/python
In order to allow Pyright to check the types provided by dependant repositories without installing them, pyrightconfig.json contains a list of paths to their root directories in "extraPaths". These paths are unusable for Pyright, though: For type checking to work, it needs to be pointed to the "jw" namespace package paths within those repos. This commit achieves that by appending the subdirs src/python and tools/python to them, provided they exist.
TODO: This fix hardcodes the current project directory structure. Better would be a way to customize that via makefiles, where the paths can be more easily customized.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0b558635a8
commit
c0c9148281
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ class CmdCreateFile(Cmd): # export
|
|||
|
||||
extra_paths = []
|
||||
for m in prereq:
|
||||
path = self.app.find_dir(m)
|
||||
path = self.app.find_dir(m, search_subdirs = ['src/python', 'tools/python'])
|
||||
if path is None:
|
||||
log(WARNING, f'No project directory for module "{m}"')
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue