Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
editorTracker.widgetAdded.connect((sender, widget) => {
const sessions = app.serviceManager.sessions;
const editor = widget.content.editor;
const contextConnector = new ContextConnector({ editor });
// When the list of running sessions changes,
// check to see if there are any kernels with a
// matching path for this file editor.
const onRunningChanged = (
sender: Session.IManager,
models: Session.IModel[]
) => {
const oldSession = activeSessions[widget.id];
// Search for a matching path.
const model = find(models, m => m.path === widget.context.path);
if (model) {
// If there is a matching path, but it is the same
// session as we previously had, do nothing.
if (oldSession && oldSession.id === model.id) {
return;
editorTracker.widgetAdded.connect(async (sender, widget) => {
const sessions = app.serviceManager.sessions;
const editor = await widget.content.editor;
const contextConnector = new ContextConnector({ editor });
// When the list of running sessions changes,
// check to see if there are any kernels with a
// matching path for this file editor.
const onRunningChanged = (
sender: Session.IManager,
models: Session.IModel[]
) => {
const oldSession = activeSessions[widget.id];
// Search for a matching path.
const model = find(models, m => m.path === widget.context.path);
if (model) {
// If there is a matching path, but it is the same
// session as we previously had, do nothing.
if (oldSession && oldSession.id === model.id) {
return;
editorTracker.widgetAdded.connect((sender, widget) => {
const sessions = app.serviceManager.sessions;
const editor = widget.content.editor;
const contextConnector = new ContextConnector({ editor });
// When the list of running sessions changes,
// check to see if there are any kernels with a
// matching path for this file editor.
const onRunningChanged = (
sender: Session.IManager,
models: Session.IModel[]
) => {
const oldSession = activeSessions[widget.id];
// Search for a matching path.
const model = find(models, m => m.path === widget.context.path);
if (model) {
// If there is a matching path, but it is the same
// session as we previously had, do nothing.
if (oldSession && oldSession.id === model.id) {
return;
constructor(options: LSPConnector.IOptions) {
super();
this._editor = options.editor;
this._connections = options.connections;
this.virtual_editor = options.virtual_editor;
this._context_connector = new ContextConnector({ editor: options.editor });
if (options.session) {
let kernel_options = { editor: options.editor, session: options.session };
this._kernel_connector = new KernelConnector(kernel_options);
this._kernel_and_context_connector = new CompletionConnector(
kernel_options
);
}
this.options = options;
}