Skip to content

JSDoc null doesn't get picked up correctly #333

@rschristian

Description

@rschristian

I'm running into a weird issue where null in JSDoc comments do not get picked up, but seemingly just disappear. The TS playground works correctly, however.

Example snippet

/**
 * @returns {{ bar: ( baz: string ) => { baz: string } | null }}
 */
export function foo() {
    return {
        bar(baz) {
            if (baz) return { baz };
            return null;
        }
    }
}

CoC

temp2

As you'll see, the | null is just missing from the return signature.

TS Playground

Playground Link

This works correctly.

Info

jsconfig.json

{
  "compilerOptions": {
    "target": "ESNext",
    "module": "ESNext",
    "moduleResolution": "Node",
    "allowJs": true,
    "checkJs": true,
    "noEmit": true
  },
  "include": ["packages/**/*"]
}

:CocInfo

## versions

vim version: NVIM v0.6.0
node version: v14.18.2
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /home/ryun/.vim/plugged/coc.nvim
term: alacritty
platform: linux

Using coc-tsserver v1.8.6

Let me know if I missed any other details that can help you track this down.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions