@@ -55,6 +55,7 @@ pub mod launch;
5555pub mod library_settings;
5656pub mod managed_runtimes;
5757pub mod module_structure;
58+ pub mod navigation;
5859pub mod plugin_functions;
5960pub mod project_model;
6061pub mod project_settings;
@@ -103,6 +104,7 @@ pub const KEY_OPERATIONS: &[&str] = &[
103104 "execution.planLaunchCommand" ,
104105 "java.prepareLaunch" ,
105106 LAUNCH_FUNCTION_ID ,
107+ navigation:: INVOKE_FUNCTION_ID ,
106108 RERUN_FUNCTION_ID ,
107109 RUN_ACTION_FUNCTION_ID ,
108110 SETTINGS_CHANGED_FUNCTION_ID ,
@@ -148,9 +150,14 @@ pub fn backend() -> Result<Backend, SdkError> {
148150 } ) ?;
149151 backend. suppress_success_diagnostics ( class_content:: CONTENT_FUNCTION ) ?;
150152 let run_session = Arc :: new ( RunSession :: new ( backend. handle ( ) , Arc :: clone ( & session) ) ) ;
153+ let nav_session = Arc :: new ( navigation:: NavigationSession :: new (
154+ backend. handle ( ) ,
155+ Arc :: clone ( & session) ,
156+ ) ) ;
151157 let handle = backend. handle ( ) ;
152158 backend. on_host_notification ( LANGUAGE_SERVER_STATE_NOTIFICATION , {
153159 let run_session = Arc :: clone ( & run_session) ;
160+ let nav_session = Arc :: clone ( & nav_session) ;
154161 let session = Arc :: clone ( & session) ;
155162 let content_session = Arc :: clone ( & content_session) ;
156163 move |params| {
@@ -164,6 +171,7 @@ pub fn backend() -> Result<Backend, SdkError> {
164171 session. did_change_state ( & params, & report) ;
165172 content_session. sync_reporting ( & session, & report) ;
166173 run_session. sync_contexts_reporting ( & report) ;
174+ nav_session. sync_contexts_reporting ( & report) ;
167175 Ok ( ( ) )
168176 }
169177 } ) ?;
@@ -212,20 +220,24 @@ pub fn backend() -> Result<Backend, SdkError> {
212220 } ;
213221 backend. on_initialize ( {
214222 let run_session = Arc :: clone ( & run_session) ;
223+ let nav_session = Arc :: clone ( & nav_session) ;
215224 let report = Arc :: clone ( & report) ;
216225 move |_initialize| {
217226 run_session. sync_after_initialize ( Arc :: clone ( & report) ) ;
227+ nav_session. sync_after_initialize ( Arc :: clone ( & report) ) ;
218228 Ok ( ( ) )
219229 }
220230 } ) ;
221231 backend. on_contexts_changed ( {
222232 let run_session = Arc :: clone ( & run_session) ;
233+ let nav_session = Arc :: clone ( & nav_session) ;
223234 let report = Arc :: clone ( & report) ;
224235 let content_session = Arc :: clone ( & content_session) ;
225236 let session = Arc :: clone ( & session) ;
226237 move |_params| {
227238 content_session. sync_reporting ( & session, & * report) ;
228239 run_session. sync_contexts_reporting ( & * report) ;
240+ nav_session. sync_contexts_reporting ( & * report) ;
229241 Ok ( ( ) )
230242 }
231243 } ) ;
@@ -238,9 +250,11 @@ pub fn backend() -> Result<Backend, SdkError> {
238250 } ) ?;
239251 backend. on_host_notification ( LANGUAGE_SERVER_NOTIFICATION , {
240252 let run_session = Arc :: clone ( & run_session) ;
253+ let nav_session = Arc :: clone ( & nav_session) ;
241254 let report = Arc :: clone ( & report) ;
242255 move |params| {
243256 run_session. did_receive_notification ( & params, & * report) ;
257+ nav_session. did_receive_notification ( & params, & * report) ;
244258 Ok ( ( ) )
245259 }
246260 } ) ?;
@@ -249,6 +263,15 @@ pub fn backend() -> Result<Backend, SdkError> {
249263 move |params, context| run:: collect_actions_function ( & run_session, params, context)
250264 } ) ?;
251265 backend. suppress_success_diagnostics ( COLLECT_FUNCTION_ID ) ?;
266+ backend. function ( navigation:: COLLECT_FUNCTION_ID , {
267+ let nav_session = Arc :: clone ( & nav_session) ;
268+ move |params, context| navigation:: collect_actions_function ( & nav_session, params, context)
269+ } ) ?;
270+ backend. suppress_success_diagnostics ( navigation:: COLLECT_FUNCTION_ID ) ?;
271+ backend. function ( navigation:: INVOKE_FUNCTION_ID , {
272+ let nav_session = Arc :: clone ( & nav_session) ;
273+ move |params, context| navigation:: invoke_action_function ( & nav_session, params, context)
274+ } ) ?;
252275 backend. function ( RUN_ACTION_FUNCTION_ID , {
253276 let run_session = Arc :: clone ( & run_session) ;
254277 move |params, context| run:: run_action_function ( & run_session, params, context)
@@ -446,6 +469,8 @@ mod tests {
446469 . chain ( managed_runtimes:: ERROR_CODES )
447470 . chain ( run:: RUN_ERROR_CODES )
448471 . chain ( run:: RUN_CATEGORIES )
472+ . chain ( navigation:: NAV_ERROR_CODES )
473+ . chain ( navigation:: NAV_CATEGORIES )
449474 . chain ( settings_view:: VIEW_ERROR_CODES )
450475 . chain ( settings_view:: VIEW_CATEGORIES )
451476 {
@@ -478,6 +503,8 @@ mod tests {
478503 COLLECT_FUNCTION_ID ,
479504 RUN_ACTION_FUNCTION_ID ,
480505 RERUN_FUNCTION_ID ,
506+ navigation:: COLLECT_FUNCTION_ID ,
507+ navigation:: INVOKE_FUNCTION_ID ,
481508 ] )
482509 . collect ( ) ;
483510 let distinct: std:: collections:: BTreeSet < & str > = KEY_OPERATIONS . iter ( ) . copied ( ) . collect ( ) ;
0 commit comments