quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.55k stars 192 forks source link

Benchmark against JSHint LSP server #540

Open strager opened 2 years ago

strager commented 2 years ago

https://github.com/microsoft/vscode-jshint/tree/1c32cd9f962dfc2a74913acf5eee4fd874d6f9ad/jshint-server

strager commented 2 years ago

I got it benchmarking with commit e8b7bceb263be5472b2f5d9e6fd4d5ce02288098 and the following tweaks:

diff --git jshint-server/src/server.ts jshint-server/src/server.ts
index 17c71ea..7c67d43 100644
--- jshint-server/src/server.ts
+++ jshint-server/src/server.ts
@@ -5,6 +5,7 @@

 import {
    createConnection, IConnection, ResponseError, InitializeParams, InitializeResult, InitializeError,
+            StreamMessageWriter, StreamMessageReader,
    Diagnostic, DiagnosticSeverity, Files, TextDocuments, TextDocument, ErrorMessageTracker, IPCMessageReader, IPCMessageWriter, RequestType
 } from 'vscode-languageserver';

@@ -360,7 +361,8 @@ class Linter {
    private packageManager: string;

    constructor() {
-       this.connection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process));
+       //this.connection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process));
+       this.connection = createConnection(new StreamMessageReader(process.stdin), new StreamMessageWriter(process.stdout));
        this.options = new OptionsResolver(this.connection);
        this.fileMatcher = new FileMatcher();
        this.documents = new TextDocuments();
@@ -369,6 +371,7 @@ class Linter {
            this.connection.sendDiagnostics({ uri: event.document.uri, diagnostics: [] });
        });
        this.documents.listen(this.connection);
+                this.settings = _.assign<Object, JSHintSettings>({ options: {}, exclude: {} }, (<Settings>{}).jshint);

        this.connection.onInitialize(params => this.onInitialize(params));
        this.connection.onDidChangeConfiguration(params => {