neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

TSServer not getting the correct tsconfig #273

Closed CodeSwimBikeRunner closed 3 years ago

CodeSwimBikeRunner commented 3 years ago

I have a workspace that contains many projects with angular, and the tsserver doesn't seem to be reading the local tsconfig.app.json or the tsconfig.json on the workspace root.

When I ran trace, this is what it received.

[Trace  - 8:11:09 PM] Sending request: compilerOptionsForInferredProjects (1). Response expected: no. Current queue length: 0
Arguments: {
    "options": {
        "module": "commonjs",
        "target": "es2016",
        "jsx": "preserve",
        "allowJs": true,
        "allowSyntheticDefaultImports": true,
        "allowNonTsExtensions": true
    }
}

Which is absolutely not what either of the tsconfigs were, is there a special way to get tsserver to use the local workspace or project tsconfig.*.json?

chemzqm commented 3 years ago

That request doesn't means your current project is inferred project.

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

CodeSwimBikeRunner commented 3 years ago

Yes, I ran :CocCommand workspace.showOutput and In addition to those options I originally posted, it shows this error.

            "start": {
                "line": 8,
                "offset": 14
            },
            "end": {
                "line": 8,
                "offset": 26
            },
            "text": "Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.",
            "code": 1219,
            "category": "error"

My tsconfig, and angular, supports expirementalDecorators with this line.

"experimentalDecorators": true,

As far as the trace output, I wasn't seeing anything strange.

And for the final error, every import threw this error

            "text": "Cannot find module '@angular/core' or its corresponding type declarations.",
            "code": 2307,

@chemzqm is there anything else you want me to get a log of.