8000 JSDoc null doesn't get picked up correctly · Issue #333 · neoclide/coc-tsserver · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JSDoc null doesn't get picked up correctly #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rschristian opened this issue Dec 20, 2021 · 5 comments
Open

JSDoc null doesn't get picked up correctly #333

rschristian opened this issue Dec 20, 2021 · 5 comments

Comments

@rschristian
Copy link
Contributor

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.

@chemzqm
Copy link
Member
chemzqm commented Dec 21, 2021

Should be problem of your language server, checkout https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

@chemzqm
Copy link
Member
chemzqm commented Dec 21, 2021

Same behavior on my VSCode, don't know how to fix.

@rschristian
Copy link
Contributor Author

Well that's bizarre. Swapping out the null for any other type, as far as I can tell, works correctly.

Should I raise this issue on VSCode's tracker?

@chemzqm
Copy link
Member
chemzqm commented Dec 21, 2021

It's up to you.

@chemzqm
Copy link
Member
chemzqm commented Dec 21, 2021

I found suggest.jsdoc.generateReturns in source code of VSCode, coc-tsserver may need to support it.

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

No branches or pull requests

2 participants
0