From cbb434d83d7115173cafc99eeeb3c62f01f384f1 Mon Sep 17 00:00:00 2001 From: Ryan Joseph Date: Sun, 22 Nov 2026 09:17:53 +0700 Subject: [PATCH] Resolve symlinks in excludeWorkspaceFolders and fix FPCOptions log splitting --- src/serverprotocol/PasLS.General.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/serverprotocol/PasLS.General.pas b/src/serverprotocol/PasLS.General.pas index 606f1d5..75b9024 100644 --- a/src/serverprotocol/PasLS.General.pas +++ b/src/serverprotocol/PasLS.General.pas @@ -25,7 +25,7 @@ interface uses { RTL } - Classes, URIParser, typinfo, + Classes, URIParser, typinfo, LazFileUtils, { Code Tools } CodeToolManager, CodeToolsConfig, { Protocol } @@ -186,14 +186,17 @@ function TInitialize.IsPathExcluded(const aPath: String; ExcludeFolders: TString NormalizedExclude: String; begin Result := False; + if (ExcludeFolders = nil) or (ExcludeFolders.Count = 0) then exit; - NormalizedPath := ExcludeTrailingPathDelimiter(aPath); + // Resolve symlinks so excluded paths match + NormalizedPath := IncludeTrailingPathDelimiter(GetPhysicalFilename(ExcludeTrailingPathDelimiter(aPath), pfeOriginal)); for ExcludePath in ExcludeFolders do begin - NormalizedExclude := ExcludeTrailingPathDelimiter(ExpandFileName(ExcludePath)); + NormalizedExclude := IncludeTrailingPathDelimiter(GetPhysicalFilename(ExcludeTrailingPathDelimiter(ExpandFileName(ExcludePath)), pfeOriginal)); + // Check if the path starts with the excluded path if (Pos(NormalizedExclude, NormalizedPath) = 1) then begin @@ -250,7 +253,7 @@ procedure TInitialize.ShowConfigStatus(Params: TInitializeParams; CodeToolsOptio ExcludeList, Option: String; clientInfoVersion: String; I: Integer; - FPCOptions: TStringArray; + FPCOptions: TStringList; begin if Params.clientInfo.version.HasValue then clientInfoVersion := ' ' + Params.clientInfo.version.Value @@ -271,9 +274,11 @@ procedure TInitialize.ShowConfigStatus(Params: TInitializeParams; CodeToolsOptio if CodeToolsOptions.FPCOptions <> '' then begin DoLog(kStatusPrefix+'FPCOptions:'); - FPCOptions := SplitString(CodeToolsOptions.FPCOptions, ' '); + FPCOptions := TStringList.Create; + SplitCmdLineParams(CodeToolsOptions.FPCOptions, FPCOptions); for Option in FPCOptions do DoLog(' '+Option); + FPCOptions.Free; end else DoLog(kStatusPrefix+'FPCOptions: [unspecified]');