LSEG Extension for Visual Studio Code
A Visual Studio Code extension with rich support for the LSEG Analytics Python SDK, providing code automation features such as Intelligent Code Completion and Samples.
Introduction
The LSEG Visual Studio Code Extension is designed to assist coders working on financial applications. It offers a suite of predefined code templates tailored for various financial use cases and intelligent code completion features that help suggest parameter values, ensuring accuracy and efficiency in your financial coding tasks.
The extension provides support for the new LSEG Analytics APIs with coverage for Calendars and FX Forward workflows, with further asset classes covered in future iterations. In addition, it also provides support for the Yield Book REST API.
Features Overview
LSEG Analytics APIs
- Commands:
- Quickly access and execute LSEG Analytics functions from the command palette.
- Coding Assistance:
- Intelligent Code Completion:
- Enjoy real-time, context-aware code completions specifically for LSEG Analytics parameter values, reducing coding errors and boosting productivity.
- Code Samples:
- Access a library of pre-built code templates for common LSEG Analytics use cases, helping you get started quickly and efficiently.
- Seamless Authentication:
- Easily authenticate to the LSEG Analytics SDK from within Visual Studio Code, ensuring secure and hassle-free access.
Yield Book REST API
- Commands:
- Quickly access and execute LSEG Analytics functions from the command palette.
- Coding Assistance:
- Code Samples:
- Access a library of pre-build code templates for the Yield Book REST API use cases, helping you get started quickly and efficiently.
The support for Intelligent Code Completion and Seamless Authentication will be introduced in future iterations, following the integration of Yield Book into the LSEG Financial Analytics Python SDK.
Usage
Commands
To use commands, open the Command Palette (Command+Shift+P on macOS and Ctrl+Shift+P on Windows/Linux) and type in one of the following commands:
Command |
Description |
LSEG: Sign in |
Opens window for log in details to start using the extension features. |
LSEG: Sign out |
Logs user out |
LSEG: Refresh completion data for LSEG Financial Analytics |
Updates the cache of completion data which is used for parameter suggestions. |
To see all available LSEG Analytics commands, open the Command Palette and type LSEG.
Coding Assistance
Intelligent Code Completion
Dynamic parameter suggestions, based on the data available to the user. To use Intelligent Code Completion:
- 1.Place your cursor within a piece of code that requires a parameter
- 2.Trigger the parameter to see a list of possible values using one of the following methods
- a. Type the name of the parameter (hovering over the current function will tell you the name) followed by an equals sign (=)
- b. Run the Trigger Suggest command (
Ctrl
/Cmd
+ i
)
Samples
Samples provide templates of code for key analytics functionality. To use samples:
- Select the LSEG icon from the left hand side bar. After logging in, expand 'LSEG Financial Analytics' and select 'Code Samples'.
- Expand the sections to browse through the available samples.
- Open a sample as a python file or notebook.
- Modify it to tailor it to the task you're working on.
Seamless Authentication
The LSEG Visual Studio Code extension (“the extension”) makes it easier to write Python code that uses the LSEG Financial Analytics Python SDK (“the SDK”). However, you need to be authenticated to be able to execute your Python code that uses the SDK.
The SDK provides several authentication mechanisms (see the SDK documentation for more information). One of these is designed to provide a seamless authentication experience when using the extension: if you are logged in to the extension, you do not need to authenticate again to execute your Python code inside Visual Studio Code.
By default this is disabled, to enable it:
- Navigate to Settings → Extensions → LSEG: Analytics
- Select the box 'Enable Automatic Authentication'.
Seamless Authentication - implementation
When the setting is enabled, the extension starts a proxy web server that forwards calls from the SDK to the LSEG Financial Analytics backend APIs, adding the necessary authentication token.
The behaviour of the proxy web server is as follows:
- The proxy web server runs on http://127.0.0.1, so only the user and scripts/apps running locally can make requests to it.
- It will only forward SDK requests to the LFA backend; it will not forward requests to unknown endpoints.
- The extension has an output panel that shows the calls being forwarded to the LFA backend, so it is easy to see all the traffic handled by the proxy.
There is the possibility that other local scripts/apps could try to access the proxy web server and make requests using it. If this concerns you, you can disable the proxy and use one of the other SDK authentication mechanisms.
Privacy Statement
Please read the Privacy Statement governing the use of this extension.
License
See the LICENSE.txt file installed with the extension.
Compatibility
- LFA Python SDK Version v1.0.0b9+
- VS Code Desktop Version only
- VS Code v1.82 from August 2023
- Operating systems: Windows, OS X, Linux
Troubleshooting
If you encounter issues while using the LSEG Extension for Visual Studio Code, you can try the following self-help tips to resolve them.
Common Actions to Try
- Log out and log in again: Sometimes, re-authenticating can resolve issues.
- Run cache refresh: Use the
LSEG: Refresh completion data for LSEG Financial Analytics
command to update the cache of completion data.
- Restart VSCode: If issues persist, try completely restarting Visual Studio Code.
Log Output
Log output will generally come from one of two sources:
- The extension itself
- The LFA SDK (
lseg-analytics
)
The VSCode extension adds two output windows: LSEG Analytics and LSEG Analytics - LFA SDK Auth.
- LSEG Analytics: This contains general logging about the behavior of the extension itself, such as logging in, logging out, refreshing data, inserting samples, and providing code completion prompts.
- LSEG Analytics - LFA SDK Auth: This contains information about the calls the extension is forwarding to the LFA web backend on behalf of the LFA SDK.
How to Open the Output Windows
- Open Visual Studio Code.
- Go to the menu bar and select
View > Output
(or press Ctrl+Shift+U
).
- In the Output panel, use the dropdown menu to select the desired output channel (e.g., LSEG Analytics or LSEG Analytics - LFA SDK Auth).
How to Increase the Logging Level
There are two ways to increase the logging level:
Method A:
- Open Visual Studio Code.
- Go to the menu bar and select
View > Output
(or press Ctrl+Shift+U
).
- In the Output panel, click on the settings wheel (Set Log Level) and select the desired log level from the options: off, warning, info, debug, trace.
Method B:
- Open the Command Palette (
View > Command Palette
).
- Run the
Developer: Set Log Level...
command.
- You can either set the log level for all output windows or pick a specific one.
How to See Logged Output from the SDK
- Open your Python file in Visual Studio Code.
- Run the code by clicking the play button (Run Python File) on the top right corner of the Visual Studio Code window.
- View the output in the integrated terminal window. If the terminal is not visible, go to the menu bar and select
View > Terminal
(or press Ctrl+`
).
If you need further assistance, please use the following contact information:
Questions, issues, feature requests, and contributions
If you have feedback for the extension please email analyticschannelsupport@lseg.com
Release notes
Version 1.3.1 - March, 2025
- Drop support for old LSEG Python SDK versions: Support for lseg_package v1.0.0b3.post4 is dropped. This version of the extension supports v1.0.0b9 and newer releases.
- Search/Filter Capabilities for Code Samples: Added the ability to search and filter code samples for easier navigation.
- Contact Us Page: Added a new Contact Us page for better user support.
- Added troubleshooting section to the README.md: Added documentation explaining how to access extension logs to help diagnose issues.
Version 1.2.0 - December, 2024
- Support for multiple LSEG Python SDK versions: previous versions only supported lseg_package v1.0.0b2. This version of the extension supports v1.0.0b3.post4 and newer releases.
- Improved logging : more detailed logging to simplify support and troubleshooting
- Minor UX improvements: e.g. improved styling in the Sample UI, minor branding changes
- Minor bug fixes: e.g. removing redundant query parameters from proxy calls
Version 1.1.0 - September, 2024
- Updated Samples UI: A new, easier to navigate Samples UI that adds the option to open a sample in a Jupyter Notebook as well as a Python file.
- Minor bug fixes : e.g. fixing broken help link, adding license check to refresh command.
- Minor UX improvements: e.g. removing redundant commands, improved logging.
Version 1.0.0 - August, 2024
Version 1.0.0 of the LSEG Financial Analytics (LFA) Extension for Visual Studio Code. This extension brings dynamic intelligent code completion features tailored specifically for developers working with the LFA Python SDK, empowering them to write code more efficiently and accurately.
Known Issues:
- Not compatible with web version of VS Code.
- If Intelligent Code Completion is unavailable immediately after installing or updating the LSEG Analytics Python SDK, try the following: (1) run the LSEG: Refresh completion data for LSEG Financial Analytics command, (2) log out and log in again, or (3) restart Visual Studio Code.
- Intelligent Code Completion might not display the correct suggestions if multiple different Python environments are being used inside the same VSCode instance e.g. when a Jupyter Notebook uses a different Python environment from the folder it is in.