Skip to content

Commit 5e0799a

Browse files
committed
Merge branch 'main' into merogge/quick-fix-api
2 parents 67e61c3 + 6b279eb commit 5e0799a

File tree

128 files changed

+1529
-806
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1529
-806
lines changed

build/.moduleignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ prebuild-install/**/*
147147
**/*.ts
148148
!typescript/**/*.d.ts
149149

150+
# Exclude TS files that aren't needed by TS extension
151+
typescript/lib/tsc.js
152+
typescript/lib/typescriptServices.js
153+
typescript/lib/tsserverlibrary.js
154+
150155
jschardet/index.js
151156
jschardet/src/**
152157
jschardet/dist/jschardet.js
@@ -167,5 +172,3 @@ xterm-addon-*/src/**
167172
xterm-addon-*/fixtures/**
168173
xterm-addon-*/out/**
169174
xterm-addon-*/out-test/**
170-
171-

cli/src/util/prereqs.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ async fn check_is_nixos() -> bool {
157157
async fn check_glibcxx_version() -> Result<(), String> {
158158
let mut libstdc_path: Option<String> = None;
159159

160+
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
160161
const DEFAULT_LIB_PATH: &str = "/usr/lib64/libstdc++.so.6";
162+
#[cfg(any(target_arch = "x86", target_arch = "arm"))]
163+
const DEFAULT_LIB_PATH: &str = "/usr/lib/libstdc++.so.6";
161164
const LDCONFIG_PATH: &str = "/sbin/ldconfig";
162165

163166
if fs::metadata(DEFAULT_LIB_PATH).await.is_ok() {

extensions/.vscodeignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

extensions/notebook-renderers/src/index.ts

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import type { ActivationFunction, OutputItem, RendererContext } from 'vscode-notebook-renderer';
7-
import { truncatedArrayOfString } from './textHelper';
7+
import { insertOutput } from './textHelper';
88

99
interface IDisposable {
1010
dispose(): void;
@@ -28,6 +28,11 @@ interface JavaScriptRenderingHook {
2828
preEvaluate(outputItem: OutputItem, element: HTMLElement, script: string, signal: AbortSignal): string | undefined | Promise<string | undefined>;
2929
}
3030

31+
interface RenderOptions {
32+
readonly lineLimit: number;
33+
readonly outputScrolling: boolean;
34+
}
35+
3136
function clearContainer(container: HTMLElement) {
3237
while (container.firstChild) {
3338
container.removeChild(container.firstChild);
@@ -120,7 +125,7 @@ async function renderJavascript(outputInfo: OutputItem, container: HTMLElement,
120125
domEval(element);
121126
}
122127

123-
function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: { readonly lineLimit: number } }): void {
128+
function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: RenderOptions }): void {
124129
const element = document.createElement('div');
125130
container.appendChild(element);
126131
type ErrorLike = Partial<Error>;
@@ -138,7 +143,7 @@ function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: Render
138143
stack.classList.add('traceback');
139144
stack.style.margin = '8px 0';
140145
const element = document.createElement('span');
141-
truncatedArrayOfString(outputInfo.id, [err.stack ?? ''], ctx.settings.lineLimit, element);
146+
insertOutput(outputInfo.id, [err.stack ?? ''], ctx.settings.lineLimit, false, element);
142147
stack.appendChild(element);
143148
container.appendChild(stack);
144149
} else {
@@ -153,7 +158,7 @@ function renderError(outputInfo: OutputItem, container: HTMLElement, ctx: Render
153158
container.classList.add('error');
154159
}
155160

156-
function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boolean, ctx: RendererContext<void> & { readonly settings: { readonly lineLimit: number } }): void {
161+
function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boolean, ctx: RendererContext<void> & { readonly settings: RenderOptions }): void {
157162
const outputContainer = container.parentElement;
158163
if (!outputContainer) {
159164
// should never happen
@@ -170,7 +175,7 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
170175
const text = outputInfo.text();
171176

172177
const element = document.createElement('span');
173-
truncatedArrayOfString(outputInfo.id, [text], ctx.settings.lineLimit, element);
178+
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, element);
174179
outputElement.appendChild(element);
175180
return;
176181
}
@@ -180,7 +185,7 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
180185
element.classList.add('output-stream');
181186

182187
const text = outputInfo.text();
183-
truncatedArrayOfString(outputInfo.id, [text], ctx.settings.lineLimit, element);
188+
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, element);
184189
while (container.firstChild) {
185190
container.removeChild(container.firstChild);
186191
}
@@ -191,12 +196,12 @@ function renderStream(outputInfo: OutputItem, container: HTMLElement, error: boo
191196
}
192197
}
193198

194-
function renderText(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: { readonly lineLimit: number } }): void {
199+
function renderText(outputInfo: OutputItem, container: HTMLElement, ctx: RendererContext<void> & { readonly settings: RenderOptions }): void {
195200
clearContainer(container);
196201
const contentNode = document.createElement('div');
197202
contentNode.classList.add('output-plaintext');
198203
const text = outputInfo.text();
199-
truncatedArrayOfString(outputInfo.id, [text], ctx.settings.lineLimit, contentNode);
204+
insertOutput(outputInfo.id, [text], ctx.settings.lineLimit, ctx.settings.outputScrolling, contentNode);
200205
container.appendChild(contentNode);
201206
}
202207

@@ -205,26 +210,36 @@ export const activate: ActivationFunction<void> = (ctx) => {
205210
const htmlHooks = new Set<HtmlRenderingHook>();
206211
const jsHooks = new Set<JavaScriptRenderingHook>();
207212

208-
const latestContext = ctx as (RendererContext<void> & { readonly settings: { readonly lineLimit: number } });
213+
const latestContext = ctx as (RendererContext<void> & { readonly settings: RenderOptions });
209214

210215
const style = document.createElement('style');
211216
style.textContent = `
212217
.output-plaintext,
213218
.output-stream,
214219
.traceback {
220+
display: inline-block;
221+
white-space: pre-wrap;
222+
width: 100%;
215223
line-height: var(--notebook-cell-output-line-height);
216224
font-family: var(--notebook-cell-output-font-family);
217-
white-space: pre-wrap;
218-
word-wrap: break-word;
219-
220225
font-size: var(--notebook-cell-output-font-size);
221226
user-select: text;
222227
-webkit-user-select: text;
223228
-ms-user-select: text;
224229
cursor: auto;
225230
}
226-
span.output-stream {
227-
display: inline-block;
231+
output-plaintext,
232+
.traceback {
233+
word-wrap: break-word;
234+
}
235+
.output > span.scrollable {
236+
overflow-y: scroll;
237+
max-height: var(--notebook-cell-output-max-height);
238+
border: var(--vscode-editorWidget-border);
239+
border-style: solid;
240+
padding-left: 4px;
241+
box-sizing: border-box;
242+
border-width: 1px;
228243
}
229244
.output-plaintext .code-bold,
230245
.output-stream .code-bold,

extensions/notebook-renderers/src/textHelper.ts

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,35 @@
55

66
import { handleANSIOutput } from './ansi';
77

8-
function generateViewMoreElement(outputId: string) {
8+
function generateViewMoreElement(outputId: string, adjustableSize: boolean) {
99
const container = document.createElement('span');
1010
const first = document.createElement('span');
11-
first.textContent = 'Output exceeds the ';
12-
const second = document.createElement('a');
13-
second.textContent = 'size limit';
14-
second.href = `command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D`;
11+
12+
if (adjustableSize) {
13+
first.textContent = 'Output exceeds the ';
14+
const second = document.createElement('a');
15+
second.textContent = 'size limit';
16+
second.href = `command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D`;
17+
container.appendChild(first);
18+
container.appendChild(second);
19+
} else {
20+
first.textContent = 'Output exceeds the maximium size limit';
21+
container.appendChild(first);
22+
}
23+
1524
const third = document.createElement('span');
16-
third.textContent = '. Open the full output data';
25+
third.textContent = '. Open the full output data ';
1726
const forth = document.createElement('a');
18-
forth.textContent = ' in a text editor';
27+
forth.textContent = 'in a text editor';
1928
forth.href = `command:workbench.action.openLargeOutput?${outputId}`;
20-
container.appendChild(first);
21-
container.appendChild(second);
2229
container.appendChild(third);
2330
container.appendChild(forth);
2431
return container;
2532
}
2633

27-
export function truncatedArrayOfString(id: string, outputs: string[], linesLimit: number, container: HTMLElement) {
28-
const buffer = outputs.join('\n').split(/\r\n|\r|\n/g);
34+
function truncatedArrayOfString(id: string, buffer: string[], linesLimit: number, container: HTMLElement) {
2935
const lineCount = buffer.length;
30-
31-
if (lineCount < linesLimit) {
32-
const spanElement = handleANSIOutput(buffer.slice(0, linesLimit).join('\n'));
33-
container.appendChild(spanElement);
34-
return;
35-
}
36-
37-
container.appendChild(generateViewMoreElement(id));
36+
container.appendChild(generateViewMoreElement(id, true));
3837

3938
const div = document.createElement('div');
4039
container.appendChild(div);
@@ -49,3 +48,31 @@ export function truncatedArrayOfString(id: string, outputs: string[], linesLimit
4948
container.appendChild(div2);
5049
div2.appendChild(handleANSIOutput(buffer.slice(lineCount - 5).join('\n')));
5150
}
51+
52+
function scrollableArrayOfString(id: string, buffer: string[], container: HTMLElement) {
53+
container.classList.add('scrollable');
54+
55+
if (buffer.length > 5000) {
56+
container.appendChild(generateViewMoreElement(id, false));
57+
}
58+
const div = document.createElement('div');
59+
container.appendChild(div);
60+
div.appendChild(handleANSIOutput(buffer.slice(0, 5000).join('\n')));
61+
}
62+
63+
export function insertOutput(id: string, outputs: string[], linesLimit: number, scrollable: boolean, container: HTMLElement) {
64+
const buffer = outputs.join('\n').split(/\r\n|\r|\n/g);
65+
const lineCount = buffer.length;
66+
67+
if (lineCount < linesLimit) {
68+
const spanElement = handleANSIOutput(buffer.join('\n'));
69+
container.appendChild(spanElement);
70+
return;
71+
}
72+
73+
if (scrollable) {
74+
scrollableArrayOfString(id, buffer, container);
75+
} else {
76+
truncatedArrayOfString(id, buffer, linesLimit, container);
77+
}
78+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.74.0",
4-
"distro": "7153817c51ee07fd57e84a33afdaede63b3937f8",
4+
"distro": "540bfe34933334669527ef1900a9e112965fbdde",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

src/vs/base/browser/ui/sash/sash.css

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
:root {
7-
--sash-size: 4px;
7+
--vscode-sash-size: 4px;
88
}
99

1010
.monaco-sash {
@@ -49,21 +49,21 @@
4949
.monaco-sash.vertical {
5050
cursor: ew-resize;
5151
top: 0;
52-
width: var(--sash-size);
52+
width: var(--vscode-sash-size);
5353
height: 100%;
5454
}
5555

5656
.monaco-sash.horizontal {
5757
cursor: ns-resize;
5858
left: 0;
5959
width: 100%;
60-
height: var(--sash-size);
60+
height: var(--vscode-sash-size);
6161
}
6262

6363
.monaco-sash:not(.disabled) > .orthogonal-drag-handle {
6464
content: " ";
65-
height: calc(var(--sash-size) * 2);
66-
width: calc(var(--sash-size) * 2);
65+
height: calc(var(--vscode-sash-size) * 2);
66+
width: calc(var(--vscode-sash-size) * 2);
6767
z-index: 100;
6868
display: block;
6969
cursor: all-scroll;
@@ -85,20 +85,20 @@
8585
}
8686

8787
.monaco-sash.vertical > .orthogonal-drag-handle.start {
88-
left: calc(var(--sash-size) * -0.5);
89-
top: calc(var(--sash-size) * -1);
88+
left: calc(var(--vscode-sash-size) * -0.5);
89+
top: calc(var(--vscode-sash-size) * -1);
9090
}
9191
.monaco-sash.vertical > .orthogonal-drag-handle.end {
92-
left: calc(var(--sash-size) * -0.5);
93-
bottom: calc(var(--sash-size) * -1);
92+
left: calc(var(--vscode-sash-size) * -0.5);
93+
bottom: calc(var(--vscode-sash-size) * -1);
9494
}
9595
.monaco-sash.horizontal > .orthogonal-drag-handle.start {
96-
top: calc(var(--sash-size) * -0.5);
97-
left: calc(var(--sash-size) * -1);
96+
top: calc(var(--vscode-sash-size) * -0.5);
97+
left: calc(var(--vscode-sash-size) * -1);
9898
}
9999
.monaco-sash.horizontal > .orthogonal-drag-handle.end {
100-
top: calc(var(--sash-size) * -0.5);
101-
right: calc(var(--sash-size) * -1);
100+
top: calc(var(--vscode-sash-size) * -0.5);
101+
right: calc(var(--vscode-sash-size) * -1);
102102
}
103103

104104
.monaco-sash:before {
@@ -117,13 +117,13 @@
117117
}
118118

119119
.monaco-sash.vertical:before {
120-
width: var(--sash-hover-size);
121-
left: calc(50% - (var(--sash-hover-size) / 2));
120+
width: var(--vscode-sash-hover-size);
121+
left: calc(50% - (var(--vscode-sash-hover-size) / 2));
122122
}
123123

124124
.monaco-sash.horizontal:before {
125-
height: var(--sash-hover-size);
126-
top: calc(50% - (var(--sash-hover-size) / 2));
125+
height: var(--vscode-sash-hover-size);
126+
top: calc(50% - (var(--vscode-sash-hover-size) / 2));
127127
}
128128

129129
.pointer-events-disabled {

src/vs/base/browser/ui/scrollbar/media/scrollbars.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
left: 0;
5353
height: 3px;
5454
width: 3px;
55+
}
56+
.monaco-scrollable-element > .shadow.top.left {
5557
box-shadow: var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset;
5658
}
5759

src/vs/base/browser/ui/table/table.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
4747
content: "";
4848
position: absolute;
49-
left: calc(var(--sash-size) / 2);
49+
left: calc(var(--vscode-sash-size) / 2);
5050
width: 0;
5151
border-left: 1px solid transparent;
5252
}

src/vs/base/common/ime.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { Emitter } from 'vs/base/common/event';
7+
8+
export class IMEImpl {
9+
10+
private readonly _onDidChange = new Emitter<void>();
11+
public readonly onDidChange = this._onDidChange.event;
12+
13+
private _enabled = true;
14+
15+
public get enabled() {
16+
return this._enabled;
17+
}
18+
19+
/**
20+
* Enable IME
21+
*/
22+
public enable(): void {
23+
this._enabled = true;
24+
this._onDidChange.fire();
25+
}
26+
27+
/**
28+
* Disable IME
29+
*/
30+
public disable(): void {
31+
this._enabled = false;
32+
this._onDidChange.fire();
33+
}
34+
}
35+
36+
export const IME = new IMEImpl();

0 commit comments

Comments
 (0)