@@ -148,14 +148,19 @@ export function deactivate() {}
148148
149149function toggleBazelProjectSyncStatus ( doc : TextDocument ) {
150150 if ( workspace . getConfiguration ( 'bazel.projectview' ) . get ( 'notification' ) ) {
151+
152+ // check
153+ const options = ( getJavaExtension ( ) ) ? [ 'Sync View' , 'Sync Java' , 'Do Nothing' ] : [ 'Sync View' , 'Do Nothing' ] ;
154+
151155 window
152156 . showWarningMessage (
153- `The Bazel Project View changed. Do you want to synchronize?` ,
154- ...[ 'Sync' , 'Do Nothing' ]
157+ `The Bazel Project View changed. Do you want to synchronize?` , ...options
155158 )
156159 . then ( ( val ) => {
157- if ( val === 'Sync' ) {
160+ if ( val === 'Sync View ' ) {
158161 syncProjectView ( ) ;
162+ } else if ( val === 'Sync Java' ) {
163+ syncJava ( ) ;
159164 } else if ( val === 'Do Nothing' ) {
160165 workspace
161166 . getConfiguration ( 'bazel.projectview' )
@@ -185,12 +190,19 @@ function openBazelProjectFile() {
185190function syncProjectView ( ) {
186191 outputLog . info ( 'syncing project' ) ;
187192 ProjectViewManager . updateProjectView ( ) ;
193+ }
188194
189- // if bazel-vscode-java extension exists, execute it's sync method
190- const bazelJavaExtension = extensions . getExtension < BazelExtensionPlugin > ( 'sfdc.bazel-vscode-java' )
191- if ( bazelJavaExtension ) {
195+ function getJavaExtension ( ) {
196+ return extensions . getExtension < BazelExtensionPlugin > ( 'sfdc-eng.bazel-java' ) ;
197+ }
198+
199+ /**
200+ * Run sync against the eclipse LS
201+ */
202+ function syncJava ( ) {
203+ const bazelJavaExtension = getJavaExtension ( ) ;
204+ if ( bazelJavaExtension ) {
192205 outputLog . info ( 'syncing java project' )
193- bazelJavaExtension . exports . sync ( )
206+ bazelJavaExtension . exports . sync ( ) ;
194207 }
195-
196208}
0 commit comments