Skip to content

Commit 5165a1b

Browse files
committed
undo import
1 parent 3af881d commit 5165a1b

File tree

1 file changed

+41
-53
lines changed

1 file changed

+41
-53
lines changed

server/src/server.ts

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,34 @@
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";
71
import fs from "fs";
82
import fsAsync from "fs/promises";
3+
import * as path from "path";
4+
import process from "process";
5+
import semver from "semver";
6+
import * as rpc from "vscode-jsonrpc/node";
7+
import * as v from "vscode-languageserver";
8+
import { WorkspaceEdit } from "vscode-languageserver";
9+
import * as p from "vscode-languageserver-protocol";
910
import {
10-
DidChangeWatchedFilesNotification,
11-
DidOpenTextDocumentNotification,
11+
CodeLensParams,
12+
DidChangeConfigurationNotification,
1213
DidChangeTextDocumentNotification,
14+
DidChangeWatchedFilesNotification,
1315
DidCloseTextDocumentNotification,
14-
DidChangeConfigurationNotification,
16+
DidOpenTextDocumentNotification,
17+
InitializedNotification,
1518
InitializeParams,
1619
InlayHintParams,
17-
CodeLensParams,
1820
SignatureHelpParams,
19-
InitializedNotification,
2021
} from "vscode-languageserver-protocol";
21-
import * as lookup from "./lookup";
22-
import * as utils from "./utils";
2322
import * as codeActions from "./codeActions";
23+
import config, { extensionConfiguration, initialConfiguration } from "./config";
2424
import * as c from "./constants";
25-
import { assert } from "console";
26-
import { WorkspaceEdit } from "vscode-languageserver";
2725
import { onErrorReported } from "./errorReporter";
2826
import * as ic from "./incrementalCompilation";
29-
import config, { extensionConfiguration, initialConfiguration } from "./config";
27+
import { getLogger, initializeLogger, setLogLevel } from "./logger";
28+
import * as lookup from "./lookup";
3029
import { projectsFiles } from "./projectFiles";
30+
import * as utils from "./utils";
3131
import { NormalizedPath } from "./utils";
32-
import { initializeLogger, getLogger, setLogLevel } from "./logger";
33-
34-
function applyUserConfiguration(configuration: extensionConfiguration) {
35-
// We always want to spread the initial configuration to ensure all defaults are respected.
36-
config.extensionConfiguration = Object.assign(
37-
{},
3832
initialConfiguration,
3933
configuration,
4034
);
@@ -1523,41 +1517,35 @@ async function onMessage(msg: p.Message) {
15231517
The client can watch files for us and send us events via the `workspace/didChangeWatchedFiles`
15241518
*/
15251519
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,
1520+
(projectRootPath) => [
1521+
{
1522+
// Only watch the root compiler log for each workspace folder.
1523+
// In monorepos, `**/lib/bs/.compiler.log` matches every package and dependency,
1524+
// causing a burst of events per save.
1525+
globPattern: {
1526+
baseUri: utils.pathToURI(projectRootPath),
1527+
pattern: c.compilerLogPartialPath,
15381528
},
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,
1529+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1530+
},
1531+
{
1532+
// Watch ninja output
1533+
globPattern: {
1534+
baseUri: utils.pathToURI(projectRootPath),
1535+
pattern: path.join("**", c.buildNinjaPartialPath),
15471536
},
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,
1537+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1538+
},
1539+
{
1540+
// Watch build artifacts
1541+
globPattern: {
1542+
baseUri: utils.pathToURI(projectRootPath),
1543+
pattern: path.join(c.compilerDirPartialPath, "**/*.{cmi,cmt}"),
15561544
},
1557-
];
1558-
},
1545+
kind: p.WatchKind.Change | p.WatchKind.Create | p.WatchKind.Delete,
1546+
},
1547+
],
15591548
);
1560-
15611549
const registrationParams: p.RegistrationParams = {
15621550
registrations: [
15631551
{

0 commit comments

Comments
 (0)