Address review comments to #1302

This commit is contained in:
Alex Hoppen
2024-05-17 10:36:32 -07:00
parent 490871b21f
commit 56640c19c5
2 changed files with 3 additions and 3 deletions

View File

@@ -26,8 +26,8 @@ This is the easy case since only the file itself is affected.
## Compiler settings (`compile_commands.json` / `Package.swift`)
Ideally, we would considered like a file change for all files whose compile commands have changed, if they changed in a meaningful way (ie. in a way that would also trigger re-compilation in an incremental build). Non-meaningful changes would be:
- If compiler arguments, like include paths are shuffled around. We could have a really quick check for compiler arguments equality by comparing them unordered. Any really compiler argument change will most likely do more than rearranging the arguments.
Ideally, we would like to consider a file as changed when its compile commands have changed, if they changed in a meaningful way (ie. in a way that would also trigger re-compilation in an incremental build). Non-meaningful changes would be:
- If compiler arguments that aren't order dependent are shuffled around. We could have a really quick check for compiler arguments equality by comparing them unordered. Any real compiler argument change will most likely do more than rearranging the arguments.
- The addition of a new Swift file to a target is equivalent to that file being modified and shouldnt trigger a re-index of the entire target.
At the moment, unit files dont include information about the compiler arguments with which they were created, so its impossible to know whether the compiler arguments have changed when a project is opened. Thus, for now, we dont re-index any files on compiler settings changing.

View File

@@ -118,7 +118,7 @@ public final class CheckedIndex {
/// Returns all the files that (transitively) include the header file at the given path.
///
/// If `crossLanguage` is set to `true`, Swift files that import a header will through a module will also be reported.
/// If `crossLanguage` is set to `true`, Swift files that import a header through a module will also be reported.
public func mainFilesContainingFile(uri: DocumentURI, crossLanguage: Bool = false) -> [DocumentURI] {
return index.mainFilesContainingFile(path: uri.pseudoPath, crossLanguage: crossLanguage).compactMap {
let url = URL(fileURLWithPath: $0)