waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.76k stars 106 forks source link

Handle exceptions from Roslyn Completion API #334

Closed waf closed 6 months ago

waf commented 6 months ago

Workaround for #331. We get the following errors from the roslyn completion libs:

InvalidOperationException: This program location is thought to be unreachable. File='/_/src/Features/CSharp/Portable/Completion/CompletionProviders/PropertySubPatternCompletionProvider.cs' Line=116

If we get any roslyn library exceptions during autocompletion, it's better to just not have any completions than crash the entire repl.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 77.6%. Comparing base (9eff460) to head (55ce52a). Report is 3 commits behind head on main.

Files Patch % Lines
...arpRepl.Services/Completion/AutoCompleteService.cs 64.2% 3 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #334 +/- ## ======================================= - Coverage 77.6% 77.6% -0.1% ======================================= Files 83 83 Lines 5597 5600 +3 Branches 734 730 -4 ======================================= + Hits 4346 4347 +1 - Misses 984 986 +2 Partials 267 267 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.