Skip to content

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

Open

Description

@textGamex

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

Activity

  1. CppCXY commented on Dec 30, 2024

    @CppCXY
    Owner

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

  2. textGamex commented on Dec 30, 2024

    @textGamex
    ContributorAuthor

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

  3. CppCXY commented on Dec 30, 2024

    @CppCXY
    Owner

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

  4. textGamex commented on Jan 2, 2025

    @textGamex
    ContributorAuthor

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

  5. CppCXY commented on Jan 2, 2025

    @CppCXY
    Owner

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

  6. CppCXY commented on Jan 2, 2025

    @CppCXY
    Owner

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

  7. textGamex commented on Jan 2, 2025

    @textGamex
    ContributorAuthor

    明白了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions