Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion product.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"name": "ms-vscode.js-debug",
"version": "1.49.6",
"version": "1.49.7",
"repo": "https://github.com/Microsoft/vscode-js-debug",
"metadata": {
"id": "25629058-ddac-4e17-abba-74678e126c5d",
Expand Down
4 changes: 2 additions & 2 deletions src/vs/code/electron-main/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export class ProxyAuthHandler extends Disposable {
if (channel === 'vscode:proxyAuthResponse') {
const { username, password } = credentials;
cb(username, password);
win.removeListener('close', onWindowClose);
win.close();
}
win.removeListener('close', onWindowClose);
win.close();
});
win.loadURL(url);
}
Expand Down
8 changes: 4 additions & 4 deletions src/vs/editor/common/modes/supports/tokenization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ export function generateTokensCSSForColorMap(colorMap: Color[]): string {
let rules: string[] = [];
for (let i = 1, len = colorMap.length; i < len; i++) {
let color = colorMap[i];
rules[i] = `.monaco-editor .mtk${i} { color: ${color}; }`;
rules[i] = `.mtk${i} { color: ${color}; }`;
}
rules.push('.monaco-editor .mtki { font-style: italic; }');
rules.push('.monaco-editor .mtkb { font-weight: bold; }');
rules.push('.monaco-editor .mtku { text-decoration: underline; text-underline-position: under; }');
rules.push('.mtki { font-style: italic; }');
rules.push('.mtkb { font-weight: bold; }');
rules.push('.mtku { text-decoration: underline; text-underline-position: under; }');
return rules.join('\n');
}
11 changes: 10 additions & 1 deletion src/vs/editor/contrib/suggest/completionModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { InternalSuggestOptions } from 'vs/editor/common/config/editorOptions';
import { WordDistance } from 'vs/editor/contrib/suggest/wordDistance';
import { CharCode } from 'vs/base/common/charCode';
import { compareIgnoreCase } from 'vs/base/common/strings';
import { Event } from 'vs/base/common/event'; // Unused import

type StrictCompletionItem = Required<CompletionItem>;

