Skip to content

Commit 5e8197c

Browse files
authored
Merge pull request #1316 from ahoppen/review-comments-1302
Address review comments to #1302
2 parents fcc527f + 56640c1 commit 5e8197c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Documentation/Files_To_Reindex.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ This is the easy case since only the file itself is affected.
2626

2727
## Compiler settings (`compile_commands.json` / `Package.swift`)
2828

29-
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:
30-
- 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.
29+
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:
30+
- 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.
3131
- The addition of a new Swift file to a target is equivalent to that file being modified and shouldn’t trigger a re-index of the entire target.
3232

3333
At the moment, unit files don’t include information about the compiler arguments with which they were created, so it’s impossible to know whether the compiler arguments have changed when a project is opened. Thus, for now, we don’t re-index any files on compiler settings changing.

Sources/SemanticIndex/CheckedIndex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public final class CheckedIndex {
118118

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

0 commit comments

Comments
 (0)