tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
565 stars 97 forks source link

IIncludeFileSystem not called anymore when using empty path or null in SourceFile #228

Open mrvux opened 2 years ago

mrvux commented 2 years ago

found this (very small) issue when creating syntax tree with either null string and custom include resolver:

string path = null; var syntaxTree = SyntaxFactory.ParseSyntaxTree(new SourceFile(SourceText.From(code), path), null, myIncludeFileSystem);

if path is an empty string (or a null), include file system is never called.

if path is any string (not even an existing path), then it is called.

Will PR a fix that allows empty path or null string, since in some cases my files are just scripts and have no location, so include handler should still be called.