volar-service-typescript
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,12 +0,12 @@ | ||
import { InjectionKey, Service } from '@volar/language-service'; | ||
import type { Service } from '@volar/language-service'; | ||
import type * as ts from 'typescript/lib/tsserverlibrary'; | ||
import type { TextDocument } from 'vscode-languageserver-textdocument'; | ||
export declare const injectionKeys: { | ||
typescript: InjectionKey<[], typeof import('typescript/lib/tsserverlibrary')>; | ||
sourceFile: InjectionKey<[TextDocument], ts.SourceFile>; | ||
languageService: InjectionKey<[TextDocument], ts.LanguageService>; | ||
languageServiceHost: InjectionKey<[TextDocument], ts.LanguageServiceHost>; | ||
textDocument: InjectionKey<[uri: string], TextDocument>; | ||
}; | ||
export interface Provide { | ||
'typescript/typescript': () => typeof import('typescript/lib/tsserverlibrary'); | ||
'typescript/sourceFile': (_: TextDocument) => ts.SourceFile | undefined; | ||
'typescript/languageService': (_: TextDocument) => ts.LanguageService | undefined; | ||
'typescript/languageServiceHost': (_: TextDocument) => ts.LanguageServiceHost | undefined; | ||
'typescript/textDocument': (uri: string) => TextDocument | undefined; | ||
} | ||
declare const _default: () => Service; | ||
export default _default; |
@@ -26,4 +26,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.injectionKeys = void 0; | ||
const language_service_1 = require("@volar/language-service"); | ||
const semver = __importStar(require("semver")); | ||
@@ -59,9 +57,3 @@ const vscode = __importStar(require("vscode-languageserver-protocol")); | ||
const tsconfig = __importStar(require("./services/tsconfig")); | ||
exports.injectionKeys = { | ||
typescript: 'typescript/typescript', | ||
sourceFile: 'typescript/sourceFile', | ||
languageService: 'typescript/languageService', | ||
languageServiceHost: 'typescript/languageServiceHost', | ||
textDocument: 'typescript/textDocument', | ||
}; | ||
; | ||
exports.default = () => (contextOrNull, modules) => { | ||
@@ -156,4 +148,4 @@ const jsDocTriggerCharacter = '*'; | ||
provide: { | ||
...(0, language_service_1.defineProvide)(exports.injectionKeys.typescript, () => ts), | ||
...(0, language_service_1.defineProvide)(exports.injectionKeys.sourceFile, document => { | ||
'typescript/typescript': () => ts, | ||
'typescript/sourceFile': document => { | ||
if ((0, shared_1.isTsDocument)(document)) { | ||
@@ -167,4 +159,4 @@ const sourceFile = getSemanticServiceSourceFile(document.uri); | ||
} | ||
}), | ||
...(0, language_service_1.defineProvide)(exports.injectionKeys.languageService, document => { | ||
}, | ||
'typescript/languageService': document => { | ||
const sourceFile = getSemanticServiceSourceFile(document.uri); | ||
@@ -176,4 +168,4 @@ if (sourceFile) { | ||
return syntacticCtx.typescript.languageService; | ||
}), | ||
...(0, language_service_1.defineProvide)(exports.injectionKeys.languageServiceHost, document => { | ||
}, | ||
'typescript/languageServiceHost': document => { | ||
const sourceFile = getSemanticServiceSourceFile(document.uri); | ||
@@ -185,4 +177,4 @@ if (sourceFile) { | ||
return syntacticCtx.typescript.languageServiceHost; | ||
}), | ||
...(0, language_service_1.defineProvide)(exports.injectionKeys.textDocument, semanticCtx.getTextDocument), | ||
}, | ||
'typescript/textDocument': semanticCtx.getTextDocument, | ||
}, | ||
@@ -189,0 +181,0 @@ ...triggerCharacters, |
@@ -1,2 +0,2 @@ | ||
import * as vscode from '@volar/language-service'; | ||
import * as vscode from 'vscode-languageserver-protocol'; | ||
import { SharedContext } from '../types'; | ||
@@ -3,0 +3,0 @@ export declare function register(ctx: SharedContext): { |
@@ -29,3 +29,3 @@ "use strict"; | ||
const minimatch_1 = require("minimatch"); | ||
const vscode = __importStar(require("@volar/language-service")); | ||
const vscode = __importStar(require("vscode-languageserver-protocol")); | ||
const vscode_uri_1 = require("vscode-uri"); | ||
@@ -32,0 +32,0 @@ function mapChildren(node, f) { |
@@ -1,2 +0,2 @@ | ||
import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
import type { TextDocument } from 'vscode-languageserver-textdocument'; | ||
export declare function getConfigTitle(document: TextDocument): string; | ||
@@ -3,0 +3,0 @@ export declare function isTsDocument(document: TextDocument): boolean; |
@@ -1,2 +0,2 @@ | ||
import { ServiceContext } from "@volar/language-service"; | ||
import type { ServiceContext } from '@volar/language-service'; | ||
export type SharedContext = ServiceContext & { | ||
@@ -3,0 +3,0 @@ typescript: NonNullable<ServiceContext['typescript']>; |
{ | ||
"name": "volar-service-typescript", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "out/index.js", | ||
@@ -27,6 +27,3 @@ "license": "MIT", | ||
}, | ||
"peerDependencies": { | ||
"@volar/language-service": "*" | ||
}, | ||
"gitHead": "19482084693c7349f461dc75ec52ee6917739c51" | ||
"gitHead": "28896539331e31b4ef1064b6839ea0924d5d28d0" | ||
} |
7
190019
3959