mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Stricter error checking
This commit is contained in:
@ -6,8 +6,8 @@
|
||||
|
||||
import * as path from 'path';
|
||||
|
||||
import { workspace, Disposable, ExtensionContext } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, TransportKind } from 'vscode-languageclient';
|
||||
import { workspace, ExtensionContext } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient';
|
||||
|
||||
export function activate(context: ExtensionContext) {
|
||||
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
|
||||
@ -5,11 +5,9 @@
|
||||
'use strict';
|
||||
|
||||
import {
|
||||
IPCMessageReader, IPCMessageWriter,
|
||||
createConnection, IConnection, TextDocumentSyncKind,
|
||||
TextDocuments, TextDocument, Diagnostic, DiagnosticSeverity,
|
||||
InitializeParams, InitializeResult, TextDocumentPositionParams,
|
||||
CompletionItem, CompletionItemKind
|
||||
IPCMessageReader, IPCMessageWriter, createConnection, IConnection, TextDocuments, TextDocument,
|
||||
Diagnostic, DiagnosticSeverity, InitializeResult, TextDocumentPositionParams, CompletionItem,
|
||||
CompletionItemKind
|
||||
} from 'vscode-languageserver';
|
||||
|
||||
// Create a connection for the server. The connection uses Node's IPC as a transport
|
||||
@ -91,14 +89,14 @@ function validateTextDocument(textDocument: TextDocument): void {
|
||||
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
||||
}
|
||||
|
||||
connection.onDidChangeWatchedFiles((change) => {
|
||||
connection.onDidChangeWatchedFiles((_change) => {
|
||||
// Monitored files have change in VSCode
|
||||
connection.console.log('We recevied an file change event');
|
||||
});
|
||||
|
||||
|
||||
// This handler provides the initial list of the completion items.
|
||||
connection.onCompletion((textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => {
|
||||
connection.onCompletion((_textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => {
|
||||
// The pass parameter contains the position of the text document in
|
||||
// which code complete got requested. For the example we ignore this
|
||||
// info and always provide the same completion items.
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitReturns": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
|
||||
Reference in New Issue
Block a user