Skip to content
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

Merged
merged 4 commits into from
Aug 22, 2018
Merged

Fix Xcode autocompletion with excluded files #1117

merged 4 commits into from
Aug 22, 2018

Conversation

sp-jordi-vilalta
Copy link
Contributor

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.

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.
Copy link
Contributor

@TurkeyMan TurkeyMan left a 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.

Copy link
Member

@samsinsane samsinsane left a 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.

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.")
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed.

@samsinsane samsinsane merged commit 1abac19 into premake:master Aug 22, 2018
@sp-jordi-vilalta sp-jordi-vilalta deleted the fix/xcode-autocompletion branch August 22, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants