-
-
Notifications
You must be signed in to change notification settings - Fork 620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Xcode autocompletion with excluded files #1117
Fix Xcode autocompletion with excluded files #1117
Conversation
Without this, files are added to the exclude list on all configurations, which disables autocompletion on Xcode. If a file is just excluded in some configurations it's handled the old way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine to me... but I'm not an xcode user, so I can't really comment on the approach.
Someone who knows xcode needs to merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the p.warn
this change seems fine to me. I'm not a big user of XCode or the exclude files feature, but if the p.warn
change is made I'm happy to merge this.
modules/xcode/xcode_project.lua
Outdated
if value == nil then | ||
value = newValue | ||
elseif value ~= newValue then | ||
print("WARNING: " .. node.name .. " is excluded in just some configurations. Autocompletion will not work correctly on this file in Xcode.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably use p.warn
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, changed.
Xcode's autocompletion gets disabled when a file is added to the exclude list. Unfortunately, the compilation units module adds the ExcludeFromBuild flag to all the source files, and the Xcode module translates it into adding them to the Xcode exclude list.
This commit checks if a file must be excluded in all the configurations and in that case it removes the file from the target, so there's no need to add it to any exclusion list (letting Xcode index the file). In case a file is excluded in just some configurations, it prints a warning and keeps the old behavior for that file.