Skip to content

Commit 747319f

Browse files
committed
Fix linting issues and activate linting in CI
1 parent 476e1dc commit 747319f

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ ifneq ($(npm_config_offline),true)
128128
cd integration/vscode/ada; LD_LIBRARY_PATH= npm install --no-audit
129129
cd integration/vscode/ada; LD_LIBRARY_PATH= npm run check-licenses
130130
endif
131+
cd integration/vscode/ada; LD_LIBRARY_PATH= npm run cilint
131132
cd integration/vscode/ada; LD_LIBRARY_PATH= npm run compile
132133
@echo Now run:
133134
@echo code --extensionDevelopmentPath=`pwd`/integration/vscode/ada/ `pwd`

integration/vscode/ada/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@
588588
"watch": "node ./node_modules/typescript/bin/tsc -watch",
589589
"pretest": "npm run compile",
590590
"lint": "eslint './src/**/*.{js,ts,tsx}' --quiet --fix",
591+
"cilint": "eslint './src/**/*.{js,ts,tsx}'",
591592
"test": "node ./out/test/runTest.js"
592593
},
593594
"dependencies": {

integration/vscode/ada/src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
ServerOptions,
2727
SymbolKind,
2828
} from 'vscode-languageclient/node';
29+
import { ALSClientFeatures } from './alsClientFeatures';
2930
import { alsCommandExecutor } from './alsExecuteCommand';
3031
import GnatTaskProvider, { getEnclosingSymbol } from './gnatTaskProvider';
3132
import GprTaskProvider from './gprTaskProvider';

integration/vscode/ada/src/gnatTaskProvider.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ interface TaskProperties {
4242
* or '' if not found.
4343
*/
4444
const limitSubp = async (): Promise<string> => {
45-
return getEnclosingSymbol(vscode.window.activeTextEditor, [SymbolKind.Function]).then((Symbol) => {
46-
if (Symbol) {
47-
const subprogram_line: string = (Symbol.range.start.line + 1).toString();
48-
return `--limit-subp=\${fileBasename}:${subprogram_line}`;
49-
} else {
50-
return '';
45+
return getEnclosingSymbol(vscode.window.activeTextEditor, [SymbolKind.Function]).then(
46+
(Symbol) => {
47+
if (Symbol) {
48+
const subprogram_line: string = (Symbol.range.start.line + 1).toString();
49+
return `--limit-subp=\${fileBasename}:${subprogram_line}`;
50+
} else {
51+
return '';
52+
}
5153
}
52-
});
54+
);
5355
};
5456

5557
/**
@@ -288,7 +290,7 @@ async function getTasks(): Promise<vscode.Task[]> {
288290
* to find the closest symbol enclosing the cursor's position.
289291
* @returns Return the closest enclosing symbol.
290292
*/
291-
export async function getEnclosingSymbol (
293+
export async function getEnclosingSymbol(
292294
editor: vscode.TextEditor | undefined,
293295
kinds: vscode.SymbolKind[]
294296
): Promise<vscode.DocumentSymbol | null> {
@@ -332,7 +334,7 @@ export async function getEnclosingSymbol (
332334
}
333335

334336
return null;
335-
};
337+
}
336338

337339
const getSelectedRegion = (editor: vscode.TextEditor | undefined): string => {
338340
if (editor) {

0 commit comments

Comments
 (0)