11"use strict" ;
22
3- import * as fs from "fs" ;
4- import * as path from "path" ;
53import { commands , DiagnosticCollection , ExtensionContext , Uri , window , workspace } from "vscode" ;
64import { absolutePath } from "./helpers/AbsolutePath" ;
75import * as tools from "./toolchain/SwiftTools" ;
8- import * as config from "./vscode/config-helpers" ;
96import lsp from "./vscode/lsp-interop" ;
107import output from "./vscode/output-channels" ;
11- import { statusBarItem } from "./vscode/status-bar" ;
128
139let swiftBinPath : string | null = null ;
1410let swiftBuildParams : string [ ] = [ "build" ] ;
15- let skProtocolProcess : string | null = null ;
16- let skProtocolProcessAsShellCmd : string | null = null ;
1711export let diagnosticCollection : DiagnosticCollection ;
1812
1913let mostRecentRunTarget = "" ;
@@ -28,7 +22,7 @@ export async function activate(context: ExtensionContext) {
2822 tools . setRunning ( false ) ;
2923 output . build . log ( "Activating SDE" ) ;
3024
31- await initConfig ( ) ;
25+ initConfig ( ) ;
3226 await lsp . startLSPClient ( context ) ;
3327
3428 //commands
@@ -90,46 +84,9 @@ export async function activate(context: ExtensionContext) {
9084 toolchain . build ( ) ;
9185}
9286
93- async function initConfig ( ) {
94- checkToolsAvailability ( ) ;
95- }
96-
97- async function checkToolsAvailability ( ) {
87+ function initConfig ( ) {
9888 swiftBinPath = absolutePath ( workspace . getConfiguration ( ) . get ( "swift.path.swift_driver_bin" ) ) ;
9989 swiftBuildParams = < string [ ] > workspace . getConfiguration ( ) . get ( "sde.swiftBuildingParams" ) || [
10090 "build" ,
10191 ] ;
102- const sourcekitePath = absolutePath ( workspace . getConfiguration ( ) . get ( "swift.path.sourcekite" ) ) ;
103- const sourcekitePathEnableShCmd = workspace
104- . getConfiguration ( )
105- . get < string > ( "swift.path.sourcekiteDockerMode" ) ;
106- const shellPath = absolutePath ( workspace . getConfiguration ( ) . get ( "swift.path.shell" ) ) ;
107- skProtocolProcess = sourcekitePath ;
108- skProtocolProcessAsShellCmd = sourcekitePathEnableShCmd ;
109-
110- // if (!swiftBinPath || !fs.existsSync(swiftBinPath)) {
111- // window.showErrorMessage(
112- // 'missing dependent `swift` tool, please configure correct "swift.path.swift_driver_bin"'
113- // );
114- // }
115- // if (!sourcekitePathEnableShCmd) {
116- // if (!skProtocolProcess || !fs.existsSync(skProtocolProcess)) {
117- // const action = await window.showErrorMessage(
118- // `\`sourcekite\` not found at \`${skProtocolProcess}\`.
119- // Install it and provide the path to \`swift.path.sourcekite\`.`,
120- // 'Retry', 'Help'
121- // );
122- // if (action === "Help") {
123- // await commands.executeCommand(
124- // "vscode.open",
125- // Uri.parse("https://github.com/vknabel/vscode-swift-development-environment/tree/2.11.1#using-sourcekite")
126- // );
127- // }
128- // }
129- // }
130- // if (!shellPath || !fs.existsSync(shellPath)) {
131- // window.showErrorMessage(
132- // 'missing dependent shell tool, please configure correct "swift.path.shell"'
133- // );
134- // }
13592}
0 commit comments