Skip to content

Commit 5a1a163

Browse files
committed
Merge branch 'main' into joh/systematic-mockingbird
2 parents 3618588 + 8349c95 commit 5a1a163

File tree

28 files changed

+259
-351
lines changed

28 files changed

+259
-351
lines changed

src/vs/editor/browser/services/editorWorkerService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export abstract class EditorWorkerService extends Disposable implements IEditorW
8282
return links && { links };
8383
}
8484
}));
85-
this._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, this._languageConfigurationService)));
85+
this._register(languageFeaturesService.completionProvider.register('*', new WordBasedCompletionItemProvider(this._workerManager, configurationService, this._modelService, this._languageConfigurationService, this._logService)));
8686
}
8787

8888
public override dispose(): void {
@@ -240,7 +240,8 @@ class WordBasedCompletionItemProvider implements languages.CompletionItemProvide
240240
workerManager: WorkerManager,
241241
configurationService: ITextResourceConfigurationService,
242242
modelService: IModelService,
243-
private readonly languageConfigurationService: ILanguageConfigurationService
243+
private readonly languageConfigurationService: ILanguageConfigurationService,
244+
private readonly logService: ILogService
244245
) {
245246
this._workerManager = workerManager;
246247
this._configurationService = configurationService;
@@ -286,6 +287,9 @@ class WordBasedCompletionItemProvider implements languages.CompletionItemProvide
286287
const replace = !word ? Range.fromPositions(position) : new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn);
287288
const insert = replace.setEndPosition(position.lineNumber, position.column);
288289

