mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When converting a call or function, rename declarations such that redeclaration errors and shadowing are avoided. In some cases this will be overly conservative, but since any renamed variable can be fixed with edit all in scope, this is preferred over causing redeclaration errors or possible shadowing. Resolves rdar://73973517
75 lines
3.3 KiB
C++
75 lines
3.3 KiB
C++
//===--- DiagnosticsRefactoring.def - Diagnostics Text ----------*- C++ -*-===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines diagnostics emitted during refactoring.
|
|
// Each diagnostic is described using one of three kinds (error, warning, or
|
|
// note) along with a unique identifier, category, options, and text, and is
|
|
// followed by a signature describing the diagnostic argument kinds.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define DEFINE_DIAGNOSTIC_MACROS
|
|
#include "DefineDiagnosticMacros.h"
|
|
|
|
//==============================================================================
|
|
// Refactoring diagnostics
|
|
//==============================================================================
|
|
|
|
ERROR(invalid_name, none, "'%0' is not a valid name", (StringRef))
|
|
|
|
ERROR(invalid_location, none, "given location is not valid", ())
|
|
|
|
ERROR(arity_mismatch, none, "the given new name '%0' does not match the arity of the old name '%1'", (StringRef, StringRef))
|
|
|
|
ERROR(name_not_functionlike, none, "the 'call' name usage cannot be used with a non-function-like name '%0'", (StringRef))
|
|
|
|
ERROR(unresolved_location, none, "cannot resolve location as name", ())
|
|
|
|
ERROR(location_module_mismatch, none, "given location does not belong to module '%0'", (StringRef))
|
|
|
|
ERROR(value_decl_no_loc, none, "value decl '%0' has no declaration location", (DeclName))
|
|
|
|
ERROR(value_decl_referenced_out_of_range, none, "value decl '%0' is referenced out of range", (DeclName))
|
|
|
|
ERROR(multi_entry_range, none, "selected range has more than one entry point", ())
|
|
|
|
ERROR(orphan_loop_keyword, none, "selected range contains %0 but not its target loop", (StringRef))
|
|
|
|
ERROR(invalid_default_location, none, "given location is not on a default statement", ())
|
|
|
|
ERROR(no_parent_switch, none, "cannot find enclosing switch statement", ())
|
|
|
|
ERROR(no_remaining_cases, none, "no remaining cases to expand", ())
|
|
|
|
WARNING(mismatched_rename, none, "the name at the given location cannot be renamed to '%0'", (StringRef))
|
|
|
|
ERROR(no_insert_position, none, "cannot find inserting position", ())
|
|
|
|
ERROR(missing_callback_arg, none, "cannot refactor as callback closure argument missing", ())
|
|
|
|
ERROR(mismatched_callback_args, none, "cannot refactor as callback arguments do not match declaration", ())
|
|
|
|
ERROR(unknown_callback_conditions, none, "cannot refactor complex if conditions", ())
|
|
|
|
ERROR(mixed_callback_conditions, none, "cannot refactor mixed nil and not-nil conditions", ())
|
|
|
|
ERROR(callback_with_fallthrough, none, "cannot refactor switch with fallthrough", ())
|
|
|
|
ERROR(callback_with_default, none, "cannot refactor switch with default case", ())
|
|
|
|
ERROR(callback_multiple_case_items, none, "cannot refactor switch using a case with multiple items", ())
|
|
|
|
ERROR(callback_where_case_item, none, "cannot refactor switch using a case with where clause", ())
|
|
|
|
#define UNDEFINE_DIAGNOSTIC_MACROS
|
|
#include "DefineDiagnosticMacros.h"
|