Skip to content

Commit

Permalink
chore: update to TS v5
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Nov 28, 2022
1 parent 3d18695 commit bf661eb
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 86 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@types/node": "latest",
"typescript": "latest",
"typescript": "next",
"vite": "latest",
"vitest": "latest"
},
Expand Down
1 change: 1 addition & 0 deletions packages/language-server/src/utils/nodeFileSystemHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { URI } from 'vscode-uri';
import { FileSystem, FileSystemHost } from '../types';
import { IterableWeakSet } from './iterableWeakSet';
import { createUriMap } from './uriMap';
import type * as ts from 'typescript/lib/tsserverlibrary';

let currentCwd = '';

Expand Down
1 change: 1 addition & 0 deletions packages/language-service/src/baseLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as signatureHelp from './languageFeatures/signatureHelp';
import * as diagnostics from './languageFeatures/validation';
import * as workspaceSymbol from './languageFeatures/workspaceSymbols';
import { LanguageServicePlugin, LanguageServicePluginContext, LanguageServiceRuntimeContext } from './types';
import type * as ts from 'typescript/lib/tsserverlibrary';

// fix build
import type * as _ from 'vscode-languageserver-protocol';
Expand Down
8 changes: 4 additions & 4 deletions plugins/typescript/src/protocol.d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as Proto from 'typescript/lib/protocol';
export = Proto;
import * as Proto from 'typescript/lib/tsserverlibrary';
export = Proto.server.protocol;

declare enum ServerType {
Syntax = 'syntax',
Semantic = 'semantic',
}
declare module 'typescript/lib/protocol' {
declare module 'typescript/lib/tsserverlibrary' {

interface Response {
readonly _serverType?: ServerType;
}

interface JSDocLinkDisplayPart {
target: Proto.FileSpan;
target: Proto.server.protocol.FileSpan;
}
}

4 changes: 2 additions & 2 deletions plugins/typescript/src/utils/typeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/

import * as vscode from 'vscode-languageserver-protocol';
import type * as Proto from '../protocol';
import * as PConst from '../protocol.const';
import type * as ts from 'typescript/lib/tsserverlibrary';

export namespace SymbolKind {
export function fromProtocolScriptElementKind(kind: Proto.ScriptElementKind) {
export function fromProtocolScriptElementKind(kind: ts.ScriptElementKind) {
switch (kind) {
case PConst.Kind.module: return vscode.SymbolKind.Module;
case PConst.Kind.class: return vscode.SymbolKind.Class;
Expand Down

0 comments on commit bf661eb

Please sign in to comment.