Skip to content

vscode-ccls does not compile #132

Description

@srinathava

I am trying to compile a local version of vscode-ccls by downloading the git repo. I tried the following:

$ git clone https://github.com/MaskRay/vscode-ccls.git
$ cd vscode-ccls
$ npm install
$ npm run build

Exepcted behavior: the extension successfully compiles

Actual behavior: I get the following errors:

$ npm run compile

> ccls@0.1.29 compile
> npx tsc -p ./

src/hierarchies/callHierarchy.ts:2:32 - error TS2307: Cannot find module 'vscode-languageclient/lib/main' or its corresponding type declarations.

2 import { LanguageClient } from 'vscode-languageclient/lib/main';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/hierarchies/hierarchy.ts:13:44 - error TS2307: Cannot find module 'vscode-languageclient/lib/main' or its corresponding type declarations.

13 import { Disposable, LanguageClient } from 'vscode-languageclient/lib/main';
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/hierarchies/inheritanceHierarchy.ts:2:32 - error TS2307: Cannot find module 'vscode-languageclient/lib/main' or its corresponding type declarations.

2 import { LanguageClient } from 'vscode-languageclient/lib/main';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/hierarchies/inheritanceHierarchy.ts:45:26 - error TS7006: Parameter 'c' implicitly has an 'any' type.

45     result.children.map((c) => InheritanceHierarchySetWantsDerived(c, element.wantsDerived));
                            ~

src/hierarchies/memberHierarchy.ts:2:32 - error TS2307: Cannot find module 'vscode-languageclient/lib/main' or its corresponding type declarations.

2 import { LanguageClient } from 'vscode-languageclient/lib/main';
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/inactiveRegions.ts:10:10 - error TS2305: Module '"../node_modules/vscode-languageclient/lib/common/api"' has no exported member 'LanguageClient'.

10 import { LanguageClient } from "vscode-languageclient";
            ~~~~~~~~~~~~~~

src/inactiveRegions.ts:36:63 - error TS7006: Parameter 'args' implicitly has an 'any' type.

36     this.client.onNotification("$ccls/publishSkippedRanges", (args) => this.onSkippedRanges(args));
                                                                 ~~~~

src/inactiveRegions.ts:65:15 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(callbackfn: (value: unknown, index: number, array: unknown[]) => value is Range, thisArg?: any): Range[]', gave the following error.
    Argument of type '(e: Range | undefined) => boolean' is not assignable to parameter of type '(value: unknown, index: number, array: unknown[]) => value is Range'.
      Types of parameters 'e' and 'value' are incompatible.
        Type 'unknown' is not assignable to type 'Range | undefined'.
          Type 'unknown' is not assignable to type 'Range'.
  Overload 2 of 2, '(callbackfn: (value: unknown, index: number, array: unknown[]) => unknown, thisArg?: any): unknown[]', gave the following error.
    Argument of type '(e: Range | undefined) => boolean' is not assignable to parameter of type '(value: unknown, index: number, array: unknown[]) => unknown'.
      Types of parameters 'e' and 'value' are incompatible.
        Type 'unknown' is not assignable to type 'Range | undefined'.
          Type 'unknown' is not assignable to type 'Range'.

65       .filter((e: Range | undefined) => e !== undefined) as Range[];
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


src/serverContext.ts:22:3 - error TS2305: Module '"../node_modules/vscode-languageclient/lib/common/api"' has no exported member 'LanguageClient'.

22   LanguageClient,
     ~~~~~~~~~~~~~~

src/serverContext.ts:26:3 - error TS2724: Module '"../node_modules/vscode-languageclient/lib/common/api"' has no exported member 'ServerOptions'. Did you mean 'SaveOptions'?

26   ServerOptions,
     ~~~~~~~~~~~~~

src/serverContext.ts:28:27 - error TS2307: Cannot find module 'vscode-languageclient/lib/protocolConverter' or its corresponding type declarations.

28 import { Converter } from "vscode-languageclient/lib/protocolConverter";
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/statusBarIcon.ts:3:10 - error TS2305: Module '"../node_modules/vscode-languageclient/lib/common/api"' has no exported member 'LanguageClient'.

3 import { LanguageClient } from "vscode-languageclient";
           ~~~~~~~~~~~~~~


Found 12 errors.

I get the same errors if I just open up vscode in the cloned repo and pressing (per the instructions at https://github.com/MaskRay/ccls/wiki/Visual-Studio-Code)

Versions of tools I am using:

$ npm -v
8.6.0

$ node -v
v16.14.2

$ code -v
1.66.1
8dfae7a5cd50421d10cd99cb873990460525a898
x64

I can see how to fix most of these errors by changing the imports, but I wanted to make sure I am not doing anything wrong.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions