Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 8de363f

Browse files
committed
Don't throw NotImplementedExceptions in IParser.ResolveSnippet() - see #399
1 parent 6ebd1e6 commit 8de363f

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public ICompilation CreateCompilationForSingleFile(FileName fileName, IUnresolve
130130

131131
public ResolveResult ResolveSnippet(ParseInformation parseInfo, TextLocation location, string codeSnippet, ICompilation compilation, CancellationToken cancellationToken)
132132
{
133-
throw new NotImplementedException();
133+
return null;
134134
}
135135
}
136136
}

src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public ICodeContext ResolveContext(ParseInformation parseInfo, TextLocation loca
8282

8383
public ResolveResult ResolveSnippet(ParseInformation parseInfo, TextLocation location, string codeSnippet, ICompilation compilation, CancellationToken cancellationToken)
8484
{
85-
throw new NotImplementedException();
85+
return null;
8686
}
8787

8888
public void FindLocalReferences(ParseInformation parseInfo, ITextSource fileContent, IVariable variable, ICompilation compilation, Action<SearchResultMatch> callback, CancellationToken cancellationToken)

src/Main/Base/Project/Parser/IParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ParseInformation Parse(FileName fileName, ITextSource fileContent, bool fullPars
8787

8888
/// <summary>
8989
/// Creates a compilation for a single file that does not belong to any project.
90-
/// Used by <see cref="ParserService.GetCompilationForFile"/>.
90+
/// Used by <see cref="IParserService.GetCompilationForFile"/>.
9191
/// May return null if this operation is not supported.
9292
/// </summary>
9393
ICompilation CreateCompilationForSingleFile(FileName fileName, IUnresolvedFile unresolvedFile);

src/Main/SharpDevelop/Parser/ParserService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public ResolveResult ResolveSnippet(FileName fileName, TextLocation fileLocation
328328
compilation = GetCompilationForFile(fileName);
329329
ResolveResult rr = entry.parser.ResolveSnippet(parseInfo, fileLocation, codeSnippet, compilation, cancellationToken);
330330
LoggingService.Debug("Resolved " + fileLocation + " to " + rr);
331-
return rr;
331+
return rr ?? ErrorResolveResult.UnknownError;
332332
}
333333

334334
public Task<ResolveResult> ResolveAsync(FileName fileName, TextLocation location, ITextSource fileContent, ICompilation compilation, CancellationToken cancellationToken)

0 commit comments

Comments
 (0)