Skip to content

Commit 26c0fa1

Browse files
authored
Merge branch 'master' into fix-96009
2 parents 5ebe490 + de1e481 commit 26c0fa1

25 files changed

Lines changed: 219 additions & 170 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.45.0",
4-
"distro": "8ea4bcef47a40f9c0eb61dfd1a52eb668563ce39",
4+
"distro": "80f0fc536f655bb758aaf1eb865418f5890afa5d",
55
"author": {
66
"name": "Microsoft Corporation"
77
},
@@ -147,7 +147,7 @@
147147
"opn": "^6.0.0",
148148
"optimist": "0.3.5",
149149
"p-all": "^1.0.0",
150-
"playwright": "0.12.1",
150+
"playwright": "0.15.0",
151151
"pump": "^1.0.1",
152152
"queue": "3.0.6",
153153
"rcedit": "^1.1.0",

src/vs/base/common/jsonSchema.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,18 @@ export interface IJSONSchema {
5353
then?: IJSONSchema;
5454
else?: IJSONSchema;
5555

56-
// VSCode extensions
57-
defaultSnippets?: IJSONSchemaSnippet[]; // VSCode extension
58-
errorMessage?: string; // VSCode extension
59-
patternErrorMessage?: string; // VSCode extension
60-
deprecationMessage?: string; // VSCode extension
61-
enumDescriptions?: string[]; // VSCode extension
62-
markdownEnumDescriptions?: string[]; // VSCode extension
63-
markdownDescription?: string; // VSCode extension
64-
doNotSuggest?: boolean; // VSCode extension
65-
allowComments?: boolean; // VSCode extension
66-
allowTrailingCommas?: boolean; // VSCode extension
56+
// VS Code extensions
57+
defaultSnippets?: IJSONSchemaSnippet[];
58+
errorMessage?: string;
59+
patternErrorMessage?: string;
60+
deprecationMessage?: string;
61+
markdownDeprecationMessage?: string;
62+
enumDescriptions?: string[];
63+
markdownEnumDescriptions?: string[];
64+
markdownDescription?: string;
65+
doNotSuggest?: boolean;
66+
allowComments?: boolean;
67+
allowTrailingCommas?: boolean;
6768
}
6869

