LanguageServer.Framework icon indicating copy to clipboard operation
LanguageServer.Framework copied to clipboard

Bug: 错误的调用PublishDiagnostics时会抛出 NullReferenceException

Open textGamex opened this issue 11 months ago • 7 comments

当调用 PublishDiagnostics 时,如果在创建 PublishDiagnosticsParams 没有给 Uri 赋值会报空指针异常

textGamex avatar Dec 29 '24 16:12 textGamex

不是BUG, 该参数没有标记可空

CppCXY avatar Dec 30 '24 02:12 CppCXY

但不应该抛出NullReferenceException, 而是InvalidOperationException更好一点吧, 还有虽然没有标记可为空, 但不是强制要求赋值的, 是不是可以改为要求强制赋值?

textGamex avatar Dec 30 '24 08:12 textGamex

抛出nullRef是 Text.Json抛的如果要介入相关流程, 等于每个class我都要写JsonConventor, 这没有必要, 添加required确实可以, 但我没有那个时间

CppCXY avatar Dec 30 '24 08:12 CppCXY

请问为什么使用Lits<T>而不是数组呢? 按理来说数组的性能高一些.

textGamex avatar Jan 02 '25 08:01 textGamex

更适合搭配linq使用, 而且list和数组在性能上没有本质差别, 另外C#里面list比数组用的多得多,

CppCXY avatar Jan 02 '25 08:01 CppCXY

而且这个项目可以AOT, list和数组的性能差异可以忽略不计

CppCXY avatar Jan 02 '25 08:01 CppCXY

明白了

textGamex avatar Jan 02 '25 08:01 textGamex