summaryrefslogtreecommitdiffstats
path: root/src/state.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-11-16 05:38:21 (GMT)
committerNico Weber <nicolasweber@gmx.de>2011-11-16 05:42:34 (GMT)
commitf72a4137f5a9b3ee4001d60888612b22a6a63020 (patch)
tree7901b64ddb1a4def692eb6c151e357367443a720 /src/state.cc
parentd838f8ed07d5cc2550a8b083ad7e866de49fe45d (diff)
downloadNinja-f72a4137f5a9b3ee4001d60888612b22a6a63020.zip
Ninja-f72a4137f5a9b3ee4001d60888612b22a6a63020.tar.gz
Ninja-f72a4137f5a9b3ee4001d60888612b22a6a63020.tar.bz2
Add spelling suggestions for four cases:
1. For targets, when invoking ninja to build a target. 2. For targets, when doing a "query" command. 3. For command names. 4. For the subcommands of the "targets" command. Also change CmdTargets() to call LookupNode() instead of GetNode() -- since the result was checked for NULL, that's probably what was intended here originally.
Diffstat (limited to 'src/state.cc')
-rw-r--r--src/state.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/state.cc b/src/state.cc
index 87d824b..9519856 100644
--- a/src/state.cc
+++ b/src/state.cc
@@ -59,6 +59,13 @@ Node* State::LookupNode(const string& path) {
return file->node_;
}
+Node* State::SpellcheckNode(const string& path) {
+ FileStat* file = stat_cache_.SpellcheckFile(path);
+ if (!file || !file->node_)
+ return NULL;
+ return file->node_;
+}
+
void State::AddIn(Edge* edge, const string& path) {
Node* node = GetNode(path);
edge->inputs_.push_back(node);