mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 10:37:38 +01:00
Fixes space in #139023.
This commit is contained in:
@@ -68,30 +68,48 @@ class InlineSegment {
|
||||
}
|
||||
}
|
||||
|
||||
function createInlineValueDecoration(lineNumber: number, contentText: string, column = Constants.MAX_SAFE_SMALL_INTEGER): IModelDeltaDecoration {
|
||||
function createInlineValueDecoration(lineNumber: number, contentText: string, column = Constants.MAX_SAFE_SMALL_INTEGER): IModelDeltaDecoration[] {
|
||||
// If decoratorText is too long, trim and add ellipses. This could happen for minified files with everything on a single line
|
||||
if (contentText.length > MAX_INLINE_DECORATOR_LENGTH) {
|
||||
contentText = contentText.substring(0, MAX_INLINE_DECORATOR_LENGTH) + '...';
|
||||
}
|
||||
|
||||
return {
|
||||
range: {
|
||||
startLineNumber: lineNumber,
|
||||
endLineNumber: lineNumber,
|
||||
startColumn: column,
|
||||
endColumn: column
|
||||
},
|
||||
options: {
|
||||
description: 'debug-inline-value-decoration',
|
||||
after: {
|
||||
content: replaceWsWithNoBreakWs(contentText),
|
||||
inlineClassName: 'debug-inline-value',
|
||||
inlineClassNameAffectsLetterSpacing: true,
|
||||
cursorStops: InjectedTextCursorStops.Left
|
||||
return [
|
||||
{
|
||||
range: {
|
||||
startLineNumber: lineNumber,
|
||||
endLineNumber: lineNumber,
|
||||
startColumn: column,
|
||||
endColumn: column
|
||||
},
|
||||
showIfCollapsed: true
|
||||
}
|
||||
};
|
||||
options: {
|
||||
description: 'debug-inline-value-decoration-spacer',
|
||||
after: {
|
||||
content: strings.noBreakWhitespace,
|
||||
cursorStops: InjectedTextCursorStops.None
|
||||
},
|
||||
showIfCollapsed: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
range: {
|
||||
startLineNumber: lineNumber,
|
||||
endLineNumber: lineNumber,
|
||||
startColumn: column,
|
||||
endColumn: column
|
||||
},
|
||||
options: {
|
||||
description: 'debug-inline-value-decoration',
|
||||
after: {
|
||||
content: replaceWsWithNoBreakWs(contentText),
|
||||
inlineClassName: 'debug-inline-value',
|
||||
inlineClassNameAffectsLetterSpacing: true,
|
||||
cursorStops: InjectedTextCursorStops.None
|
||||
},
|
||||
showIfCollapsed: true,
|
||||
}
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function replaceWsWithNoBreakWs(str: string): string {
|
||||
@@ -135,7 +153,7 @@ function createInlineValueDecorationsInsideRange(expressions: ReadonlyArray<IExp
|
||||
const content = model.getLineContent(line);
|
||||
return content.indexOf(first) - content.indexOf(second);
|
||||
}).map(name => `${name} = ${nameValueMap.get(name)}`).join(', ');
|
||||
decorations.push(createInlineValueDecoration(line, contentText));
|
||||
decorations.push(...createInlineValueDecoration(line, contentText));
|
||||
});
|
||||
|
||||
return decorations;
|
||||
@@ -700,7 +718,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
|
||||
if (segments.length > 0) {
|
||||
segments = segments.sort((a, b) => a.column - b.column);
|
||||
const text = segments.map(s => s.text).join(separator);
|
||||
allDecorations.push(createInlineValueDecoration(line, text));
|
||||
allDecorations.push(...createInlineValueDecoration(line, text));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -118,6 +118,5 @@
|
||||
|
||||
.monaco-workbench .debug-inline-value {
|
||||
background-color: var(--vscode-editor-inlineValuesBackground);
|
||||
margin: 10px;
|
||||
color: var(--vscode-editor-inlineValuesForeground);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user