Skip to content

Commit a4a4f0a

Browse files
committed
another try to fix completions crash
1 parent ed2810e commit a4a4f0a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/extension.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@ export const activate = async () => {
2121
if (affectsConfiguration(process.env.IDS_PREFIX!)) syncConfig()
2222
})
2323
syncConfig()
24-
setTimeout(() => syncConfig(), 500)
25-
setTimeout(() => syncConfig(), 1500)
2624
}

typescript/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import _ from 'lodash'
77
import { GetConfig } from './types'
88
import { getCompletionsAtPosition, PrevCompletionMap } from './completionsAtPosition'
99

10+
const thisPluginMarker = Symbol('__essentialPluginsMarker__')
11+
12+
// just to see wether issue is resolved
13+
let _configuration: Configuration
14+
const c: GetConfig = key => get(_configuration, key)
1015
export = function ({ typescript }: { typescript: typeof import('typescript/lib/tsserverlibrary') }) {
1116
const ts = typescript
12-
let _configuration: Configuration
13-
const c: GetConfig = key => get(_configuration, key)
1417

1518
return {
1619
create(info: ts.server.PluginCreateInfo) {
20+
if (info.languageService[thisPluginMarker]) return info.languageService
1721
// const realGetSnapshot = info.languageServiceHost.getScriptSnapshot
1822
// info.languageServiceHost.getScriptSnapshot = fileName => {
1923
// console.log('getSnapshot', fileName)
@@ -136,6 +140,8 @@ export = function ({ typescript }: { typescript: typeof import('typescript/lib/t
136140
return prior
137141
}
138142

143+
info.languageService[thisPluginMarker] = true
144+
139145
return proxy
140146
},
141147
onConfigurationChanged(config: any) {

0 commit comments

Comments
 (0)