6970
export interface IJSONSchemaMap {

src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart';
1010
import { Position } from 'vs/editor/common/core/position';
1111
import { IConfiguration } from 'vs/editor/common/editorCommon';
1212
import { TokenizationRegistry } from 'vs/editor/common/modes';
13-
import { editorCursorForeground, editorOverviewRulerBorder } from 'vs/editor/common/view/editorColorRegistry';
13+
import { editorCursorForeground, editorOverviewRulerBorder, editorOverviewRulerBackground } from 'vs/editor/common/view/editorColorRegistry';
1414
import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext';
1515
import { ViewContext, EditorTheme } from 'vs/editor/common/view/viewContext';
1616
import * as viewEvents from 'vs/editor/common/view/viewEvents';
@@ -60,7 +60,10 @@ class Settings {
6060
const minimapOpts = options.get(EditorOption.minimap);
6161
const minimapEnabled = minimapOpts.enabled;
6262
const minimapSide = minimapOpts.side;
63-
const backgroundColor = (minimapEnabled ? TokenizationRegistry.getDefaultBackground() : null);
63+
const backgroundColor = minimapEnabled
64+
? theme.getColor(editorOverviewRulerBackground) || TokenizationRegistry.getDefaultBackground()
65+
: null;
66+
6467
if (backgroundColor === null || minimapSide === 'left') {
6568
this.backgroundColor = null;
6669
} else {

src/vs/editor/common/view/editorColorRegistry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const editorBracketMatchBackground = registerColor('editorBracketMatch.ba
3636
export const editorBracketMatchBorder = registerColor('editorBracketMatch.border', { dark: '#888', light: '#B9B9B9', hc: contrastBorder }, nls.localize('editorBracketMatchBorder', 'Color for matching brackets boxes'));
3737

3838
export const editorOverviewRulerBorder = registerColor('editorOverviewRuler.border', { dark: '#7f7f7f4d', light: '#7f7f7f4d', hc: '#7f7f7f4d' }, nls.localize('editorOverviewRulerBorder', 'Color of the overview ruler border.'));
39+
export const editorOverviewRulerBackground = registerColor('editorOverviewRuler.background', null, nls.localize('editorOverviewRulerBackground', 'Background color of the editor overview ruler. Only used when the minimap is enabled and placed on the right side of the editor.'));
3940

4041
export const editorGutter = registerColor('editorGutter.background', { dark: editorBackground, light: editorBackground, hc: editorBackground }, nls.localize('editorGutter', 'Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.'));
4142

src/vs/editor/common/viewModel/monospaceLineBreaksComputer.ts

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
119119
let breakingOffsets: number[] = arrPool1;
120120
let breakingOffsetsVisibleColumn: number[] = arrPool2;
121121
let breakingOffsetsCount: number = 0;
122+
let lastBreakingOffset = 0;
123+
let lastBreakingOffsetVisibleColumn = 0;
122124

123125
let breakingColumn = firstLineBreakColumn;
124126
const prevLen = prevBreakingOffsets.length;
@@ -138,8 +140,12 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
138140

139141
while (prevIndex < prevLen) {
140142
// Allow for prevIndex to be -1 (for the case where we hit a tab when walking backwards from the first break)
141-
const prevBreakOffset = prevIndex < 0 ? 0 : prevBreakingOffsets[prevIndex];
142-
const prevBreakoffsetVisibleColumn = prevIndex < 0 ? 0 : prevBreakingOffsetsVisibleColumn[prevIndex];
143+
let prevBreakOffset = prevIndex < 0 ? 0 : prevBreakingOffsets[prevIndex];
144+
let prevBreakOffsetVisibleColumn = prevIndex < 0 ? 0 : prevBreakingOffsetsVisibleColumn[prevIndex];
145+
if (lastBreakingOffset > prevBreakOffset) {
146+
prevBreakOffset = lastBreakingOffset;
147+
prevBreakOffsetVisibleColumn = lastBreakingOffsetVisibleColumn;
148+
}
143149

144150
let breakOffset = 0;
145151
let breakOffsetVisibleColumn = 0;
@@ -148,10 +154,10 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
148154
let forcedBreakOffsetVisibleColumn = 0;
149155

150156
// initially, we search as much as possible to the right (if it fits)
151-
if (prevBreakoffsetVisibleColumn <= breakingColumn) {
152-
let visibleColumn = prevBreakoffsetVisibleColumn;
153-
let prevCharCode = lineText.charCodeAt(prevBreakOffset - 1);
154-
let prevCharCodeClass = classifier.get(prevCharCode);
157+
if (prevBreakOffsetVisibleColumn <= breakingColumn) {
158+
let visibleColumn = prevBreakOffsetVisibleColumn;
159+
let prevCharCode = prevBreakOffset === 0 ? CharCode.Null : lineText.charCodeAt(prevBreakOffset - 1);
160+
let prevCharCodeClass = prevBreakOffset === 0 ? CharacterClass.NONE : classifier.get(prevCharCode);
155161
let entireLineFits = true;
156162
for (let i = prevBreakOffset; i < len; i++) {
157163
const charStartOffset = i;
@@ -169,7 +175,7 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
169175
charWidth = computeCharWidth(charCode, visibleColumn, tabSize, columnsForFullWidthChar);
170176
}
171177

172-
if (canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {
178+
if (charStartOffset > lastBreakingOffset && canBreak(prevCharCode, prevCharCodeClass, charCode, charCodeClass)) {
173179
breakOffset = charStartOffset;
174180
breakOffsetVisibleColumn = visibleColumn;
175181
}
@@ -179,8 +185,14 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
179185
// check if adding character at `i` will go over the breaking column
180186
if (visibleColumn > breakingColumn) {
181187
// We need to break at least before character at `i`:
182-
forcedBreakOffset = charStartOffset;
183-
forcedBreakOffsetVisibleColumn = visibleColumn - charWidth;
188+
if (charStartOffset > lastBreakingOffset) {
189+
forcedBreakOffset = charStartOffset;
190+
forcedBreakOffsetVisibleColumn = visibleColumn - charWidth;
191+
} else {
192+
// we need to advance at least by one character
193+
forcedBreakOffset = i + 1;
194+
forcedBreakOffsetVisibleColumn = visibleColumn;
195+
}
184196

185197
if (visibleColumn - breakOffsetVisibleColumn > wrappedLineBreakColumn) {
186198
// Cannot break at `breakOffset` => reset it if it was set
@@ -198,7 +210,7 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
198210
if (entireLineFits) {
199211
// there is no more need to break => stop the outer loop!
200212
if (breakingOffsetsCount > 0) {
201-
// Add last segment
213+
// Add last segment, no need to assign to `lastBreakingOffset` and `lastBreakingOffsetVisibleColumn`
202214
breakingOffsets[breakingOffsetsCount] = prevBreakingOffsets[prevBreakingOffsets.length - 1];
203215
breakingOffsetsVisibleColumn[breakingOffsetsCount] = prevBreakingOffsetsVisibleColumn[prevBreakingOffsets.length - 1];
204216
breakingOffsetsCount++;
@@ -209,11 +221,11 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
209221

210222
if (breakOffset === 0) {
211223
// must search left
212-
let visibleColumn = prevBreakoffsetVisibleColumn;
224+
let visibleColumn = prevBreakOffsetVisibleColumn;
213225
let charCode = lineText.charCodeAt(prevBreakOffset);
214226
let charCodeClass = classifier.get(charCode);
215227
let hitATabCharacter = false;
216-
for (let i = prevBreakOffset - 1; i >= 0; i--) {
228+
for (let i = prevBreakOffset - 1; i >= lastBreakingOffset; i--) {
217229
const charStartOffset = i + 1;
218230
const prevCharCode = lineText.charCodeAt(i);
219231

@@ -290,7 +302,9 @@ function createLineBreaksFromPreviousLineBreaks(classifier: WrappingCharacterCla
290302
breakOffsetVisibleColumn = forcedBreakOffsetVisibleColumn;
291303
}
292304

305+
lastBreakingOffset = breakOffset;
293306
breakingOffsets[breakingOffsetsCount] = breakOffset;
307+
lastBreakingOffsetVisibleColumn = breakOffsetVisibleColumn;
294308
breakingOffsetsVisibleColumn[breakingOffsetsCount] = breakOffsetVisibleColumn;
295309
breakingOffsetsCount++;
296310
breakingColumn = breakOffsetVisibleColumn + wrappedLineBreakColumn;

src/vs/editor/test/common/viewModel/monospaceLineBreaksComputer.test.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ suite('Editor ViewModel - MonospaceLineBreaksComputer', () => {
147147

148148
test('MonospaceLineBreaksComputer incremental 1', () => {
149149

150-
let factory = new MonospaceLineBreaksComputerFactory(EditorOptions.wordWrapBreakBeforeCharacters.defaultValue, EditorOptions.wordWrapBreakAfterCharacters.defaultValue);
150+
const factory = new MonospaceLineBreaksComputerFactory(EditorOptions.wordWrapBreakBeforeCharacters.defaultValue, EditorOptions.wordWrapBreakAfterCharacters.defaultValue);
151151

152152
assertIncrementalLineBreaks(
153153
factory, 'just some text and more', 4,
@@ -203,6 +203,17 @@ suite('Editor ViewModel - MonospaceLineBreaksComputer', () => {
203203
);
204204
});
205205

206+
test('issue #95686: CRITICAL: loop forever on the monospaceLineBreaksComputer', () => {
207+
const factory = new MonospaceLineBreaksComputerFactory(EditorOptions.wordWrapBreakBeforeCharacters.defaultValue, EditorOptions.wordWrapBreakAfterCharacters.defaultValue);
208+
assertIncrementalLineBreaks(
209+
factory,
210+
' <tr dmx-class:table-danger="(alt <= 50)" dmx-class:table-warning="(alt <= 200)" dmx-class:table-primary="(alt <= 400)" dmx-class:table-info="(alt <= 800)" dmx-class:table-success="(alt >= 400)">',
211+
4,
212+
179, ' <tr dmx-class:table-danger="(alt <= 50)" dmx-class:table-warning="(alt <= 200)" dmx-class:table-primary="(alt <= 400)" dmx-class:table-info="(alt <= 800)" |dmx-class:table-success="(alt >= 400)">',
213+
1, ' | | | | | |<|t|r| |d|m|x|-|c|l|a|s|s|:|t|a|b|l|e|-|d|a|n|g|e|r|=|"|(|a|l|t| |<|=| |5|0|)|"| |d|m|x|-|c|l|a|s|s|:|t|a|b|l|e|-|w|a|r|n|i|n|g|=|"|(|a|l|t| |<|=| |2|0|0|)|"| |d|m|x|-|c|l|a|s|s|:|t|a|b|l|e|-|p|r|i|m|a|r|y|=|"|(|a|l|t| |<|=| |4|0|0|)|"| |d|m|x|-|c|l|a|s|s|:|t|a|b|l|e|-|i|n|f|o|=|"|(|a|l|t| |<|=| |8|0|0|)|"| |d|m|x|-|c|l|a|s|s|:|t|a|b|l|e|-|s|u|c|c|e|s|s|=|"|(|a|l|t| |>|=| |4|0|0|)|"|>',
214+
WrappingIndent.Same
215+
);
216+
});
206217

207218
test('MonospaceLineBreaksComputer - CJK and Kinsoku Shori', () => {
208219
let factory = new MonospaceLineBreaksComputerFactory('(', '\t)');

src/vs/vscode.proposed.d.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -720,37 +720,38 @@ declare module 'vscode' {
720720
//#region debug: https://github.com/microsoft/vscode/issues/88230
721721

722722
/**
723-
* VS Code can call the `provideDebugConfigurations` method of a `DebugConfigurationProvider` in two situations (aka 'scopes'):
724-
* to provide the initial debug configurations for a newly created launch.json or to provide debug configurations dynamically based on context.
725-
* A scope can be used when registering a `DebugConfigurationProvider` with #debug.registerDebugConfigurationProvider.
723+
* A DebugConfigurationProviderTrigger specifies when the `provideDebugConfigurations` method of a `DebugConfigurationProvider` is triggered.
724+
* Currently there are two situations: to provide the initial debug configurations for a newly created launch.json or
725+
* to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).
726+
* A trigger is used when registering a `DebugConfigurationProvider` with #debug.registerDebugConfigurationProvider.
726727
*/
727-
export enum DebugConfigurationProviderScope {
728+
export enum DebugConfigurationProviderTrigger {
728729
/**
729-
* The 'initial' scope is used to ask for debug configurations to be copied into a newly created launch.json.
730+
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug configurations for a newly created launch.json.
730731
*/
731732
Initial = 1,
732733
/**
733-
* The 'dynamic' scope is used to ask for additional dynamic debug configurations to be presented to the user (in addition to the static configurations from the launch.json).
734+
* `DebugConfigurationProvider.provideDebugConfigurations` is called to provide dynamically generated debug configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).
734735
*/
735736
Dynamic = 2
736737
}
737738

738739
export namespace debug {
739740
/**
740741
* Register a [debug configuration provider](#DebugConfigurationProvider) for a specific debug type.
741-
* The optional [scope](#DebugConfigurationProviderScope) argument can be used to bind the `provideDebugConfigurations` method of the provider to a specific context (aka scope).
742-
* Currently two scopes are possible: with the value `Initial` (or if no scope argument is given) the `provideDebugConfigurations` method is used to find the initial debug configurations to be copied into a newly created launch.json.
743-
* With a scope value `Dynamic` the `provideDebugConfigurations` method is used to dynamically determine debug configurations to be presented to the user in addition to the static configurations from the launch.json.
744-
* Please note that the scope argument only applies to the `provideDebugConfigurations` method: so the `resolveDebugConfiguration` methods are not affected at all.
745-
* Registering a single provider with resolve methods for different scopes, results in the same resolve methods called multiple times.
742+
* The optional [trigger](#DebugConfigurationProviderTrigger) can be used to specify when the `provideDebugConfigurations` method of the provider is triggered.
743+
* Currently two triggers are possible: with the value `Initial` (or if no trigger argument is given) the `provideDebugConfigurations` method is used to provide the initial debug configurations to be copied into a newly created launch.json.
744+
* With the trigger `Dynamic` the `provideDebugConfigurations` method is used to dynamically determine debug configurations to be presented to the user (in addition to the static configurations from the launch.json).
745+
* Please note that the `trigger` argument only applies to the `provideDebugConfigurations` method: so the `resolveDebugConfiguration` methods are not affected at all.
746+
* Registering a single provider with resolve methods for different triggers, results in the same resolve methods called multiple times.
746747
* More than one provider can be registered for the same type.
747748
*
748749
* @param type The debug type for which the provider is registered.
749750
* @param provider The [debug configuration provider](#DebugConfigurationProvider) to register.
750-
* @param scope The [scope](#DebugConfigurationProviderScope) for which the 'provideDebugConfiguration' method of the provider is registered.
751+
* @param trigger The [trigger](#DebugConfigurationProviderTrigger) for which the 'provideDebugConfiguration' method of the provider is registered.
751752
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
752753
*/
753-
export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, scope?: DebugConfigurationProviderScope): Disposable;
754+
export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider, trigger?: DebugConfigurationProviderTrigger): Disposable;
754755
}
755756

756757
// deprecated debug API

src/vs/workbench/api/browser/mainThreadDebugService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import severity from 'vs/base/common/severity';
1515
import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/common/abstractDebugAdapter';
1616
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
1717
import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/contrib/debug/common/debugUtils';
18-
import { DebugConfigurationProviderScope } from 'vs/workbench/api/common/extHostTypes';
18+
import { DebugConfigurationProviderTrigger } from 'vs/workbench/api/common/extHostTypes';
1919

2020
@extHostNamedCustomer(MainContext.MainThreadDebugService)
2121
export class MainThreadDebugService implements MainThreadDebugServiceShape, IDebugAdapterFactory {
@@ -155,11 +155,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
155155
return Promise.resolve();
156156
}
157157

158-
public $registerDebugConfigurationProvider(debugType: string, providerScope: DebugConfigurationProviderScope, hasProvide: boolean, hasResolve: boolean, hasResolve2: boolean, hasProvideDebugAdapter: boolean, handle: number): Promise<void> {
158+
public $registerDebugConfigurationProvider(debugType: string, providerTrigger: DebugConfigurationProviderTrigger, hasProvide: boolean, hasResolve: boolean, hasResolve2: boolean, hasProvideDebugAdapter: boolean, handle: number): Promise<void> {
159159

160160
const provider = <IDebugConfigurationProvider>{
161161
type: debugType,
162-
scope: providerScope
162+
trigger: providerTrigger
163163
};
164164
if (hasProvide) {
165165
provider.provideDebugConfigurations = (folder, token) => {

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
844844
onDidChangeBreakpoints(listener, thisArgs?, disposables?) {
845845
return extHostDebugService.onDidChangeBreakpoints(listener, thisArgs, disposables);
846846
},
847-
registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, scope?: vscode.DebugConfigurationProviderScope) {
848-
return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, scope || extHostTypes.DebugConfigurationProviderScope.Initial);
847+
registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, trigger?: vscode.DebugConfigurationProviderTrigger) {
848+
return extHostDebugService.registerDebugConfigurationProvider(debugType, provider, trigger || extHostTypes.DebugConfigurationProviderTrigger.Initial);
849849
},
850850
registerDebugAdapterDescriptorFactory(debugType: string, factory: vscode.DebugAdapterDescriptorFactory) {
851851
return extHostDebugService.registerDebugAdapterDescriptorFactory(extension, debugType, factory);
@@ -1045,7 +1045,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
10451045
CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall,
10461046
CallHierarchyItem: extHostTypes.CallHierarchyItem,
10471047
DebugConsoleMode: extHostTypes.DebugConsoleMode,
1048-
DebugConfigurationProviderScope: extHostTypes.DebugConfigurationProviderScope,
1048+
DebugConfigurationProviderTrigger: extHostTypes.DebugConfigurationProviderTrigger,
10491049
Decoration: extHostTypes.Decoration,
10501050
UIKind: UIKind,
10511051
ColorThemeKind: extHostTypes.ColorThemeKind,

0 commit comments

Comments
 (0)