Fixes #735 - "Running" forever for folder with multiple .NET Core projects
This commit is contained in:
Dustin Campbell 2016-09-13 15:28:06 -07:00 коммит произвёл GitHub
Родитель 716f2f5df6 a060446308
Коммит fbbf5a13ee
4 изменённых файлов: 18582 добавлений и 28 удалений

Просмотреть файл

@ -30,6 +30,7 @@
"fs-extra-promise": "^0.3.1",
"http-proxy-agent": "^1.0.0",
"https-proxy-agent": "^1.0.0",
"lodash": "^4.15.0",
"open": "*",
"semver": "*",
"tmp": "0.0.28",

Просмотреть файл

@ -11,7 +11,7 @@ import * as vscode from 'vscode';
import * as tasks from 'vscode-tasks';
import {OmnisharpServer} from './omnisharp/server';
import * as serverUtils from './omnisharp/utils';
import * as protocol from './omnisharp/protocol.ts'
import * as protocol from './omnisharp/protocol'
interface DebugConfiguration {
name: string,

Просмотреть файл

@ -10,6 +10,7 @@ import {dotnetRestoreForProject} from './commands';
import {basename} from 'path';
import * as protocol from '../omnisharp/protocol';
import * as serverUtils from '../omnisharp/utils';
import {debounce} from 'lodash';
export default function reportStatus(server: OmnisharpServer) {
return vscode.Disposable.from(
@ -42,6 +43,7 @@ class Status {
export function reportDocumentStatus(server: OmnisharpServer): vscode.Disposable {
let disposables: vscode.Disposable[] = [];
let localDisposables: vscode.Disposable[];
let entry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE);
let defaultStatus = new Status(defaultSelector);
@ -107,9 +109,13 @@ export function reportDocumentStatus(server: OmnisharpServer): vscode.Disposable
disposables.push(server.onServerStop(() => {
projectStatus = undefined;
defaultStatus.text = undefined;
vscode.Disposable.from(...localDisposables).dispose();
localDisposables = undefined;
}));
disposables.push(server.onServerStart(path => {
localDisposables = [];
defaultStatus.text = '$(flame) Running';
defaultStatus.command = 'o.pickProjectAndStart';
@ -182,9 +188,11 @@ export function reportDocumentStatus(server: OmnisharpServer): vscode.Disposable
});
}
disposables.push(server.onProjectAdded(updateProjectInfo));
disposables.push(server.onProjectChange(updateProjectInfo));
disposables.push(server.onProjectRemoved(updateProjectInfo));
// Don't allow the same request to slam the server within a "short" window
let debouncedUpdateProjectInfo = debounce(updateProjectInfo, 1500, { leading: true });
localDisposables.push(server.onProjectAdded(debouncedUpdateProjectInfo));
localDisposables.push(server.onProjectChange(debouncedUpdateProjectInfo));
localDisposables.push(server.onProjectRemoved(debouncedUpdateProjectInfo));
}));
return vscode.Disposable.from(...disposables);

18545
typings/lodash/lodash.d.ts поставляемый Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу