File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed
packages/typescript-plugin/src Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 11import { basename , dirname , extname } from 'path' ;
2- import ts from 'typescript/lib/tsserverlibrary ' ;
2+ import type ts from 'typescript' ;
33import { Logger } from '../logger' ;
44import { isSvelteFilePath , replaceDeep } from '../utils' ;
55
6+ type _ts = typeof ts ;
7+
68const componentPostfix = '__SvelteComponent_' ;
79
8- export function decorateCompletions ( ls : ts . LanguageService , logger : Logger ) : void {
10+ export function decorateCompletions ( ls : ts . LanguageService , ts : _ts , logger : Logger ) : void {
911 const getCompletionsAtPosition = ls . getCompletionsAtPosition ;
1012 ls . getCompletionsAtPosition = ( fileName , position , options ) => {
1113 const completions = getCompletionsAtPosition ( fileName , position , options ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ function decorateLanguageServiceInner(
4242 decorateRename ( ls , snapshotManager , logger ) ;
4343 decorateDiagnostics ( ls , logger ) ;
4444 decorateFindReferences ( ls , snapshotManager , logger ) ;
45- decorateCompletions ( ls , logger ) ;
45+ decorateCompletions ( ls , typescript , logger ) ;
4646 decorateGetDefinition ( ls , snapshotManager , logger ) ;
4747 decorateGetImplementation ( ls , snapshotManager , logger ) ;
4848 decorateUpdateImports ( ls , snapshotManager , logger ) ;
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export function patchModuleLoader(
102102 project : ts . server . Project ,
103103 configManager : ConfigManager
104104) : void {
105- const svelteSys = createSvelteSys ( logger ) ;
105+ const svelteSys = createSvelteSys ( typescript , logger ) ;
106106 const moduleCache = new ModuleResolutionCache ( project . projectService ) ;
107107 const origResolveModuleNames = lsHost . resolveModuleNames ?. bind ( lsHost ) ;
108108 const origResolveModuleNamLiterals = lsHost . resolveModuleNameLiterals ?. bind ( lsHost ) ;
Original file line number Diff line number Diff line change 1- import ts from 'typescript' ;
1+ import type ts from 'typescript' ;
22import { Logger } from './logger' ;
33import { ensureRealSvelteFilePath , isVirtualSvelteFilePath , toRealSvelteFilePath } from './utils' ;
44
5+ type _ts = typeof ts ;
6+
57/**
68 * This should only be accessed by TS svelte module resolution.
79 */
8- export function createSvelteSys ( logger : Logger ) {
10+ export function createSvelteSys ( ts : _ts , logger : Logger ) {
911 const svelteSys : ts . System = {
1012 ...ts . sys ,
1113 fileExists ( path : string ) {
You can’t perform that action at this time.
0 commit comments