Skip to content

Commit 89764f9

Browse files
committed
Merge branch 'main' into fix/replace-deprecated-ui-toolkit
2 parents e76d2ae + 4233662 commit 89764f9

97 files changed

Lines changed: 1315 additions & 131 deletions

File tree

Some content is hidden

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

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ jobs:
4343

4444
- name: Initialize CodeQL
4545
id: initialize
46-
uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
46+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
4747
with:
4848
queries: security-extended
4949
languages: TypeScript
5050
source-root: src
5151

5252
- name: Autobuild
5353
id: autobuild
54-
uses: github/codeql-action/autobuild@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
54+
uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
5555

5656
- name: Perform CodeQL Analysis
5757
id: analyze
58-
uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
58+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ jobs:
5151
retention-days: 5
5252

5353
- name: "Upload to code-scanning"
54-
uses: github/codeql-action/upload-sarif@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6
54+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
5555
with:
5656
sarif_file: results.sarif

media/styles.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/**
2+
* Copyright 2026 Arm Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
body section {
218
display: flex;
319
}

scripts/copyright-manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const args = minimist(process.argv.slice(2));
2424
const mode = args.mode || 'check';
2525

2626

27-
const DEFAULT_INCLUDE_GLOBS = ['src/**/*.ts', 'scripts/**/*.ts', 'api/**/*.ts', '__mocks__/**/*.ts'];
27+
const DEFAULT_INCLUDE_GLOBS = ['src/**/*.ts', 'scripts/**/*.ts', 'api/**/*.ts', '__mocks__/**/*.ts', '**/*.tsx', '**/*.css'];
2828
const DEFAULT_EXCLUDE_GLOBS = ['**/node_modules/**', 'coverage/**', 'dist/**', 'tools/**', 'src/json-rpc/**', 'test-data/**', 'test-workspace/**'];
2929

3030
const includeGlobs: string[] = args.include ? args.include.split(',') : DEFAULT_INCLUDE_GLOBS;
@@ -47,7 +47,7 @@ const COPYRIGHT_TEXT = `/**
4747
*/`;
4848

4949
// Regular expression to match the copyright notice
50-
const COPYRIGHT_REGEX = /\/\*\*\n \* Copyright 20\d{2}(?:-(?:20\d{2}))? Arm Limited[\s\S]*?\*\//;
50+
const COPYRIGHT_REGEX = /\/\*\*\r?\n \* Copyright 20\d{2}(?:-(?:20\d{2}))? Arm Limited[\s\S]*?\*\//;
5151

