@@ -26,7 +26,7 @@ const axios = require('axios');
2626
2727export const puppetLangID = 'puppet' ; // don't change this
2828export const puppetFileLangID = 'puppetfile' ; // don't change this
29- const debugType = 'Puppet' ; // don't change this
29+ const debugType = 'Puppet' ; // don't change this
3030
3131let extContext : vscode . ExtensionContext ;
3232let connectionHandler : ConnectionHandler ;
@@ -48,13 +48,15 @@ export function activate(context: vscode.ExtensionContext) {
4848 configSettings = CreateAggregrateConfiguration ( settings ) ;
4949 logger = new OutputChannelLogger ( configSettings . workspace . editorService . loglevel ) ;
5050 if ( configSettings . workspace . installType !== previousInstallType ) {
51- logger . debug ( `Installation type has changed from ${ previousInstallType } to ${ configSettings . workspace . installType } ` ) ;
51+ logger . debug (
52+ `Installation type has changed from ${ previousInstallType } to ${ configSettings . workspace . installType } `
53+ ) ;
5254 }
5355
5456 reporter . sendTelemetryEvent ( 'config' , {
55- ' installType' : configSettings . workspace . installType ,
56- ' protocol' : configSettings . workspace . editorService . protocol ,
57- ' pdkVersion' : configSettings . ruby . pdkVersion
57+ installType : configSettings . workspace . installType ,
58+ protocol : configSettings . workspace . editorService . protocol ,
59+ pdkVersion : configSettings . ruby . pdkVersion
5860 } ) ;
5961
6062 const statusBar = new PuppetStatusBarFeature ( [ puppetLangID , puppetFileLangID ] , configSettings , logger , context ) ;
@@ -66,24 +68,23 @@ export function activate(context: vscode.ExtensionContext) {
6668 statusBar
6769 ] ;
6870
69- if ( configSettings . workspace . editorService . enable === false ) {
71+ if ( configSettings . workspace . editorService . enable === false ) {
7072 notifyEditorServiceDisabled ( extContext ) ;
7173 reporter . sendTelemetryEvent ( 'editorServiceDisabled' ) ;
7274 return ;
7375 }
7476
75-
76- if ( checkInstallDirectory ( configSettings , logger ) === false ) {
77+ if ( checkInstallDirectory ( configSettings , logger ) === false ) {
7778 // If this returns false, then we needed a local directory
7879 // but did not find it, so we should abort here
7980 // If we return true, we can continue
8081 // This can be revisited to enable disabling language server portion
8182 return ;
8283 }
83-
84+
8485 // this happens after checkInstallDirectory so that we don't check pdk version
8586 // if it's not installed
86- if ( settings . pdk . checkVersion ) {
87+ if ( settings . pdk . checkVersion ) {
8788 notifyIfNewPDKVersion ( extContext , configSettings ) ;
8889 }
8990
@@ -96,12 +97,14 @@ export function activate(context: vscode.ExtensionContext) {
9697 break ;
9798 }
9899
99- extensionFeatures . push ( new FormatDocumentFeature ( puppetLangID , connectionHandler , configSettings , logger , extContext ) ) ;
100+ extensionFeatures . push (
101+ new FormatDocumentFeature ( puppetLangID , connectionHandler , configSettings , logger , extContext )
102+ ) ;
100103 extensionFeatures . push ( new PuppetNodeGraphFeature ( puppetLangID , connectionHandler , logger , extContext ) ) ;
101104 extensionFeatures . push ( new PuppetResourceFeature ( extContext , connectionHandler , logger ) ) ;
102105 extensionFeatures . push ( new DebuggingFeature ( debugType , configSettings , extContext , logger ) ) ;
103-
104- if ( settings . hover . showMetadataInfo ) {
106+
107+ if ( settings . hover . showMetadataInfo ) {
105108 extensionFeatures . push ( new PuppetModuleHoverFeature ( extContext , logger ) ) ;
106109 }
107110}
@@ -135,7 +138,7 @@ function checkForLegacySettings() {
135138 }
136139}
137140
138- function checkInstallDirectory ( config : IAggregateConfiguration , logger : ILogger ) : boolean {
141+ function checkInstallDirectory ( config : IAggregateConfiguration , logger : ILogger ) : boolean {
139142 if ( config . workspace . editorService . protocol === ProtocolType . TCP ) {
140143 if ( config . connection . type === ConnectionType . Remote ) {
141144 // Return if we are connecting to a remote TCP LangServer
@@ -151,13 +154,11 @@ function checkInstallDirectory(config: IAggregateConfiguration, logger: ILogger)
151154 if ( SettingsFromWorkspace ( ) . installType === PuppetInstallType . AUTO ) {
152155 let m = [
153156 'The extension failed to find a Puppet installation automatically in the default locations for PDK and for Puppet Agent.' ,
154- 'While syntax highlighting and grammar detection will still work, intellisense and other advanced features will not.' ,
157+ 'While syntax highlighting and grammar detection will still work, intellisense and other advanced features will not.'
155158 ] ;
156159 message = m . join ( ' ' ) ;
157- } else {
158- message = `Could not find a valid Puppet installation at '${
159- config . ruby . puppetBaseDir
160- } '. While syntax highlighting and grammar detection will still work, intellisense and other advanced features will not.`;
160+ } else {
161+ message = `Could not find a valid Puppet installation at '${ config . ruby . puppetBaseDir } '. While syntax highlighting and grammar detection will still work, intellisense and other advanced features will not.` ;
161162 }
162163
163164 showErrorMessage (
@@ -186,7 +187,7 @@ function showErrorMessage(message: string, title: string, helpLink: string, logg
186187}
187188
188189async function notifyOnNewExtensionVersion ( context : vscode . ExtensionContext ) {
189- const puppetExtension = vscode . extensions . getExtension ( 'jpogran .puppet-vscode' ) ! ;
190+ const puppetExtension = vscode . extensions . getExtension ( 'puppet .puppet-vscode' ) ! ;
190191 const version = puppetExtension . packageJSON . version ;
191192
192193 const viewReleaseNotes = 'View Release Notes' ;
@@ -211,7 +212,7 @@ async function notifyOnNewExtensionVersion(context: vscode.ExtensionContext) {
211212 if ( result . title === viewReleaseNotes ) {
212213 vscode . commands . executeCommand (
213214 'vscode.open' ,
214- vscode . Uri . parse ( 'https://marketplace.visualstudio.com/items/jpogran .puppet-vscode/changelog' )
215+ vscode . Uri . parse ( 'https://marketplace.visualstudio.com/items/puppet .puppet-vscode/changelog' )
215216 ) ;
216217 } else {
217218 context . globalState . update ( suppressUpdateNotice , true ) ;
@@ -241,31 +242,32 @@ async function notifyEditorServiceDisabled(context: vscode.ExtensionContext) {
241242 }
242243}
243244
244- async function notifyIfNewPDKVersion ( context : vscode . ExtensionContext , settings :IAggregateConfiguration ) {
245+ async function notifyIfNewPDKVersion ( context : vscode . ExtensionContext , settings : IAggregateConfiguration ) {
245246 const suppressPDKUpdateCheck = 'suppressPDKUpdateCheck' ;
246247 const dontCheckAgainNotice = "Don't check again" ;
247- const viewPDKDownloadPage = " More info" ;
248+ const viewPDKDownloadPage = ' More info' ;
248249
249250 if ( context . globalState . get ( suppressPDKUpdateCheck , false ) ) {
250251 return ;
251252 }
252253
253254 let version = '' ;
254- if ( settings . ruby . pdkVersion ) {
255+ if ( settings . ruby . pdkVersion ) {
255256 version = settings . ruby . pdkVersion ;
256- } else {
257+ } else {
257258 // should we throw a warning here? technically this is only reached *if* a
258259 // PDK install is found, so the only way this is null is if the PDK_VERSION
259260 // file was removed.
260261 return ;
261262 }
262263
263- axios . get ( 'https://s3.amazonaws.com/puppet-pdk/pdk/LATEST' )
264+ axios
265+ . get ( 'https://s3.amazonaws.com/puppet-pdk/pdk/LATEST' )
264266 . then ( response => {
265267 return response . data ;
266268 } )
267269 . then ( latest_version => {
268- if ( version !== latest_version ) {
270+ if ( version !== latest_version ) {
269271 return vscode . window . showWarningMessage (
270272 `The installed PDK version is ${ version } , the newest version is ${ latest_version } . To find out how to update to the latest version click the more info button` ,
271273 { modal : false } ,
@@ -274,11 +276,11 @@ async function notifyIfNewPDKVersion(context: vscode.ExtensionContext, settings:
274276 ) ;
275277 }
276278 } )
277- . then ( result => {
279+ . then ( result => {
278280 if ( result === undefined ) {
279281 return ;
280282 }
281-
283+
282284 if ( result . title === dontCheckAgainNotice ) {
283285 context . globalState . update ( suppressPDKUpdateCheck , true ) ;
284286 }
@@ -308,25 +310,25 @@ function setLanguageConfiguration() {
308310 }
309311 ] ,
310312 brackets : [
311- [ "{" , "}" ] ,
312- [ "[" , "]" ] ,
313- [ "(" , ")" ]
313+ [ '{' , '}' ] ,
314+ [ '[' , ']' ] ,
315+ [ '(' , ')' ]
314316 ] ,
315317 comments : {
316- lineComment : "#" ,
317- blockComment : [ "/*" , "*/" ]
318+ lineComment : '#' ,
319+ blockComment : [ '/*' , '*/' ]
318320 }
319321 } ) ;
320322 vscode . languages . setLanguageConfiguration ( puppetFileLangID , {
321323 onEnterRules : [ ] ,
322324 brackets : [
323- [ "{" , "}" ] ,
324- [ "[" , "]" ] ,
325- [ "(" , ")" ]
325+ [ '{' , '}' ] ,
326+ [ '[' , ']' ] ,
327+ [ '(' , ')' ]
326328 ] ,
327329 comments : {
328- lineComment : "#" ,
329- blockComment : [ "/*" , "*/" ]
330+ lineComment : '#' ,
331+ blockComment : [ '/*' , '*/' ]
330332 }
331333 } ) ;
332334}
0 commit comments