290+
// Trace logging about the word and replace/insert ranges
291+
this.logService.trace('[WordBasedCompletionItemProvider]', `word: "${word?.word || ''}", wordDef: "${wordDefRegExp}", replace: [${replace.toString()}], insert: [${insert.toString()}]`);
292+
289293
const client = await this._workerManager.withWorker();
290294
const data = await client.textualSuggest(models, word?.word, wordDefRegExp);
291295
if (!data) {

src/vs/editor/contrib/colorPicker/browser/defaultDocumentColorProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export class DefaultDocumentColorProvider implements DocumentColorProvider {
2727
const alpha = colorFromInfo.alpha;
2828
const color = new Color(new RGBA(Math.round(255 * colorFromInfo.red), Math.round(255 * colorFromInfo.green), Math.round(255 * colorFromInfo.blue), alpha));
2929

30-
const rgb = alpha ? Color.Format.CSS.formatRGB(color) : Color.Format.CSS.formatRGBA(color);
31-
const hsl = alpha ? Color.Format.CSS.formatHSL(color) : Color.Format.CSS.formatHSLA(color);
32-
const hex = alpha ? Color.Format.CSS.formatHex(color) : Color.Format.CSS.formatHexA(color);
30+
const rgb = alpha ? Color.Format.CSS.formatRGBA(color) : Color.Format.CSS.formatRGB(color);
31+
const hsl = alpha ? Color.Format.CSS.formatHSLA(color) : Color.Format.CSS.formatHSL(color);
32+
const hex = alpha ? Color.Format.CSS.formatHexA(color) : Color.Format.CSS.formatHex(color);
3333

3434
const colorPresentations: IColorPresentation[] = [];
3535
colorPresentations.push({ label: rgb, textEdit: { range: range, text: rgb } });

src/vs/editor/contrib/stickyScroll/browser/stickyScroll.css

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,65 @@
55

66
.monaco-editor .sticky-widget {
77
overflow: hidden;
8+
border-bottom: 1px solid var(--vscode-editorStickyScroll-border);
9+
width: 100%;
10+
box-shadow: var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;
11+
z-index: 4;
12+
background-color: var(--vscode-editorStickyScroll-background);
13+
right: initial !important;
814
}
915

10-
.monaco-editor .sticky-widget-line-numbers {
16+
.monaco-editor .sticky-widget.peek {
17+
background-color: var(--vscode-peekViewEditorStickyScroll-background);
18+
}
19+
20+
.monaco-editor .sticky-widget .sticky-widget-line-numbers {
1121
float: left;
1222
background-color: inherit;
1323
}
1424

15-
.monaco-editor .sticky-widget-lines-scrollable {
25+
.monaco-editor .sticky-widget .sticky-widget-lines-scrollable {
1626
display: inline-block;
1727
position: absolute;
1828
overflow: hidden;
1929
width: var(--vscode-editorStickyScroll-scrollableWidth);
2030
background-color: inherit;
2131
}
2232

23-
.monaco-editor .sticky-widget-lines {
33+
.monaco-editor .sticky-widget .sticky-widget-lines {
2434
position: absolute;
2535
background-color: inherit;
2636
}
2737

28-
.monaco-editor .sticky-line-number, .monaco-editor .sticky-line-content {
38+
.monaco-editor .sticky-widget .sticky-line-number,
39+
.monaco-editor .sticky-widget .sticky-line-content {
2940
color: var(--vscode-editorLineNumber-foreground);
3041
white-space: nowrap;
3142
display: inline-block;
3243
position: absolute;
3344
background-color: inherit;
3445
}
3546

36-
.monaco-editor .sticky-line-number .codicon-folding-expanded,
37-
.monaco-editor .sticky-line-number .codicon-folding-collapsed {
47+
.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,
48+
.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed {
3849
float: right;
3950
transition: var(--vscode-editorStickyScroll-foldingOpacityTransition);
4051
position: absolute;
4152
margin-left: 2px;
4253
}
4354

44-
.monaco-editor .sticky-line-content {
55+
.monaco-editor .sticky-widget .sticky-line-content {
4556
width: var(--vscode-editorStickyScroll-scrollableWidth);
4657
background-color: inherit;
4758
white-space: nowrap;
4859
}
4960

50-
.monaco-editor .sticky-line-number-inner {
61+
.monaco-editor .sticky-widget .sticky-line-number-inner {
5162
display: inline-block;
5263
text-align: right;
5364
}
5465

55-
.monaco-editor .sticky-widget {
56-
border-bottom: 1px solid var(--vscode-editorStickyScroll-border);
57-
}
58-
59-
.monaco-editor .sticky-line-content:hover {
66+
.monaco-editor .sticky-widget .sticky-line-content:hover {
6067
background-color: var(--vscode-editorStickyScrollHover-background);
6168
cursor: pointer;
6269
}
63-
64-
.monaco-editor .sticky-widget {
65-
width: 100%;
66-
box-shadow: var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;
67-
z-index: 4;
68-
background-color: var(--vscode-editorStickyScroll-background);
69-
right: initial !important;
70-
}
71-
72-
.monaco-editor .sticky-widget.peek {
73-
background-color: var(--vscode-peekViewEditorStickyScroll-background);
74-
}

src/vs/platform/actions/common/actions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ export class MenuId {
210210
static readonly SidebarTitle = new MenuId('SidebarTitle');
211211
static readonly PanelTitle = new MenuId('PanelTitle');
212212
static readonly AuxiliaryBarTitle = new MenuId('AuxiliaryBarTitle');
213-
static readonly AuxiliaryBarHeader = new MenuId('AuxiliaryBarHeader');
214213
static readonly TerminalInstanceContext = new MenuId('TerminalInstanceContext');
215214
static readonly TerminalEditorInstanceContext = new MenuId('TerminalEditorInstanceContext');
216215
static readonly TerminalNewDropdownContext = new MenuId('TerminalNewDropdownContext');

src/vs/workbench/api/common/extHostFileSystemEventService.ts

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Disposable, WorkspaceEdit } from './extHostTypes.js';
1414
import { IExtensionDescription } from '../../../platform/extensions/common/extensions.js';
1515
import { FileChangeFilter, FileOperation, IGlobPatterns } from '../../../platform/files/common/files.js';
1616
import { CancellationToken } from '../../../base/common/cancellation.js';
17-
import { ILogService, LogLevel } from '../../../platform/log/common/log.js';
17+
import { ILogService } from '../../../platform/log/common/log.js';
1818
import { IExtHostWorkspace } from './extHostWorkspace.js';
1919
import { Lazy } from '../../../base/common/lazy.js';
2020
import { ExtHostConfigProvider } from './extHostConfiguration.js';
@@ -29,9 +29,6 @@ export interface FileSystemWatcherCreateOptions {
2929

3030
class FileSystemWatcher implements vscode.FileSystemWatcher {
3131

32-
private static IDS = 0;
33-
34-
private readonly id = FileSystemWatcher.IDS++;
3532
private readonly session = Math.random();
3633

3734
private readonly _onDidCreate = new Emitter<vscode.Uri>();
@@ -53,16 +50,7 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
5350
return Boolean(this._config & 0b100);
5451
}
5552

56-
constructor(
57-
mainContext: IMainContext,
58-
logService: ILogService,
59-
configuration: ExtHostConfigProvider,
60-
workspace: IExtHostWorkspace,
61-
extension: IExtensionDescription,
62-
dispatcher: Event<FileSystemEvents>,
63-
globPattern: string | IRelativePatternDto,
64-
options: FileSystemWatcherCreateOptions
65-
) {
53+
constructor(mainContext: IMainContext, configuration: ExtHostConfigProvider, workspace: IExtHostWorkspace, extension: IExtensionDescription, dispatcher: Event<FileSystemEvents>, globPattern: string | IRelativePatternDto, options: FileSystemWatcherCreateOptions) {
6654
this._config = 0;
6755
if (options.ignoreCreateEvents) {
6856
this._config += 0b001;
@@ -74,18 +62,6 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
7462
this._config += 0b100;
7563
}
7664

77-
const trace = logService.getLevel() === LogLevel.Trace;
78-
if (trace) {
79-
let patternLogMsg: string;
80-
if (typeof globPattern === 'string') {
81-
patternLogMsg = `'${globPattern}'`;
82-
} else {
83-
patternLogMsg = `base: '${globPattern.base}', pattern: '${globPattern.pattern}'`;
84-
}
85-
86-
logService.trace(`[File Watcher ('API') ${this.id}] createFileSystemWatcher(${patternLogMsg}, ${JSON.stringify(options)})`);
87-
}
88-
8965
const parsedPattern = parse(globPattern);
9066

9167
// 1.64.x behaviour change: given the new support to watch any folder
@@ -105,64 +81,34 @@ class FileSystemWatcher implements vscode.FileSystemWatcher {
10581

10682
const subscription = dispatcher(events => {
10783
if (typeof events.session === 'number' && events.session !== this.session) {
108-
if (trace) {
109-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(): returning early due to event correlation mismatch`);
110-
}
11184
return; // ignore events from other file watchers that are in correlation mode
11285
}
11386

11487
if (excludeUncorrelatedEvents && typeof events.session === 'undefined') {
115-
if (trace) {
116-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(): returning early due to event correlation mismatch`);
117-
}
11888
return; // ignore events from other non-correlating file watcher when we are in correlation mode
11989
}
12090

12191
if (!options.ignoreCreateEvents) {
12292
for (const created of events.created) {
12393
const uri = URI.revive(created);
124-
if (parsedPattern(uri.fsPath)) {
125-
if (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri)) {
126-
this._onDidCreate.fire(uri);
127-
} else {
128-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(created): ${uri.fsPath} did not match out-of-workspace rule`);
129-
}
130-
} else {
131-
if (trace) {
132-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(created): ${uri.fsPath} did not match pattern`);
133-
}
94+
if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) {
95+
this._onDidCreate.fire(uri);
13496
}
13597
}
13698
}
13799
if (!options.ignoreChangeEvents) {
138100
for (const changed of events.changed) {
139101
const uri = URI.revive(changed);
140-
if (parsedPattern(uri.fsPath)) {
141-
if (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri)) {
142-
this._onDidChange.fire(uri);
143-
} else {
144-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(changed): ${uri.fsPath} did not match out-of-workspace rule`);
145-
}
146-
} else {
147-
if (trace) {
148-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(changed): ${uri.fsPath} did not match pattern`);
149-
}
102+
if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) {
103+
this._onDidChange.fire(uri);
150104
}
151105
}
152106
}
153107
if (!options.ignoreDeleteEvents) {
154108
for (const deleted of events.deleted) {
155109
const uri = URI.revive(deleted);
156-
if (parsedPattern(uri.fsPath)) {
157-
if (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri)) {
158-
this._onDidDelete.fire(uri);
159-
} else {
160-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(deleted): ${uri.fsPath} did not match out-of-workspace rule`);
161-
}
162-
} else {
163-
if (trace) {
164-
logService.trace(`[File Watcher ('API') ${this.id}] dispatch(deleted): ${uri.fsPath} did not match pattern`);
165-
}
110+
if (parsedPattern(uri.fsPath) && (!excludeOutOfWorkspaceEvents || workspace.getWorkspaceFolder(uri))) {
111+
this._onDidDelete.fire(uri);
166112
}
167113
}
168114
}
@@ -339,7 +285,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
339285
//--- file events
340286

341287
createFileSystemWatcher(workspace: IExtHostWorkspace, configProvider: ExtHostConfigProvider, extension: IExtensionDescription, globPattern: vscode.GlobPattern, options: FileSystemWatcherCreateOptions): vscode.FileSystemWatcher {
342-
return new FileSystemWatcher(this._mainContext, this._logService, configProvider, workspace, extension, this._onFileSystemEvent.event, typeConverter.GlobPattern.from(globPattern), options);
288+
return new FileSystemWatcher(this._mainContext, configProvider, workspace, extension, this._onFileSystemEvent.event, typeConverter.GlobPattern.from(globPattern), options);
343289
}
344290

345291
$onFileEvent(events: FileSystemEvents) {

src/vs/workbench/api/common/extHostNotebookEditor.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ export class ExtHostNotebookEditor {
1818
private _visible: boolean = false;
1919

2020
private _editor?: vscode.NotebookEditor;
21-
private _selections: vscode.NotebookRange[] = [new NotebookRange(0, 0)];
2221

2322
constructor(
2423
readonly id: string,
2524
private readonly _proxy: MainThreadNotebookEditorsShape,
2625
readonly notebookData: ExtHostNotebookDocument,
2726
private _visibleRanges: vscode.NotebookRange[],
28-
selections: vscode.NotebookRange[],
27+
private _selections: vscode.NotebookRange[],
2928
private _viewColumn: vscode.ViewColumn | undefined,
3029
private readonly viewType: string
31-
) {
32-
this._selections = this._validSelections(selections);
33-
}
30+
) { }
3431

3532
get apiEditor(): vscode.NotebookEditor {
3633
if (!this._editor) {
@@ -52,7 +49,7 @@ export class ExtHostNotebookEditor {
5249
if (!Array.isArray(value) || !value.every(extHostTypes.NotebookRange.isNotebookRange)) {
5350
throw illegalArgument('selections');
5451
}
55-
that._selections = that._validSelections(value);
52+
that._selections = value.length === 0 ? [new NotebookRange(0, 0)] : value;
5653
that._trySetSelections(that._selections);
5754
},
5855
get visibleRanges() {
@@ -97,7 +94,7 @@ export class ExtHostNotebookEditor {
9794
}
9895

9996
_acceptSelections(selections: vscode.NotebookRange[]): void {
100-
this._selections = this._validSelections(selections);
97+
this._selections = selections;
10198
}
10299

103100
private _trySetSelections(value: vscode.NotebookRange[]): void {
@@ -107,8 +104,4 @@ export class ExtHostNotebookEditor {
107104
_acceptViewColumn(value: vscode.ViewColumn | undefined) {
108105
this._viewColumn = value;
109106
}
110-
111-
private _validSelections(selections: vscode.NotebookRange[]) {
112-
return selections.length === 0 ? [new NotebookRange(0, 0)] : selections;
113-
}
114107
}

0 commit comments

Comments
 (0)