bscan / PerlNavigator

Perl Language Server that includes syntax checking, perl critic, and code navigation
MIT License
190 stars 35 forks source link

Allow use of more predefined VS Code variables in include paths #114

Open blues1875 opened 4 months ago

blues1875 commented 4 months ago

The $workspaceFolder variable is already available for use in include paths. Would it be possible to allow the use of other predefined variables? I would find $fileDirname to be useful.

bscan commented 4 months ago

Sure, that's a good idea and should be straightforward. The change would primarily be located in getIncPaths in utils.ts. The only tricky part is that the includePaths is used in two different places. In addition to compilation results, it also is used for getting the list of importable modules for the entire workspace (e.g. autocompletion on use ...). I could adjust getIncPaths to skip paths with $fileDirname unless an input file is specified for compilation results. I'm happy to add it, unless you or anyone else wants to submit a pull request for this one.