Skip to content

Commit 98f8a7e

Browse files
committed
vscode-dotty: don't use semi-colons
1 parent c200b30 commit 98f8a7e

File tree

5 files changed

+34
-38
lines changed

5 files changed

+34
-38
lines changed

vscode-dotty/src/compat.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as vscode from 'vscode';
1+
import * as vscode from 'vscode'
22

3-
import { HoverRequest } from 'vscode-languageclient';
3+
import { HoverRequest } from 'vscode-languageclient'
44
import { MarkedString, LanguageClient, LanguageClientOptions, RevealOutputChannelOn,
5-
ServerOptions } from 'vscode-languageclient';
5+
ServerOptions } from 'vscode-languageclient'
66

77
// Fix hover functionality when using this version of vscode-dotty with Dotty
88
// Language Server 0.9 or earlier.

vscode-dotty/src/extension.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
'use strict';
1+
import * as fs from 'fs'
2+
import * as path from 'path'
23

3-
import * as fs from 'fs';
4-
import * as path from 'path';
4+
import * as pcp from 'promisify-child-process'
5+
import * as compareVersions from 'compare-versions'
56

6-
import * as pcp from 'promisify-child-process';
7-
import * as compareVersions from 'compare-versions';
7+
import { ChildProcess } from "child_process"
88

9-
import { ChildProcess } from "child_process";
10-
11-
import { ExtensionContext } from 'vscode';
12-
import * as vscode from 'vscode';
9+
import { ExtensionContext } from 'vscode'
10+
import * as vscode from 'vscode'
1311
import { LanguageClient, LanguageClientOptions, RevealOutputChannelOn,
14-
ServerOptions } from 'vscode-languageclient';
12+
ServerOptions } from 'vscode-languageclient'
1513
import { enableOldServerWorkaround } from './compat'
1614
import * as features from './features'
1715

1816
export let client: LanguageClient
1917

2018
import * as rpc from 'vscode-jsonrpc'
2119
import * as sbtserver from './sbt-server'
22-
import { Tracer } from './tracer';
20+
import { Tracer } from './tracer'
2321

24-
export const extensionName = 'dotty';
25-
const extensionConfig = vscode.workspace.getConfiguration(extensionName);
22+
export const extensionName = 'dotty'
23+
const extensionConfig = vscode.workspace.getConfiguration(extensionName)
2624

2725
let extensionContext: ExtensionContext
2826
let outputChannel: vscode.OutputChannel
29-
let tracer: Tracer;
27+
let tracer: Tracer
3028

3129
/** The sbt process that may have been started by this extension */
3230
let sbtProcess: ChildProcess | undefined
@@ -50,14 +48,14 @@ function isConfiguredProject() {
5048

5149
export function activate(context: ExtensionContext) {
5250
extensionContext = context
53-
outputChannel = vscode.window.createOutputChannel("Dotty");
51+
outputChannel = vscode.window.createOutputChannel("Dotty")
5452
tracer = new Tracer({
5553
extensionContext,
5654
extensionConfig,
5755
extensionOut: outputChannel,
5856
})
5957

60-
const coursierPath = path.join(extensionContext.extensionPath, "out", "coursier");
58+
const coursierPath = path.join(extensionContext.extensionPath, "out", "coursier")
6159
const dottyPluginSbtFileSource = path.join(extensionContext.extensionPath, "out", "dotty-plugin.sbt")
6260
const buildSbtFileSource = path.join(extensionContext.extensionPath, "out", "build.sbt")
6361

@@ -308,7 +306,7 @@ function bootstrapSbtProject(buildSbtFileSource: string,
308306

309307
function run(serverOptions: ServerOptions, isOldServer: boolean) {
310308

311-
const { lspOutputChannel } = tracer.run();
309+
const { lspOutputChannel } = tracer.run()
312310

313311
const clientOptions: LanguageClientOptions = {
314312
documentSelector: [

vscode-dotty/src/features.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { WorksheetProvider } from './worksheet'
1414
// https://github.com/Microsoft/vscode-languageserver-node/issues/423 is fixed.
1515
function ensure<T, K extends keyof T>(target: T, key: K): T[K] {
1616
if (target[key] === void 0) {
17-
target[key] = {} as any;
17+
target[key] = {} as any
1818
}
19-
return target[key];
19+
return target[key]
2020
}
2121

2222
export interface WorksheetClientCapabilities {

vscode-dotty/src/passthrough-server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
'use strict';
2-
3-
import * as net from 'net';
1+
import * as net from 'net'
42

53
let argv: string[] = process.argv.slice(2)
64
const firstArg: string | undefined = argv.shift()
@@ -22,7 +20,7 @@ client.on('data', (data) => {
2220
process.stdout.write(data.toString())
2321
})
2422
process.stdin.on('readable', () => {
25-
let chunk = process.stdin.read();
23+
let chunk = process.stdin.read()
2624
if (chunk !== null) {
2725
if (isConnected) {
2826
client.write(chunk)

vscode-dotty/src/sbt-server.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,25 @@ function connectSocket(socket: net.Socket): net.Socket {
7979
if (u.protocol == 'tcp:' && u.port) {
8080
socket.connect(+u.port, '127.0.0.1');
8181
} else if (u.protocol == 'local:' && u.hostname && os.platform() == 'win32') {
82-
let pipePath = '\\\\.\\pipe\\' + u.hostname;
83-
socket.connect(pipePath);
82+
let pipePath = '\\\\.\\pipe\\' + u.hostname
83+
socket.connect(pipePath)
8484
} else if (u.protocol == 'local:' && u.path) {
85-
socket.connect(u.path);
85+
socket.connect(u.path)
8686
} else {
87-
throw 'Unknown protocol ' + u.protocol;
87+
throw 'Unknown protocol ' + u.protocol
8888
}
89-
return socket;
89+
return socket
9090
}
9191

9292
// the port file is hardcoded to a particular location relative to the build.
9393
function discoverUrl(): url.Url {
94-
let pf = path.join(workspaceRoot, 'project', 'target', 'active.json');
95-
let portfile = JSON.parse(fs.readFileSync(pf).toString());
96-
return url.parse(portfile.uri);
94+
let pf = path.join(workspaceRoot, 'project', 'target', 'active.json')
95+
let portfile = JSON.parse(fs.readFileSync(pf).toString())
96+
return url.parse(portfile.uri)
9797
}
9898

9999
function delay(ms: number) {
100-
return new Promise(resolve => setTimeout(resolve, ms));
100+
return new Promise(resolve => setTimeout(resolve, ms))
101101
}
102102

103103
async function waitForServer(): Promise<net.Socket> {
@@ -106,12 +106,12 @@ async function waitForServer(): Promise<net.Socket> {
106106
location: vscode.ProgressLocation.Window,
107107
title: "Connecting to sbt server..."
108108
}, async _ => {
109-
let retries = 60;
109+
let retries = 60
110110
while (!socket && retries > 0) {
111111
try { socket = connectSocket(new net.Socket()) }
112112
catch (e) {
113-
retries--;
114-
await delay(1000);
113+
retries--
114+
await delay(1000)
115115
}
116116
}
117117
if (socket) return Promise.resolve(socket)

0 commit comments

Comments
 (0)