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

type definitions on imports are always "any" #302

Closed andykais closed 3 years ago

andykais commented 3 years ago

given these files:

// src/database.ts
export class Database {}
// src/index.ts
import { Database } from './database'

class Logger {}

class Context {
  db = new Database()
  logger = new Logger()
}

tsconfig.json:

{
  "compilerOptions": {
    "outDir": "build",
    "sourceMap": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "alwaysStrict": true,
    "strict": true,
    "declaration": true,
    "declarationMap": true
  },
  "include": ["src/**/*.ts"]
}

using "K" on a type definition that is imported will always be any screenshot(658) types defined within a file are correctly shown: screenshot(657)

my CocConfig:

{
  "suggest.autoTrigger": "none",
  "diagnostic.enable": false,
  "signature.preferShownAbove": false
}
chemzqm commented 3 years ago

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