22import * as vscode from 'vscode'
33import { defaultJsSupersetLangs } from '@zardoy/vscode-utils/build/langs'
44import { getActiveRegularEditor } from '@zardoy/vscode-utils'
5- import { extensionCtx , getExtensionSettingId , getExtensionCommandId , registerActiveDevelopmentCommand } from 'vscode-framework'
5+ import { extensionCtx , getExtensionSettingId } from 'vscode-framework'
66import { pickObj } from '@zardoy/utils'
7- import { TriggerCharacterCommand } from '../typescript/src/ipcTypes'
87import { Configuration } from './configurationType'
98import webImports from './webImports'
109import { sendCommand } from './sendCommand'
1110import { registerEmmet } from './emmet'
1211import experimentalPostfixes from './experimentalPostfixes'
12+ import migrateSettings from './migrateSettings'
13+ import figIntegration from './figIntegration'
14+ import apiCommands from './apiCommands'
1315
1416export const activateTsPlugin = ( tsApi : { configurePlugin ; onCompletionAccepted } ) => {
1517 let webWaitingForConfigSync = false
@@ -77,23 +79,6 @@ export const activateTsPlugin = (tsApi: { configurePlugin; onCompletionAccepted
7779 }
7880 } )
7981
80- const sharedRequest = ( type : TriggerCharacterCommand , { offset, relativeOffset = 0 } : RequestOptions ) => {
81- const { activeTextEditor } = vscode . window
82- if ( ! activeTextEditor ) return
83- const { document, selection } = activeTextEditor
84- offset ??= document . offsetAt ( selection . active ) + relativeOffset
85- return sendCommand ( type , { document, position : document . positionAt ( offset ) } )
86- }
87-
88- type RequestOptions = Partial < {
89- offset : number
90- relativeOffset : number
91- } >
92- vscode . commands . registerCommand ( getExtensionCommandId ( 'getNodeAtPosition' as never ) , async ( options : RequestOptions = { } ) =>
93- sharedRequest ( 'nodeAtPosition' , options ) ,
94- )
95- vscode . commands . registerCommand ( getExtensionCommandId ( 'getNodePath' as never ) , async ( options : RequestOptions = { } ) => sharedRequest ( 'nodePath' , options ) )
96-
9782 if ( process . env . PLATFORM === 'web' ) {
9883 const possiblySyncConfig = async ( ) => {
9984 const { activeTextEditor } = vscode . window
@@ -111,16 +96,14 @@ export const activateTsPlugin = (tsApi: { configurePlugin; onCompletionAccepted
11196 experimentalPostfixes ( )
11297 void registerEmmet ( )
11398 webImports ( )
99+ apiCommands ( )
114100
115- // registerActiveDevelopmentCommand(async () => {
116- // const items: vscode.DocumentSymbol[] = await vscode.commands.executeCommand(
117- // 'vscode.executeDocumentSymbolProvider',
118- // vscode.Uri.file(...),
119- // )
120- // })
101+ figIntegration ( )
121102}
122103
123104export const activate = async ( ) => {
105+ migrateSettings ( )
106+
124107 const possiblyActivateTsPlugin = async ( ) => {
125108 const tsExtension = vscode . extensions . getExtension ( 'vscode.typescript-language-features' )
126109 if ( ! tsExtension ) return
0 commit comments