Validate search filesystem context after selection
This commit is contained in:
@@ -79,7 +79,14 @@ func filesystemOptionDiagnostics(source Source, context *FilesystemContext) []Di
|
||||
case sourceNone:
|
||||
return absentFilesystemOptionDiagnostics(context)
|
||||
case sourceSearch:
|
||||
return absentFilesystemOptionDiagnostics(context)
|
||||
if context.FS != nil {
|
||||
return absentFilesystemOptionDiagnostics(context)
|
||||
}
|
||||
// A selected host file can derive its root; absence requires an
|
||||
// explicit root. Check that compatibility only after selection.
|
||||
if context.BaseDir != "" && !filepath.IsAbs(context.BaseDir) {
|
||||
return []Diagnostic{optionDiagnostic(CodeOptionsInvalid, "filesystem base directory must be an absolute host path")}
|
||||
}
|
||||
case sourceFile:
|
||||
if context.FS != nil {
|
||||
return []Diagnostic{optionDiagnostic(CodeOptionsInvalid, "host file sources cannot use a native filesystem context")}
|
||||
|
||||
Reference in New Issue
Block a user