5252
function getFiles(): string[] {
5353
const allFiles: string[] = [];

src/solutions/solution-problems.test.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,42 @@ describe('SolutionProblems', () => {
7070

7171
await solutionProblems.activate(context);
7272

73-
expect(context.subscriptions).toHaveLength(2);
73+
expect(context.subscriptions).toHaveLength(3);
74+
});
75+
76+
it('clears diagnostics when solution path changes', async () => {
77+
await solutionProblems.activate({ subscriptions: [] } as unknown as ExtensionContext);
78+
const clearSpy = jest.spyOn(vscode.languages.createDiagnosticCollection(), 'clear');
79+
80+
solutionManager.fireOnDidChangeLoadState(
81+
{ solutionPath: '/work/new.csolution.yml' },
82+
{ solutionPath: '/work/old.csolution.yml' }
83+
);
84+
85+
expect(clearSpy).toHaveBeenCalledTimes(1);
86+
});
87+
88+
it('clears diagnostics when solution is closed', async () => {
89+
await solutionProblems.activate({ subscriptions: [] } as unknown as ExtensionContext);
90+
const clearSpy = jest.spyOn(vscode.languages.createDiagnosticCollection(), 'clear');
91+
92+
solutionManager.fireOnDidChangeLoadState(
93+
{ solutionPath: undefined },
94+
{ solutionPath: '/work/old.csolution.yml' }
95+
);
96+
97+
expect(clearSpy).toHaveBeenCalledTimes(1);
98+
});
99+
it('does not clear diagnostics when solution path is unchanged', async () => {
100+
await solutionProblems.activate({ subscriptions: [] } as unknown as ExtensionContext);
101+
const clearSpy = jest.spyOn(vscode.languages.createDiagnosticCollection(), 'clear');
102+
103+
solutionManager.fireOnDidChangeLoadState(
104+
{ solutionPath: '/work/same.csolution.yml' },
105+
{ solutionPath: '/work/same.csolution.yml' }
106+
);
107+
108+
expect(clearSpy).not.toHaveBeenCalled();
74109
});
75110

76111
it('creates diagnostics from convert completed log messages', async () => {

src/solutions/solution-problems.ts

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import * as fsUtils from '../utils/fs-utils';
2323
import { getFileNameFromPath } from '../utils/path-utils';
2424
import { stripTwoExtensions } from '../utils/string-utils';
2525
import { getWorkspaceFolder } from '../utils/vscode-utils';
26-
import { SolutionManager } from './solution-manager';
26+
import { SolutionLoadStateChangeEvent, SolutionManager } from './solution-manager';
2727
import { ConvertResultData, SolutionEventHub } from './solution-event-hub';
2828

2929
export const toolsPrefixPatterns = {
@@ -108,6 +108,10 @@ export interface SolutionProblems {
108108
export class SolutionProblemsImpl implements SolutionProblems {
109109

110110
private readonly diagnosticCollection: vscode.DiagnosticCollection = vscode.languages.createDiagnosticCollection('csolution');
111+
/**
112+
* source files for diagnostics mapping
113+
*/
114+
private readonly sourceFiles: Map<string, string> = new Map<string, string>();
111115

112116
private readonly queryActionPatterns: ReadonlyArray<{ pattern: RegExp; action: 'components-packs' | 'find-in-files' }> = [
113117
{ pattern: /dependency validation for context '([^']+)' failed:/, action: 'components-packs' },
@@ -126,6 +130,7 @@ export class SolutionProblemsImpl implements SolutionProblems {
126130
public async activate(context: vscode.ExtensionContext): Promise<void> {
127131
context.subscriptions.push(
128132
this.eventHub.onDidConvertCompleted(this.handleConvertCompleted, this),
133+
this.solutionManager.onDidChangeLoadState(this.handleLoadStateChanged, this),
129134
this.diagnosticCollection,
130135
);
131136
}
@@ -135,6 +140,12 @@ export class SolutionProblemsImpl implements SolutionProblems {
135140
await this.updateDiagnostics(data.logMessages);
136141
}
137142

143+
private handleLoadStateChanged(data: SolutionLoadStateChangeEvent): void {
144+
if (data.previousState.solutionPath !== data.newState.solutionPath) {
145+
this.clearDiagnostics();
146+
}
147+
}
148+
138149
/**
139150
* log message regex in the format <filename>:<line>:<column> - <message>
140151
* regex named groups:
@@ -195,10 +206,17 @@ export class SolutionProblemsImpl implements SolutionProblems {
195206
return true;
196207
}
197208

198-
private async updateDiagnostics(messages: LogMessages): Promise<void> {
199-
// clear previous diagnostics
209+
/**
210+
* Clear diagnostic and collected files
211+
*/
212+
private clearDiagnostics(): void {
200213
this.diagnosticCollection.clear();
201214
this.collectYmlFiles();
215+
}
216+
217+
private async updateDiagnostics(messages: LogMessages): Promise<void> {
218+
// clear previous diagnostics
219+
this.clearDiagnostics();
202220
let diagnostics = false;
203221

204222
// iterate through log messages and set diagnostics
@@ -216,11 +234,6 @@ export class SolutionProblemsImpl implements SolutionProblems {
216234
}
217235
}
218236

219-
/**
220-
* source files for diagnostics mapping
221-
*/
222-
private readonly sourceFiles: Map<string, string> = new Map<string, string>();
223-
224237
private addFile(file: string): void {
225238
if (file.length > 0) {
226239
this.sourceFiles.set(getFileNameFromPath(file), file);

src/views/common/components/cmsis-codicon.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
/*
2-
* Copyright (C) 2026 Arm Limited
1+
/**
2+
* Copyright 2026 Arm Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
416

517
import React from 'react';

src/views/common/components/compact-dropdown.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
/*
2-
* Copyright (c) 2022-2026 Arm Limited
1+
/**
2+
* Copyright 2022-2026 Arm Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
416

517
:root {

src/views/common/components/compact-dropdown.test.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
/**
2-
* Copyright (C) 2021-2026 Arm Limited
2+
* Copyright 2026 Arm Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
416

5-
6-
717
import 'jest';
818
import * as React from 'react';
919
import { createRoot } from 'react-dom/client';

src/views/common/components/compact-dropdown.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
/**
2-
* Copyright (C) 2021-2026 Arm Limited
2+
* Copyright 2026 Arm Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
315
*/
416

517
import * as React from 'react';

0 commit comments

Comments
 (0)