diff --git a/template/v1/dirs/etc/jupyter/jupyter_server_config.py b/template/v1/dirs/etc/jupyter/jupyter_server_config.py index 8e45762f..b6332c11 100644 --- a/template/v1/dirs/etc/jupyter/jupyter_server_config.py +++ b/template/v1/dirs/etc/jupyter/jupyter_server_config.py @@ -14,3 +14,16 @@ # Enable `allow_hidden` by default, so hidden files are accessible via Jupyter server # Related documentation: https://jupyterlab.readthedocs.io/en/stable/user/files.html#displaying-hidden-files c.ContentsManager.allow_hidden = True + +# This will set the LanguageServerManager.extra_node_roots setting if amazon_sagemaker_sql_editor exists in the +# environment. Ignore otherwise, don't fail the JL server start +# Related documentation: https://jupyterlab-lsp.readthedocs.io/en/v3.4.0/Configuring.html +try: + import os + module = __import__("amazon_sagemaker_sql_editor") + module_location = os.path.dirname(module.__file__) + c.LanguageServerManager.extra_node_roots = [ + f'{module_location}/sql-language-server' + ] +except: + pass