Expand Down Expand Up @@ -56,6 +57,7 @@ export class CompletionModel {
private _refilterKind: Refilter;
private _filteredItems?: StrictCompletionItem[];
private _isIncomplete?: Set<CompletionItemProvider>;
private _allProvider?: Set<CompletionItemProvider>; // TODO@jrieken merge incomplete and all provider info
private _stats?: ICompletionStats;

constructor(
Expand Down Expand Up @@ -99,6 +101,11 @@ export class CompletionModel {
return this._filteredItems!;
}

get allProvider(): Set<CompletionItemProvider> {
this._ensureCachedState();
return this._allProvider!;
}

get incomplete(): Set<CompletionItemProvider> {
this._ensureCachedState();
return this._isIncomplete!;
Expand Down Expand Up @@ -136,6 +143,7 @@ export class CompletionModel {
private _createCachedState(): void {

this._isIncomplete = new Set();
this._allProvider = new Set();
this._stats = { suggestionCount: 0, snippetCount: 0, textCount: 0 };

const { leadingLineContent, characterCountDelta } = this._lineContext;
Expand Down Expand Up @@ -164,6 +172,7 @@ export class CompletionModel {
if (item.container.incomplete) {
this._isIncomplete.add(item.provider);
}
this._allProvider.add(item.provider);

// 'word' is that remainder of the current line that we
// filter and score against. In theory each suggestion uses a
Expand Down Expand Up @@ -290,4 +299,4 @@ export class CompletionModel {
}
return CompletionModel._compareCompletionItems(a, b);
}
}
}
20 changes: 12 additions & 8 deletions src/vs/editor/contrib/suggest/suggestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { WordDistance } from 'vs/editor/contrib/suggest/wordDistance';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
import { isLowSurrogate, isHighSurrogate } from 'vs/base/common/strings';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { URI } from 'vs/base/common/uri'; // Unused import

export interface ICancelEvent {
readonly retrigger: boolean;
Expand All @@ -44,6 +45,7 @@ export interface ISuggestEvent {
export interface SuggestTriggerContext {
readonly auto: boolean;
readonly shy: boolean;
readonly triggerKind?: CompletionTriggerKind;
readonly triggerCharacter?: string;
}

Expand Down Expand Up @@ -393,16 +395,12 @@ export class SuggestModel implements IDisposable {
this._context = ctx;

// Build context for request
let suggestCtx: CompletionContext;
let suggestCtx: CompletionContext = { triggerKind: context.triggerKind ?? CompletionTriggerKind.Invoke };
if (context.triggerCharacter) {
suggestCtx = {
triggerKind: CompletionTriggerKind.TriggerCharacter,
triggerCharacter: context.triggerCharacter
};
} else if (onlyFrom && onlyFrom.size > 0) {
suggestCtx = { triggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions };
} else {
suggestCtx = { triggerKind: CompletionTriggerKind.Invoke };
}

this._requestToken = new CancellationTokenSource();
Expand Down Expand Up @@ -558,15 +556,21 @@ export class SuggestModel implements IDisposable {

if (ctx.leadingWord.word.length !== 0 && ctx.leadingWord.startColumn > this._context.leadingWord.startColumn) {
// started a new word while IntelliSense shows -> retrigger
this.trigger({ auto: this._context.auto, shy: false }, true);

// Select those providers have not contributed to this completion model and re-trigger completions for
// them. Also adopt the existing items and merge them into the new completion model
const inactiveProvider = new Set(CompletionProviderRegistry.all(this._editor.getModel()!));
this._completionModel.allProvider.forEach(provider => inactiveProvider.delete(provider));
const items = this._completionModel.adopt(new Set());
this.trigger({ auto: this._context.auto, shy: false }, true, inactiveProvider, items);
return;
}

if (ctx.column > this._context.column && this._completionModel.incomplete.size > 0 && ctx.leadingWord.word.length !== 0) {
// typed -> moved cursor RIGHT & incomple model & still on a word -> retrigger
const { incomplete } = this._completionModel;
const adopted = this._completionModel.adopt(incomplete);
this.trigger({ auto: this._state === State.Auto, shy: false }, true, incomplete, adopted);
this.trigger({ auto: this._state === State.Auto, shy: false, triggerKind: CompletionTriggerKind.TriggerForIncompleteCompletions }, true, incomplete, adopted);

} else {
// typed -> moved cursor RIGHT -> update UI
Expand Down Expand Up @@ -613,4 +617,4 @@ export class SuggestModel implements IDisposable {
});
}
}
}
}
5 changes: 3 additions & 2 deletions src/vs/workbench/browser/web.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ class BrowserMain extends Disposable {
// Initialize required resources - settings & global state
await userDataInitializationService.initializeRequiredResources();

// Reload configuration after initializing
await configurationService.reloadConfiguration();
// Important: Reload only local user configuration after initializing
// Reloading complete configuraiton blocks workbench until remote configuration is loaded.
await configurationService.reloadLocalUserConfiguration();
}

return { serviceCollection, logService, storageService };
Expand Down
18 changes: 11 additions & 7 deletions src/vs/workbench/contrib/views/browser/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import { isFalsyOrWhitespace } from 'vs/base/common/strings';
import { SIDE_BAR_BACKGROUND, PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import { IHoverService, IHoverOptions, IHoverTarget } from 'vs/workbench/services/hover/browser/hover';
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { isMacintosh } from 'vs/base/common/platform';

class Root implements ITreeItem {
Expand Down Expand Up @@ -756,6 +755,8 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
}) : undefined;
const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
const iconUrl = icon ? URI.revive(icon) : null;
const canResolve = node instanceof ResolvableTreeItem && node.hasResolve;
const title = node.tooltip ? (isString(node.tooltip) ? node.tooltip : undefined) : (resource ? undefined : (canResolve ? undefined : label));

// reset
templateData.actionBar.clear();
Expand All @@ -765,7 +766,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
const labelResource = resource ? resource : URI.parse('missing:_icon_resource');
templateData.resourceLabel.setResource({ name: label, description, resource: labelResource }, {
fileKind: this.getFileKind(node),
title: '',
title,
hideIcon: !!iconUrl,
fileDecorations,
extraClasses: ['custom-view-tree-node-item-resourceLabel'],
Expand All @@ -775,7 +776,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
fallbackHover = this.labelService.getUriLabel(labelResource);
} else {
templateData.resourceLabel.setResource({ name: label, description }, {
title: '',
title,
hideIcon: true,
extraClasses: ['custom-view-tree-node-item-resourceLabel'],
matches: matches ? matches : createMatches(element.filterData),
Expand Down Expand Up @@ -810,6 +811,11 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
}

private setupHovers(node: ITreeItem, htmlElement: HTMLElement, disposableStore: DisposableStore, label: string | undefined): void {
if (!(node instanceof ResolvableTreeItem) || (node.tooltip && isString(node.tooltip)) || (!node.tooltip && !node.hasResolve)) {
return;
}
const resolvableNode: ResolvableTreeItem = node;

const hoverService = this.hoverService;
// Testing has indicated that on Windows and Linux 500 ms matches the native hovers most closely.
// On Mac, the delay is 1500.
Expand All @@ -827,10 +833,8 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
this.addEventListener(DOM.EventType.MOUSE_LEAVE, mouseLeave, { passive: true });
this.addEventListener(DOM.EventType.MOUSE_MOVE, mouseMove, { passive: true });
setTimeout(async () => {
if (node instanceof ResolvableTreeItem) {
await node.resolve();
}
let tooltip: IMarkdownString | string | undefined = node.tooltip ?? label;
await resolvableNode.resolve();
const tooltip = resolvableNode.tooltip ?? label;
if (isHovering && tooltip) {
if (!hoverOptions) {
const target: IHoverTarget = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class WorkspaceService extends Disposable implements IConfigurationServic

if (!this.localUserConfiguration.hasTasksLoaded) {
// Reload local user configuration again to load user tasks
runWhenIdle(() => this.reloadLocalUserConfiguration().then(configurationModel => this.onLocalUserConfigurationChanged(configurationModel)), 5000);
runWhenIdle(() => this.reloadLocalUserConfiguration(), 5000);
}
});
}
Expand Down Expand Up @@ -436,16 +436,27 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
.then(([local, remote]) => ({ local, remote }));
}

private reloadUserConfiguration(key?: string): Promise<{ local: ConfigurationModel, remote: ConfigurationModel }> {
return Promise.all([this.reloadLocalUserConfiguration(), this.reloadRemoeUserConfiguration()]).then(([local, remote]) => ({ local, remote }));
private reloadUserConfiguration(): Promise<{ local: ConfigurationModel, remote: ConfigurationModel }> {
return Promise.all([this.reloadLocalUserConfiguration(true), this.reloadRemoteUserConfiguration(true)]).then(([local, remote]) => ({ local, remote }));
}

private reloadLocalUserConfiguration(key?: string): Promise<ConfigurationModel> {
return this.localUserConfiguration.reload();
async reloadLocalUserConfiguration(donotTrigger?: boolean): Promise<ConfigurationModel> {
const model = await this.localUserConfiguration.reload();
if (!donotTrigger) {
this.onLocalUserConfigurationChanged(model);
}
return model;
}

private reloadRemoeUserConfiguration(key?: string): Promise<ConfigurationModel> {
return this.remoteUserConfiguration ? this.remoteUserConfiguration.reload() : Promise.resolve(new ConfigurationModel());
private async reloadRemoteUserConfiguration(donotTrigger?: boolean): Promise<ConfigurationModel> {
if (this.remoteUserConfiguration) {
const model = await this.remoteUserConfiguration.reload();
if (!donotTrigger) {
this.onRemoteUserConfigurationChanged(model);
}
return model;
}
return new ConfigurationModel();
}

private reloadWorkspaceConfiguration(key?: string): Promise<void> {
Expand Down Expand Up @@ -667,9 +678,9 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
.then(() => {
switch (editableConfigurationTarget) {
case EditableConfigurationTarget.USER_LOCAL:
return this.reloadLocalUserConfiguration().then(local => this.onLocalUserConfigurationChanged(local));
return this.reloadLocalUserConfiguration().then(() => undefined);
case EditableConfigurationTarget.USER_REMOTE:
return this.reloadRemoeUserConfiguration().then(remote => this.onRemoteUserConfigurationChanged(remote));
return this.reloadRemoteUserConfiguration().then(() => undefined);
case EditableConfigurationTarget.WORKSPACE:
return this.reloadWorkspaceConfiguration();
case EditableConfigurationTarget.WORKSPACE_FOLDER:
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/services/userData/browser/userDataInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,23 @@ export class UserDataInitializationService implements IUserDataInitializationSer
}

async requiresInitialization(): Promise<boolean> {
this.logService.trace(`UserDataInitializationService#requiresInitialization`);
const userDataSyncStoreClient = await this.createUserDataSyncStoreClient();
return !!userDataSyncStoreClient;
}

async initializeRequiredResources(): Promise<void> {
this.logService.trace(`UserDataInitializationService#initializeRequiredResources`);
return this.initialize([SyncResource.Settings, SyncResource.GlobalState]);
}

async initializeOtherResources(): Promise<void> {
this.logService.trace(`UserDataInitializationService#initializeOtherResources`);
return this.initialize([SyncResource.Keybindings, SyncResource.Snippets]);
}

async initializeExtensions(instantiationService: IInstantiationService): Promise<void> {
this.logService.trace(`UserDataInitializationService#initializeExtensions`);
return this.initialize([SyncResource.Extensions], instantiationService);
}

Expand Down