@@ -15,6 +15,12 @@ const TAG = "v0.3.7";
1515const URL =
1616 "https://github.com/errata-ai/vale-ls/releases/download/{tag}/vale-ls-{arch}-{platform}.zip" ;
1717
18+ type valeConfigOptions = "configPath" | "syncOnStartup" | "filter" | "installVale" ;
19+
20+ interface valeArgs {
21+ value : string ;
22+ }
23+
1824export function getArch ( ) : String {
1925 if ( process . arch == "x64" ) return "x86_64" ;
2026 if ( process . arch == "arm64" ) return "aaarch64" ;
@@ -31,28 +37,37 @@ export function activate(context: ExtensionContext) {
3137 // Not possible when using `command`?
3238 // let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] };
3339 const valePath = context . extensionPath + "/tmp-bin/vale-ls" ;
34- let valeArgs : any = new Object ( ) ;
40+ // let valeArgs: any = new Object();
3541
3642 // TODO: Factor in https://vale.sh/docs/integrations/guide/#vale-ls
3743 // Has the user defined a config file manually?
38- const configuration = vscode . workspace . getConfiguration ( ) ;
39- let customConfigPath = configuration . get < string > ( "vale.valeCLI.config" ) ;
40- if ( customConfigPath ) {
41- console . log ( "Using config: " + customConfigPath ) ;
44+ const configuration = vscode . workspace . getConfiguration ( ) ;
45+ // let customConfigPath = configuration.get<string>("vale.valeCLI.config");
46+ // if (customConfigPath) {
47+ // console.log("Using config: " + customConfigPath);
4248
43- valeArgs = { configPath : customConfigPath } ;
44- }
45- console . log ( valeArgs )
49+ // valeArgs = {configPath: customConfigPath};
50+ // }
51+ // console.log(valeArgs)
4652 console . log ( "Using binary: " + valePath ) ;
47-
53+ let valeConfig : Record < valeConfigOptions , valeArgs > = {
54+ configPath : configuration . get ( "vale.valeCLI.configPath" ) as valeArgs ,
55+ syncOnStartup : configuration . get ( "vale.valeCLI.syncOnStartup" ) as valeArgs ,
56+ filter : configuration . get ( "vale.valeCLI.filter" ) as valeArgs ,
57+ installVale : configuration . get ( "vale.valeCLI.installVale" ) as valeArgs ,
58+ }
59+ console . log ( valeConfig )
60+ // TODO: So do I need the below?
61+ let tempArgs : never [ ] = [ ] ;
4862 let serverOptions : ServerOptions = {
49- run : { command : valePath , args : valeArgs } ,
50- debug : { command : valePath , args : valeArgs } ,
63+ run : { command : valePath , args : tempArgs } ,
64+ debug : { command : valePath , args : tempArgs } ,
5165 } ;
5266
5367 // Options to control the language client
5468 let clientOptions : LanguageClientOptions = {
5569 // TODO: Refine
70+ initializationOptions : valeConfig ,
5671 documentSelector : [ { scheme : "file" , language : "*" } ] ,
5772 synchronize : {
5873 fileEvents : workspace . createFileSystemWatcher ( "**/.clientrc" ) ,
0 commit comments