forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for multi root workspaces with the new language server …
…server (#4244) * Added functionality * News entry * Corrected functionality * Register command only once * Activate jedi only once * Make sure activation is filtered to resource * Corrected activationManager * Corrected configSettings bug * Added functional tests * Added unit tests * Handle multiple folders being removed simultaneously * code reviews
- Loading branch information
Kartik Raj
authored
Feb 12, 2019
1 parent
37d6818
commit cf686d2
Showing
19 changed files
with
373 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for multi root workspaces with the new language server server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/client/activation/languageServer/languageServerExtension.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
'use strict'; | ||
|
||
import { inject, injectable } from 'inversify'; | ||
import { Event, EventEmitter } from 'vscode'; | ||
import { ICommandManager } from '../../common/application/types'; | ||
import '../../common/extensions'; | ||
import { IDisposable } from '../../common/types'; | ||
import { ILanguageServerExtension } from '../types'; | ||
|
||
const loadExtensionCommand = 'python._loadLanguageServerExtension'; | ||
|
||
@injectable() | ||
export class LanguageServerExtension implements ILanguageServerExtension { | ||
public loadExtensionArgs?: {}; | ||
protected readonly _invoked = new EventEmitter<void>(); | ||
private disposable?: IDisposable; | ||
constructor(@inject(ICommandManager) private readonly commandManager: ICommandManager) { } | ||
public dispose() { | ||
if (this.disposable) { | ||
this.disposable.dispose(); | ||
} | ||
} | ||
public register(): Promise<void> { | ||
if (this.disposable) { | ||
return; | ||
} | ||
this.disposable = this.commandManager.registerCommand(loadExtensionCommand, args => { | ||
this.loadExtensionArgs = args; | ||
this._invoked.fire(); | ||
}); | ||
} | ||
public get invoked(): Event<void> { | ||
return this._invoked.event; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.