[SourceKit] Replace decl.name with syntaxtype.keyword as appropriate

We aren't ready to start marking up all keywords yet, but start by
replacing the cases where we currently have decl.name.

rdar://problem/24292226
This commit is contained in:
Ben Langmuir
2016-03-01 15:34:24 -08:00
parent 3ffbe020d7
commit b4469d88dc
5 changed files with 36 additions and 31 deletions

View File

@@ -82,6 +82,11 @@ static StringRef getDeclNameTagForDecl(const Decl *D) {
// When we're examining the parameter itself, it is the local name that is
// the name of the variable.
return LocalParamNameTag;
case DeclKind::Constructor:
case DeclKind::Destructor:
case DeclKind::Subscript:
// The names 'init'/'deinit'/'subscript' are actually keywords.
return "syntaxtype.keyword";
default:
return "decl.name";
}