未验证 提交 9db1b149 编写于 作者: J João Moreno

Merge remote-tracking branch 'origin/master'

{
"version": "0.2.0",
"compounds": [
{
"name": "Debug Extension and Language Server",
"configurations": [
"Launch Extension",
"Attach Language Server"
]
}
],
"configurations": [
{
"name": "Launch Extension",
......@@ -41,19 +32,6 @@
]
},
{
"name": "Attach Language Server",
"type": "node",
"request": "attach",
"protocol": "inspector",
"port": 6044,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/server/out/**/*.js"
],
"smartStep": true,
"restart": true
},
{
"name": "Server Unit Tests",
"type": "node",
"request": "launch",
......@@ -74,4 +52,4 @@
]
}
]
}
\ No newline at end of file
}
......@@ -11,14 +11,13 @@ import { TextDecoder } from 'util';
// this method is called when vs code is activated
export function activate(context: ExtensionContext) {
const clientMain = extensions.getExtension('vscode.css-language-features')?.packageJSON?.main || '';
const serverMain = `./server/${clientMain.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/cssServerMain`;
const serverModule = context.asAbsolutePath(serverMain);
// The debug options for the server
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (7000 + Math.round(Math.random() * 999))] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -24,7 +24,7 @@ export function activate(context: ExtensionContext) {
const serverModule = context.asAbsolutePath(serverMain);
// The debug options for the server
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (8000 + Math.round(Math.random() * 999))] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -25,7 +25,7 @@ export function activate(context: ExtensionContext) {
const serverModule = context.asAbsolutePath(serverMain);
// The debug options for the server
const debugOptions = { execArgv: ['--nolazy', '--inspect=6044'] };
const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (6000 + Math.round(Math.random() * 999))] };
// If the extension is launch in debug mode the debug server options are use
// Otherwise the run options are used
......
......@@ -169,13 +169,13 @@ export class SuggestWidget implements IDisposable {
if (e.done) {
// only store width or height value that have changed and also
// only store changes that are above a certain threshold
const threshold = Math.floor(this.getLayoutInfo().itemHeight / 3);
const threshold = Math.floor(this.getLayoutInfo().itemHeight / 2);
let { width, height } = this.element.size;
if (persistedSize && currentSize) {
if (!persistHeight || Math.abs(currentSize.height - height) > threshold) {
if (!persistHeight || Math.abs(currentSize.height - height) <= threshold) {
height = persistedSize.height;
}
if (!persistWidth || Math.abs(currentSize.width - width) > threshold) {
if (!persistWidth || Math.abs(currentSize.width - width) <= threshold) {
width = persistedSize.width;
}
}
......
......@@ -5,7 +5,7 @@
import { localize } from 'vs/nls';
import { IExtensionManagementService, IGlobalExtensionEnablementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
import { ExtensionType, IExtension } from 'vs/platform/extensions/common/extensions';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification';
......@@ -33,9 +33,9 @@ export interface IExtensionBisectService {
isDisabledByBisect(extension: IExtension): boolean;
isActive: boolean;
disabledCount: number;
start(extensions: ILocalExtension[]): void;
next(seeingBad: boolean): { id: string, bad: boolean } | undefined;
reset(): void;
start(extensions: ILocalExtension[]): Promise<void>;
next(seeingBad: boolean): Promise<{ id: string, bad: boolean } | undefined>;
reset(): Promise<void>;
}
class BisectState {
......@@ -106,23 +106,23 @@ class ExtensionBisectService implements IExtensionBisectService {
return disabled ?? false;
}
start(extensions: ILocalExtension[]): void {
async start(extensions: ILocalExtension[]): Promise<void> {
if (this._state) {
throw new Error('invalid state');
}
const extensionIds = extensions.map(ext => ext.identifier.id);
const newState = new BisectState(extensionIds, 0, extensionIds.length);
this._storageService.store(ExtensionBisectService._storageKey, JSON.stringify(newState), StorageScope.GLOBAL);
this._storageService.flush();
this._storageService.store2(ExtensionBisectService._storageKey, JSON.stringify(newState), StorageScope.GLOBAL, StorageTarget.MACHINE);
await this._storageService.flush();
}
next(seeingBad: boolean): { id: string, bad: boolean } | undefined {
async next(seeingBad: boolean): Promise<{ id: string; bad: boolean; } | undefined> {
if (!this._state) {
throw new Error('invalid state');
}
// check if there is only one left
if (this._state.low === this._state.high - 1) {
this.reset();
await this.reset();
return { id: this._state.extensions[this._state.low], bad: seeingBad };
}
// the second half is disabled so if there is still bad it must be
......@@ -132,14 +132,14 @@ class ExtensionBisectService implements IExtensionBisectService {
seeingBad ? this._state.low : this._state.mid,
seeingBad ? this._state.mid : this._state.high,
);
this._storageService.store(ExtensionBisectService._storageKey, JSON.stringify(nextState), StorageScope.GLOBAL);
this._storageService.flush();
this._storageService.store2(ExtensionBisectService._storageKey, JSON.stringify(nextState), StorageScope.GLOBAL, StorageTarget.MACHINE);
await this._storageService.flush();
return undefined;
}
reset(): void {
async reset(): Promise<void> {
this._storageService.remove(ExtensionBisectService._storageKey, StorageScope.GLOBAL);
this._storageService.flush();
await this._storageService.flush();
}
}
......@@ -220,7 +220,7 @@ registerAction2(class extends Action2 {
});
if (res.confirmed) {
extensionsBisect.start(extensions);
await extensionsBisect.start(extensions);
hostService.reload();
}
}
......@@ -252,11 +252,11 @@ registerAction2(class extends Action2 {
seeingBad = await this._checkForBad(dialogService);
}
if (seeingBad === undefined) {
bisectService.reset();
await bisectService.reset();
hostService.reload();
return;
}
const done = bisectService.next(seeingBad);
const done = await bisectService.next(seeingBad);
if (!done) {
hostService.reload();
return;
......@@ -286,7 +286,7 @@ registerAction2(class extends Action2 {
await issueService.openReporter({ extensionId: done.id });
}
}
bisectService.reset();
await bisectService.reset();
hostService.reload();
}
......@@ -322,8 +322,7 @@ registerAction2(class extends Action2 {
async run(accessor: ServicesAccessor): Promise<void> {
const extensionsBisect = accessor.get(IExtensionBisectService);
const hostService = accessor.get(IHostService);
extensionsBisect.reset();
hostService.reload(); //todo@jrieken reloadExtensionHost instead? update ext viewlet etc?
await extensionsBisect.reset();
hostService.reload();
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册