File tree Expand file tree Collapse file tree
packages/salesforcedx-lwc-language-server/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,17 +488,17 @@ export abstract class BaseServer {
488488 }
489489 }
490490
491- public onShutdown ( ) : void {
491+ public async onShutdown ( ) : Promise < void > {
492492 // Persist custom components for faster startup on next session
493493 if ( this . componentIndexer ) {
494- this . componentIndexer . persistCustomComponents ( ) ;
494+ await this . componentIndexer . persistCustomComponents ( ) ;
495495 }
496496 }
497497
498- public onExit ( ) : void {
498+ public async onExit ( ) : Promise < void > {
499499 // Persist custom components for faster startup on next session
500500 if ( this . componentIndexer ) {
501- this . componentIndexer . persistCustomComponents ( ) ;
501+ await this . componentIndexer . persistCustomComponents ( ) ;
502502 }
503503 }
504504
Original file line number Diff line number Diff line change @@ -245,11 +245,14 @@ export default class ComponentIndexer {
245245 }
246246 }
247247
248- public persistCustomComponents ( ) : void {
248+ public async persistCustomComponents ( ) : Promise < void > {
249249 const indexJsonString = JSON . stringify ( this . getCustomData ( ) ) ;
250250
251251 // Store the component index data for the client to process
252- void this . fileSystemAccessor . updateFileContent ( 'lwc:componentIndex' , indexJsonString ) ;
252+ await this . fileSystemAccessor . updateFileContent (
253+ path . join ( this . workspaceRoot , CUSTOM_COMPONENT_INDEX_FILE ) ,
254+ indexJsonString
255+ ) ;
253256 }
254257
255258 public async insertSfdxTsConfigPath ( filePaths : string [ ] ) : Promise < void > {
@@ -400,6 +403,6 @@ export default class ComponentIndexer {
400403
401404 ( await this . getStaleTags ( ) ) . forEach ( tag => this . tags . delete ( getTagName ( tag ) ) ) ;
402405
403- this . persistCustomComponents ( ) ;
406+ await this . persistCustomComponents ( ) ;
404407 }
405408}
You can’t perform that action at this time.
0 commit comments