Skip to content

Commit e1d7c25

Browse files
committed
formatting
1 parent 3af881d commit e1d7c25

File tree

1 file changed

+42
-48
lines changed

1 file changed

+42
-48
lines changed

server/src/server.ts

Lines changed: 42 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
import process from "process";
2-
import * as p from "vscode-languageserver-protocol";
3-
import * as v from "vscode-languageserver";
4-
import * as rpc from "vscode-jsonrpc/node";
5-
import * as path from "path";
6-
import semver from "semver";
1+
import { assert } from "console";
72
import fs from "fs";
83
import fsAsync from "fs/promises";
4+
import * as path from "path";
5+
import process from "process";
6+
import semver from "semver";
7+
import * as rpc from "vscode-jsonrpc/node";
8+
import * as v from "vscode-languageserver";
9+
import { WorkspaceEdit } from "vscode-languageserver";
10+
import * as p from "vscode-languageserver-protocol";
911
import {
10-
DidChangeWatchedFilesNotification,
11-
DidOpenTextDocumentNotification,
12+
CodeLensParams,
13+
DidChangeConfigurationNotification,
1214
DidChangeTextDocumentNotification,
15+
DidChangeWatchedFilesNotification,
1316
DidCloseTextDocumentNotification,
14-
DidChangeConfigurationNotification,
17+
DidOpenTextDocumentNotification,
18+
InitializedNotification,
1519
InitializeParams,
1620
InlayHintParams,
17-
CodeLensParams,
1821
SignatureHelpParams,
19-
InitializedNotification,
2022
} from "vscode-languageserver-protocol";
21-
import * as lookup from "./lookup";
22-
import * as utils from "./utils";
2323
import * as codeActions from "./codeActions";
24+
import config, { extensionConfiguration, initialConfiguration } from "./config";
2425
import * as c from "./constants";
25-
import { assert } from "console";
26-
import { WorkspaceEdit } from "vscode-languageserver";
2726
import { onErrorReported } from "./errorReporter";
2827
import * as ic from "./incrementalCompilation";
29-
import config, { extensionConfiguration, initialConfiguration } from "./config";
28+
import { getLogger, initializeLogger, setLogLevel } from "./logger";
29+
import * as lookup from "./lookup";
3030
import { projectsFiles } from "./projectFiles";
31+
import * as utils from "./utils";
3132
import { NormalizedPath } from "./utils";
32-
import { initializeLogger, getLogger, setLogLevel } from "./logger";
3333

3434
function applyUserConfiguration(configuration: extensionConfiguration) {
3535
// We always want to spread the initial configuration to ensure all defaults are respected.
@@ -1523,41 +1523,35 @@ async function onMessage(msg: p.Message) {
15231523
The client can watch files for us and send us events via the `workspace/didChangeWatchedFiles`
15241524
*/
15251525
const watchers = Array.from(workspaceFolders).flatMap(
1526-
(projectRootPath) => {
1527-
return [
1528-
{
1529-
// Only watch the root compiler log for each workspace folder.
1530-
// In monorepos, `**/lib/bs/.compiler.log` matches every package and dependency,
1531-
// causing a burst of events per save.
1532-
globPattern: {
1533-
baseUri: utils.pathToURI(projectRootPath),
1534-
pattern: c.compilerLogPartialPath,
1535-
},
1536-
kind:
1537-
p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1526+
(projectRootPath) => [
1527+
{
1528+
// Only watch the root compiler log for each workspace folder.
1529+
// In monorepos, `**/lib/bs/.compiler.log` matches every package and dependency,
1530+
// causing a burst of events per save.
1531+
globPattern: {
1532+
baseUri: utils.pathToURI(projectRootPath),
1533+
pattern: c.compilerLogPartialPath,
15381534
},
1539-
{
1540-
// Watch build artifacts
1541-
globPattern: {
1542-
baseUri: utils.pathToURI(projectRootPath),
1543-
pattern: path.join(c.compilerDirPartialPath, "**/*.{cmi,cmt}"),
1544-
},
1545-
kind:
1546-
p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1535+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1536+
},
1537+
{
1538+
// Watch ninja output
1539+
globPattern: {
1540+
baseUri: utils.pathToURI(projectRootPath),
1541+
pattern: path.join("**", c.buildNinjaPartialPath),
15471542
},
1548-
{
1549-
// Watch ninja output
1550-
globPattern: {
1551-
baseUri: utils.pathToURI(projectRootPath),
1552-
pattern: path.join("**", c.buildNinjaPartialPath),
1553-
},
1554-
kind:
1555-
p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1543+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1544+
},
1545+
{
1546+
// Watch build artifacts
1547+
globPattern: {
1548+
baseUri: utils.pathToURI(projectRootPath),
1549+
pattern: path.join(c.compilerDirPartialPath, "**/*.{cmi,cmt}"),
15561550
},
1557-
];
1558-
},
1551+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1552+
},
1553+
],
15591554
);
1560-
15611555
const registrationParams: p.RegistrationParams = {
15621556
registrations: [
15631557
{

0 commit comments

Comments
 (0)