Skip to content

Commit 492e5f4

Browse files
committed
refactor: sort imports
1 parent c3fb886 commit 492e5f4

26 files changed

+98
-55
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ module.exports = {
1111
'@typescript-eslint/no-explicit-any': 0,
1212
'@typescript-eslint/explicit-module-boundary-types': 0,
1313
'@typescript-eslint/no-non-null-assertion': 0,
14+
15+
'import/order': [
16+
'error',
17+
{
18+
'alphabetize': { order: 'asc' },
19+
'newlines-between': 'always',
20+
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
21+
},
22+
],
1423
},
1524
};

src/extension.ts

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

3+
import * as fs from 'fs';
4+
import * as path from 'path';
5+
36
import * as vscode from 'vscode';
7+
48
import * as pkg from '../package.json';
5-
import * as path from 'path';
6-
import * as fs from 'fs';
79

10+
import { WhatsNew } from './commands/commands';
811
import { FortranCompletionProvider } from './fallback-features/completion-provider';
912
import { FortranDocumentSymbolProvider } from './fallback-features/document-symbol-provider';
10-
import { FortranFormattingProvider } from './format/formatting-provider';
11-
import { FortlsClient } from './lsp/client';
1213
import { FortranHoverProvider } from './fallback-features/hover-provider';
13-
import { FortranLintingProvider } from './lint/linter-provider';
14-
import { EXTENSION_ID, FortranDocumentSelector } from './util/tools';
14+
import { FortranFormattingProvider } from './format/provider';
15+
import { FortranLintingProvider } from './lint/provider';
16+
import { FortlsClient } from './lsp/client';
1517
import { getConfigLogLevel, Logger } from './services/logging';
16-
import { WhatsNew } from './commands/commands';
18+
import { EXTENSION_ID, FortranDocumentSelector } from './util/tools';
1719

1820
// Make it global to catch errors when activation fails
1921
const logger = new Logger(

src/fallback-features/completion-provider.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { CancellationToken, TextDocument, Position, Hover } from 'vscode';
2-
import * as fs from 'fs';
31
import * as vscode from 'vscode';
4-
import { isPositionInString, FORTRAN_KEYWORDS } from '../util/helper';
5-
import { getDeclaredFunctions } from './functions';
6-
import { EXTENSION_ID } from '../util/tools';
2+
import { Position, TextDocument } from 'vscode';
3+
74
import { Logger } from '../services/logging';
5+
import { FORTRAN_KEYWORDS, isPositionInString } from '../util/helper';
6+
import { EXTENSION_ID } from '../util/tools';
7+
8+
import { getDeclaredFunctions } from './functions';
89
import intrinsics from './intrinsics.json';
910

1011
class CaseCoverter {

src/fallback-features/document-symbol-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { CancellationToken, TextDocument, TextLine, SymbolInformation } from 'vscode';
2-
32
import * as vscode from 'vscode';
3+
44
import {
55
parseFunction as getDeclaredFunction,
66
parseSubroutine as getDeclaredSubroutine,

src/fallback-features/hover-provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { CancellationToken, TextDocument, Position, Hover } from 'vscode';
2+
23
import { Logger } from '../services/logging';
4+
35
import intrinsics from './intrinsics.json';
46

57
export class FortranHoverProvider {

src/fallback-features/variables.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* c8 ignore start */
22
import * as vscode from 'vscode';
3+
34
import { Variable } from './functions';
45

56
const varibleDecRegEx =

src/format/formatting-provider.ts renamed to src/format/provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
'use strict';
22

33
import * as path from 'path';
4-
import which from 'which';
4+
55
import * as vscode from 'vscode';
6+
import which from 'which';
67

78
import { Logger } from '../services/logging';
89
import {

src/lint/linter-provider.ts renamed to src/lint/provider.ts

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

3+
import * as cp from 'child_process';
34
import * as fs from 'fs';
45
import * as path from 'path';
5-
import * as cp from 'child_process';
6-
import which from 'which';
6+
7+
import { glob } from 'glob';
78
import * as semver from 'semver';
89
import * as vscode from 'vscode';
9-
import { glob } from 'glob';
10+
import which from 'which';
1011

1112
import * as pkg from '../../package.json';
13+
import {
14+
BuildDebug,
15+
BuildRun,
16+
InitLint,
17+
CleanLintFiles,
18+
RescanLint,
19+
CleanLintDiagnostics,
20+
} from '../commands/commands';
1221
import { Logger } from '../services/logging';
13-
import { GNULinter, GNUModernLinter, IntelLinter, LFortranLinter, NAGLinter } from './linters';
22+
import { GlobPaths } from '../util/glob-paths';
23+
import { arraysEqual } from '../util/helper';
1424
import {
1525
EXTENSION_ID,
1626
resolveVariables,
@@ -20,16 +30,8 @@ import {
2030
isFortran,
2131
shellTask,
2232
} from '../util/tools';
23-
import { arraysEqual } from '../util/helper';
24-
import { GlobPaths } from '../util/glob-paths';
25-
import {
26-
BuildDebug,
27-
BuildRun,
28-
InitLint,
29-
CleanLintFiles,
30-
RescanLint,
31-
CleanLintDiagnostics,
32-
} from '../commands/commands';
33+
34+
import { GNULinter, GNUModernLinter, IntelLinter, LFortranLinter, NAGLinter } from './linters';
3335

3436
const GNU = new GNULinter();
3537
const GNU_NEW = new GNUModernLinter();

src/lsp/client.ts

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

3+
import { spawnSync } from 'child_process';
34
import * as os from 'os';
45
import * as path from 'path';
6+
57
import * as vscode from 'vscode';
6-
import { spawnSync } from 'child_process';
78
import { commands, window, workspace, TextDocument } from 'vscode';
89
import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient/node';
10+
11+
import { RestartLS } from '../commands/commands';
12+
import { Logger } from '../services/logging';
913
import {
1014
EXTENSION_ID,
1115
FortranDocumentSelector,
@@ -15,8 +19,6 @@ import {
1519
pipInstall,
1620
resolveVariables,
1721
} from '../util/tools';
18-
import { Logger } from '../services/logging';
19-
import { RestartLS } from '../commands/commands';
2022

2123
// The clients are non member variables of the class because they need to be
2224
// shared for command registration. The command operates on the client and not

src/services/logging.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { OutputChannel, window, workspace, WorkspaceConfiguration } from 'vscode';
2+
23
import { EXTENSION_ID } from '../util/tools';
34

45
export enum LogLevel {

0 commit comments

Comments
 (0)