Skip to content

Commit 93bcc63

Browse files
committed
Fix up after rebase
1 parent e96c06f commit 93bcc63

File tree

7 files changed

+162
-127
lines changed

7 files changed

+162
-127
lines changed

vscode-wpilib/media/main.css

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
.uninstall-button {
4949
padding: 4px !important;
5050

51-
&>i {
51+
& > i {
5252
margin-right: 4px !important;
5353
margin-left: 4px !important;
5454
}
@@ -63,11 +63,11 @@
6363
flex-shrink: 2;
6464
}
6565

66-
button[id*="install-action"] {
66+
button[id*='install-action'] {
6767
flex-shrink: 0;
6868
}
6969

70-
button[id*="version-action"] {
70+
button[id*='version-action'] {
7171
overflow: visible;
7272
padding: 1px 6px;
7373
}
@@ -134,7 +134,7 @@ html {
134134
padding: 0;
135135
}
136136

137-
.vscode-select select[multiple]+.chevron-icon {
137+
.vscode-select select[multiple] + .chevron-icon {
138138
display: none;
139139
}
140140

@@ -267,7 +267,7 @@ html {
267267

268268
/* collapsible */
269269

270-
.vscode-collapsible+.vscode-collapsible {
270+
.vscode-collapsible + .vscode-collapsible {
271271
border-top: 1px solid var(--vscode-sideBarSectionHeader-border);
272272
}
273273

@@ -330,7 +330,6 @@ html {
330330
margin-right: 4px;
331331
}
332332

333-
334333
.vscode-badge {
335334
background-color: var(--vscode-badge-background);
336335
border: 1px solid var(--vscode-contrastBorder, transparent);
@@ -576,13 +575,13 @@ input::-webkit-inner-spin-button {
576575
margin: 0;
577576
}
578577

579-
input[type=number] {
578+
input[type='number'] {
580579
-moz-appearance: textfield;
581580
appearance: textfield;
582581
}
583582

584583
/* File input styling for the log viewer mode */
585-
input[type="file"] {
584+
input[type='file'] {
586585
display: none;
587586
}
588587

@@ -693,7 +692,7 @@ label.toolbar-button {
693692
font-size: 16px;
694693
margin-bottom: 12px;
695694
color: var(--vscode-foreground);
696-
width: 100%
695+
width: 100%;
697696
}
698697

699698
.project-error-text {
@@ -929,8 +928,8 @@ button:disabled {
929928
cursor: not-allowed;
930929
}
931930

932-
input[type="text"],
933-
input[type="number"] {
931+
input[type='text'],
932+
input[type='number'] {
934933
background-color: var(--vscode-input-background, white);
935934
color: var(--vscode-input-foreground, black);
936935
border: 1px solid var(--vscode-input-border, #ccc);

vscode-wpilib/src/riolog/ansi/ansiparser.ts

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ export interface AnsiState {
1212
}
1313

1414
// Color mapping for standard ANSI colors
15-
const foregroundColors: {[key: number]: string} = {
16-
30: '#000000', // black
17-
31: '#f44336', // red
18-
32: '#4caf50', // green
19-
33: '#ffeb3b', // yellow
20-
34: '#2196f3', // blue
21-
35: '#e91e63', // magenta
22-
36: '#00bcd4', // cyan
23-
37: '#ffffff', // white
24-
90: '#9e9e9e', // gray
25-
91: '#ff5252', // lightred
26-
92: '#8bc34a', // lightgreen
27-
93: '#ffc107', // lightyellow
28-
94: '#03a9f4', // lightblue
29-
95: '#ec407a', // lightmagenta
30-
96: '#26c6da', // lightcyan
31-
97: '#fafafa', // white
15+
const foregroundColors: { [key: number]: string } = {
16+
30: '#000000', // black
17+
31: '#f44336', // red
18+
32: '#4caf50', // green
19+
33: '#ffeb3b', // yellow
20+
34: '#2196f3', // blue
21+
35: '#e91e63', // magenta
22+
36: '#00bcd4', // cyan
23+
37: '#ffffff', // white
24+
90: '#9e9e9e', // gray
25+
91: '#ff5252', // lightred
26+
92: '#8bc34a', // lightgreen
27+
93: '#ffc107', // lightyellow
28+
94: '#03a9f4', // lightblue
29+
95: '#ec407a', // lightmagenta
30+
96: '#26c6da', // lightcyan
31+
97: '#fafafa', // white
3232
};
3333

34-
const backgroundColors: {[key: number]: string} = {
35-
40: '#000000', // black
36-
41: '#f44336', // red
37-
42: '#4caf50', // green
38-
43: '#ffeb3b', // yellow
39-
44: '#2196f3', // blue
40-
45: '#e91e63', // magenta
41-
46: '#00bcd4', // cyan
42-
47: '#ffffff', // white
34+
const backgroundColors: { [key: number]: string } = {
35+
40: '#000000', // black
36+
41: '#f44336', // red
37+
42: '#4caf50', // green
38+
43: '#ffeb3b', // yellow
39+
44: '#2196f3', // blue
40+
45: '#e91e63', // magenta
41+
46: '#00bcd4', // cyan
42+
47: '#ffffff', // white
4343
100: '#9e9e9e', // gray
4444
101: '#ff5252', // lightred
4545
102: '#8bc34a', // lightgreen
@@ -59,28 +59,28 @@ export interface AnsiSegment {
5959
export function parseAnsiString(text: string): AnsiSegment[] {
6060
const result: AnsiSegment[] = [];
6161
const regex = /\u001b\[((?:\d+;)*\d*)m/g;
62-
62+
6363
let lastIndex = 0;
6464
let match: RegExpExecArray | null;
6565
let currentState: AnsiState = {};
66-
66+
6767
while ((match = regex.exec(text)) !== null) {
6868
// Add text before the escape sequence with current state
6969
const segment = text.substring(lastIndex, match.index);
7070
if (segment) {
7171
result.push({
7272
text: segment,
73-
state: { ...currentState }
73+
state: { ...currentState },
7474
});
7575
}
76-
76+
7777
// Update state based on escape sequence
78-
const codes = match[1].split(';').map(num => parseInt(num || '0', 10));
79-
78+
const codes = match[1].split(';').map((num) => parseInt(num || '0', 10));
79+
8080
// Process codes
8181
for (let i = 0; i < codes.length; i++) {
8282
const code = codes[i];
83-
83+
8484
// Process reset and text styles
8585
if (code === 0) {
8686
// Reset all attributes
@@ -108,16 +108,16 @@ export function parseAnsiString(text: string): AnsiSegment[] {
108108
delete currentState.foreground;
109109
} else if (code === 49) {
110110
delete currentState.background;
111-
}
111+
}
112112
// Standard colors
113113
else if ((code >= 30 && code <= 37) || (code >= 90 && code <= 97)) {
114114
currentState.foreground = foregroundColors[code];
115115
} else if ((code >= 40 && code <= 47) || (code >= 100 && code <= 107)) {
116116
currentState.background = backgroundColors[code];
117117
}
118118
// 8-bit color support (256 colors)
119-
else if (code === 38 && i + 2 < codes.length && codes[i+1] === 5) {
120-
const colorCode = codes[i+2];
119+
else if (code === 38 && i + 2 < codes.length && codes[i + 1] === 5) {
120+
const colorCode = codes[i + 2];
121121
// Generate 8-bit color
122122
if (colorCode < 8) {
123123
// Standard colors (0-7)
@@ -137,9 +137,8 @@ export function parseAnsiString(text: string): AnsiSegment[] {
137137
currentState.foreground = `rgb(${gray}, ${gray}, ${gray})`;
138138
}
139139
i += 2; // Skip the next two parameters
140-
}
141-
else if (code === 48 && i + 2 < codes.length && codes[i+1] === 5) {
142-
const colorCode = codes[i+2];
140+
} else if (code === 48 && i + 2 < codes.length && codes[i + 1] === 5) {
141+
const colorCode = codes[i + 2];
143142
// Same logic for background colors
144143
if (colorCode < 8) {
145144
currentState.background = backgroundColors[colorCode + 40];
@@ -157,34 +156,33 @@ export function parseAnsiString(text: string): AnsiSegment[] {
157156
i += 2; // Skip the next two parameters
158157
}
159158
// 24-bit color support (RGB)
160-
else if (code === 38 && i + 4 < codes.length && codes[i+1] === 2) {
161-
const r = codes[i+2];
162-
const g = codes[i+3];
163-
const b = codes[i+4];
159+
else if (code === 38 && i + 4 < codes.length && codes[i + 1] === 2) {
160+
const r = codes[i + 2];
161+
const g = codes[i + 3];
162+
const b = codes[i + 4];
164163
currentState.foreground = `rgb(${r}, ${g}, ${b})`;
165164
i += 4; // Skip the next four parameters
166-
}
167-
else if (code === 48 && i + 4 < codes.length && codes[i+1] === 2) {
168-
const r = codes[i+2];
169-
const g = codes[i+3];
170-
const b = codes[i+4];
165+
} else if (code === 48 && i + 4 < codes.length && codes[i + 1] === 2) {
166+
const r = codes[i + 2];
167+
const g = codes[i + 3];
168+
const b = codes[i + 4];
171169
currentState.background = `rgb(${r}, ${g}, ${b})`;
172170
i += 4; // Skip the next four parameters
173171
}
174172
}
175-
173+
176174
lastIndex = match.index + match[0].length;
177175
}
178-
176+
179177
// Add the remaining text with current state
180178
const remainingText = text.substring(lastIndex);
181179
if (remainingText) {
182180
result.push({
183181
text: remainingText,
184-
state: { ...currentState }
182+
state: { ...currentState },
185183
});
186184
}
187-
185+
188186
return result;
189187
}
190188

vscode-wpilib/src/riolog/riologwindow.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ export class RioLogWindow {
7979

8080
private createWebView() {
8181
this.webview = this.windowProvider.createWindowView();
82-
82+
8383
this.webview.on('windowActive', async () => {
8484
if (this.webview === undefined) {
8585
return;
8686
}
87-
87+
8888
// Window goes active.
8989
await this.webview.postMessage({
9090
message: this.hiddenArray,

vscode-wpilib/src/riolog/script/implscript.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
import { IIPCReceiveMessage, IIPCSendMessage } from '../shared/interfaces';
4-
import { checkResizeImpl, handleMessage } from '../shared/sharedscript';
3+
import { IIPCReceiveMessage, IIPCSendMessage } from 'wpilib-riolog';
4+
import { setImplFunctions, handleMessage } from '../shared/sharedscript';
55

66
interface IVsCodeApi {
77
postMessage(message: IIPCReceiveMessage, to: string): void;
@@ -15,7 +15,7 @@ export function checkResize(): void {
1515
// Get required elements
1616
const toolbar = document.getElementById('toolbar');
1717
const logContainer = document.getElementById('log-container');
18-
18+
1919
// Apply dynamic max-height calculation if both elements exist
2020
if (toolbar && logContainer) {
2121
logContainer.style.maxHeight = `calc(100vh - ${toolbar.offsetHeight}px)`;
@@ -34,7 +34,7 @@ export function sendMessage(message: IIPCReceiveMessage) {
3434
}
3535

3636
// Register the implementation functions with the shared module
37-
console.log('Setting impl functions')
37+
console.log('Setting impl functions');
3838
setImplFunctions(checkResize, scrollImpl, sendMessage);
3939

4040
window.addEventListener('message', (event) => {

0 commit comments

Comments
 (0)