Vetur: Upgrade vscode-css-languageservice

Created on 14 Aug 2020  路  3Comments  路  Source: vuejs/vetur

Now it has compilation errors:

server/src/modes/style/index.ts:59:5 - error TS2322: Type '(document: import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-languageserver-types/lib/umd/main").TextDocument) => import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-css-languageservice/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic[]' is not assignable to type '(document: import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-languageserver-types/lib/umd/main").TextDocument) => import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic[]'.
  Type 'import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-css-languageservice/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic[]' is not assignable to type 'import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic[]'.
    Type 'import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-css-languageservice/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic' is not assignable to type 'import("/Users/pine/Code/mine/vetur/vetur/server/node_modules/vscode-languageserver-types/lib/umd/main").Diagnostic'.
      Types of property 'code' are incompatible.
        Type 'string | number | DiagnosticCode | undefined' is not assignable to type 'string | number | undefined'.
          Type 'DiagnosticCode' is not assignable to type 'string | number | undefined'.
            Type 'DiagnosticCode' is not assignable to type 'number'.

59     doValidation(document) {
       ~~~~~~~~~~~~

  server/src/embeddedSupport/languageModes.ts:52:3
    52   doValidation?(document: TextDocument): Diagnostic[];
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The expected type comes from property 'doValidation' which is declared here on type 'LanguageMode'

server/src/modes/style/index.ts:67:5 - error TS2322: Type '(document: TextDocument, position: Position) => { isIncomplete: boolean; items: { sortText: string; label: string; kind?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | ... 13 more ... | undefined; ... 12 more ...; data?: any; }[]; }' is not assignable to type '(document: TextDocument, position: Position) => CompletionList'.
  Call signature return types '{ isIncomplete: boolean; items: { sortText: string; label: string; kind?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | undefined; tags?: 1[] | undefined; ... 11 more ...; data?: any; }[]; }' and 'CompletionList' are incompatible.
    The types of 'items' are incompatible between these types.
      Type '{ sortText: string; label: string; kind?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | undefined; tags?: 1[] | undefined; detail?: string | undefined; ... 10 more ...; data?: any; }[]' is not assignable to type 'CompletionItem[]'.
        Type '{ sortText: string; label: string; kind?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | undefined; tags?: 1[] | undefined; detail?: string | undefined; ... 10 more ...; data?: any; }' is not assignable to type 'CompletionItem'.
          Types of property 'textEdit' are incompatible.
            Type 'TextEdit | InsertReplaceEdit | undefined' is not assignable to type 'TextEdit | undefined'.
              Property 'range' is missing in type 'InsertReplaceEdit' but required in type 'TextEdit'.

67     doComplete(document, position) {
       ~~~~~~~~~~

  server/node_modules/vscode-languageserver-types/lib/umd/main.d.ts:486:5
infrastructure

Most helpful comment

I can do this one.

All 3 comments

I can do this one.

@triforcely Sure, give it a try 馃憤

It is harder than I expected, since some of the underlying vscode types has changed and some of the code needs to be aligned/rewritten but FYI I'm still working on that in my free time.

Was this page helpful?
0 / 5 - 0 ratings