question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow `null` for optional values.

See original GitHub issue

I have implemented hierarchical outlining in my language server and vscode calls it on ctrl-shift-o, but it is never displaying it, only “No symbols found”. Log:

2018-08-26T15:23:40.449:app.d:processRequest:77 Calling provideDocumentSymbols
[Trace - 3:23:40 PM] Received response 'textDocument/documentSymbol - (24)' in 17ms.
Result: [
    {
        "children": [],
        "deprecated": false,
        "detail": null,
        "kind": 12,
        "name": "main",
        "range": {
            "end": {
                "character": 0,
                "line": 19
            },
            "start": {
                "character": 0,
                "line": 9
            }
        },
        "selectionRange": {
            "end": {
                "character": 0,
                "line": 9
            },
            "start": {
                "character": 0,
                "line": 9
            }
        }
    }
]

The outline panel is also not showing anything.

Version: "vscode-languageclient": "^5.0.1" (tsc complained about some issues in vscode failing to compile but I think this should be unaffected?), edit: fixed these by updating vscode engine to 1.26.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aeschlicommented, Aug 27, 2018

Makes sense to me to also allow ‘null’

1reaction
WebFreak001commented, Aug 27, 2018

my server is implemented in D, where empty strings and arrays are equal to a null slice (0 length, null ptr), which is serialized by the json serializer I use by default to null. I have now added a custom serialization policy for the structs in question but I think it would be nice if the parser would be a bit more leniant on allowing null on values, especially because when using fixed data types in some languages it might not really be possible to define policies like ignoring unchanged values without a lot of hassle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optional for definitely null values in Java 8 - Stack Overflow
Optional for definitely null values in Java 8 [duplicate] ; 1. Use ofNullable , of does not allow the value to be null....
Read more >
10. Handling nulls with Optional - Java 8 tutorial!
You can create an optional object from a nullable value using the static factoy method Optional.ofNullable . The advantage over using this method...
Read more >
Handling null: optional and nullable types - A Java geek
The reason for the NPE is calling a method or accessing an attribute of an object that has not been initialized. var value...
Read more >
Java: Why not allow nulls in methods to represent optional ...
In general it is a bad idea to use null to indicate an optional value. It is a bad idea whether it is...
Read more >
[Feature Request] Allow Nulls for Optional Fields #266 - GitHub
Optional fields would accept null values. Actual Behavior. The error noted above. Metadata. Typsense Version: 0.19.0. OS: MacOS 11.2.3.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found