03-Inspections/1-As_you_type/1.4-Navigation.cs [1:63]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace JetBrains.ReSharper.Koans.Inspections
{
// Navigate between highlights
//
// Alt+PageUp and Alt+PageDn (VS)
// F12 and Shift+F12 (IntelliJ)
//
// Navigate between errors
//
// Shift+Alt+PageUp and Shift+Alt+PageDn (VS)
//
public class Navigation
{
public string ErrorHighlight()
{
// 1. Replace null with 3000 to make an error highlight
return null;
}
public void WarningHighlight()
{
const int condition = 42;
if (condition == 42)
Console.WriteLine("True");
}
public void SuggestionHighlight()
{
var files = Directory.GetFiles(@"C:\temp", "*.txt");
if (files.Count() > 0)
Console.WriteLine("Got some!");
}
public void HintHighlight()
{
PrivateMethodCanBeMadeStatic();
}
// 2. Hints are not navigable
private void PrivateMethodCanBeMadeStatic()
{
}
public void DeadCode()
{
// 5. Highlights code that is redundant or unreachable
// Shows as greyed out
// Hover mouse over to see tooltip: "Method invocation is skipped..."
ConditionalMethod();
return;
// "Code is unreachable"
Console.WriteLine("Hello");
}
[Conditional("UndefinedSymbol")]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
localized/ja/03-Inspections/1-As_you_type/1.4-Navigation.cs [1:63]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace JetBrains.ReSharper.Koans.Inspections
{
// Navigate between highlights
//
// Alt+PageUp and Alt+PageDn (VS)
// F12 and Shift+F12 (IntelliJ)
//
// Navigate between errors
//
// Shift+Alt+PageUp and Shift+Alt+PageDn (VS)
//
public class Navigation
{
public string ErrorHighlight()
{
// 1. Replace null with 3000 to make an error highlight
return null;
}
public void WarningHighlight()
{
const int condition = 42;
if (condition == 42)
Console.WriteLine("True");
}
public void SuggestionHighlight()
{
var files = Directory.GetFiles(@"C:\temp", "*.txt");
if (files.Count() > 0)
Console.WriteLine("Got some!");
}
public void HintHighlight()
{
PrivateMethodCanBeMadeStatic();
}
// 2. Hints are not navigable
private void PrivateMethodCanBeMadeStatic()
{
}
public void DeadCode()
{
// 5. Highlights code that is redundant or unreachable
// Shows as greyed out
// Hover mouse over to see tooltip: "Method invocation is skipped..."
ConditionalMethod();
return;
// "Code is unreachable"
Console.WriteLine("Hello");
}
[Conditional("UndefinedSymbol")]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -