vscode-languageserver
Advanced tools
Comparing version 8.2.0-next.3 to 9.0.0
@@ -12,2 +12,3 @@ import { CancellationToken, ProtocolRequestType0, RequestHandler0, ProtocolRequestType, RequestHandler, GenericRequestHandler, StarRequestHandler, HandlerResult, ProtocolNotificationType0, NotificationHandler0, ProtocolNotificationType, NotificationHandler, GenericNotificationHandler, StarNotificationHandler, ProgressType, Disposable, InitializeParams, InitializeResult, InitializeError, InitializedParams, DidChangeConfigurationParams, DidChangeWatchedFilesParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, WillSaveTextDocumentParams, TextEdit, DidSaveTextDocumentParams, PublishDiagnosticsParams, HoverParams, Hover, CompletionParams, CompletionItem, CompletionList, SignatureHelpParams, SignatureHelp, DeclarationParams, Declaration, DeclarationLink, Location, DefinitionParams, Definition, DefinitionLink, TypeDefinitionParams, ImplementationParams, ReferenceParams, DocumentHighlightParams, DocumentHighlight, DocumentSymbolParams, SymbolInformation, DocumentSymbol, WorkspaceSymbolParams, CodeActionParams, Command, CodeAction, CodeLensParams, CodeLens, DocumentFormattingParams, DocumentRangeFormattingParams, DocumentOnTypeFormattingParams, RenameParams, WorkspaceEdit, PrepareRenameParams, Range, DocumentLinkParams, DocumentLink, DocumentColorParams, ColorInformation, ColorPresentationParams, ColorPresentation, FoldingRangeParams, FoldingRange, SelectionRangeParams, SelectionRange, ExecuteCommandParams, MessageActionItem, ClientCapabilities, ServerCapabilities, Logger, ProtocolConnection, MessageSignature, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, WorkDoneProgressParams, PartialResultParams, RegistrationType, RequestType0, RequestType, NotificationType0, NotificationType, WorkspaceSymbol } from 'vscode-languageserver-protocol'; | ||
import { InlineValueFeatureShape } from './inlineValue'; | ||
import { FoldingRangeFeatureShape } from './foldingRange'; | ||
import { InlayHintFeatureShape } from './inlayHint'; | ||
@@ -102,2 +103,10 @@ import { DiagnosticFeatureShape } from './diagnostic'; | ||
log(message: string): void; | ||
/** | ||
* Log a debug message. | ||
* | ||
* @param message The message to log. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
debug(message: string): void; | ||
} | ||
@@ -322,3 +331,3 @@ /** | ||
} | ||
export type Languages = _Languages & CallHierarchy & SemanticTokensFeatureShape & LinkedEditingRangeFeatureShape & TypeHierarchyFeatureShape & InlineValueFeatureShape & InlayHintFeatureShape & DiagnosticFeatureShape & MonikerFeatureShape; | ||
export type Languages = _Languages & CallHierarchy & SemanticTokensFeatureShape & LinkedEditingRangeFeatureShape & TypeHierarchyFeatureShape & InlineValueFeatureShape & InlayHintFeatureShape & DiagnosticFeatureShape & MonikerFeatureShape & FoldingRangeFeatureShape; | ||
export interface _Notebooks extends FeatureBase { | ||
@@ -325,0 +334,0 @@ connection: Connection; |
@@ -21,2 +21,3 @@ "use strict"; | ||
const inlineValue_1 = require("./inlineValue"); | ||
const foldingRange_1 = require("./foldingRange"); | ||
// import { InlineCompletionFeatureShape, InlineCompletionFeature } from './inlineCompletion.proposed'; | ||
@@ -99,2 +100,5 @@ const inlayHint_1 = require("./inlayHint"); | ||
} | ||
debug(message) { | ||
this.send(vscode_languageserver_protocol_1.MessageType.Debug, message); | ||
} | ||
send(type, message) { | ||
@@ -405,3 +409,3 @@ if (this._rawConnection) { | ||
exports._LanguagesImpl = _LanguagesImpl; | ||
const LanguagesImpl = (0, moniker_1.MonikerFeature)((0, diagnostic_1.DiagnosticFeature)((0, inlayHint_1.InlayHintFeature)((0, inlineValue_1.InlineValueFeature)((0, typeHierarchy_1.TypeHierarchyFeature)((0, linkedEditingRange_1.LinkedEditingRangeFeature)((0, semanticTokens_1.SemanticTokensFeature)((0, callHierarchy_1.CallHierarchyFeature)(_LanguagesImpl)))))))); | ||
const LanguagesImpl = (0, foldingRange_1.FoldingRangeFeature)((0, moniker_1.MonikerFeature)((0, diagnostic_1.DiagnosticFeature)((0, inlayHint_1.InlayHintFeature)((0, inlineValue_1.InlineValueFeature)((0, typeHierarchy_1.TypeHierarchyFeature)((0, linkedEditingRange_1.LinkedEditingRangeFeature)((0, semanticTokens_1.SemanticTokensFeature)((0, callHierarchy_1.CallHierarchyFeature)(_LanguagesImpl))))))))); | ||
class _NotebooksImpl { | ||
@@ -408,0 +412,0 @@ constructor() { |
@@ -23,2 +23,3 @@ "use strict"; | ||
exports.createConnection = exports.Files = void 0; | ||
const node_util_1 = require("node:util"); | ||
const Is = require("../common/utils/is"); | ||
@@ -141,2 +142,3 @@ const server_1 = require("../common/server"); | ||
function _createConnection(input, output, options, factories) { | ||
let stdio = false; | ||
if (!input && !output && process.argv.length > 2) { | ||
@@ -154,2 +156,3 @@ let port = void 0; | ||
else if (arg === '--stdio') { | ||
stdio = true; | ||
input = process.stdin; | ||
@@ -211,2 +214,5 @@ output = process.stdout; | ||
const result = (0, node_1.createProtocolConnection)(input, output, logger, options); | ||
if (stdio) { | ||
patchConsole(logger); | ||
} | ||
return result; | ||
@@ -216,1 +222,58 @@ }; | ||
} | ||
function patchConsole(logger) { | ||
function serialize(args) { | ||
return args.map(arg => typeof arg === 'string' ? arg : (0, node_util_1.inspect)(arg)).join(' '); | ||
} | ||
const counters = new Map(); | ||
console.assert = function assert(assertion, ...args) { | ||
if (assertion) { | ||
return; | ||
} | ||
if (args.length === 0) { | ||
logger.error('Assertion failed'); | ||
} | ||
else { | ||
const [message, ...rest] = args; | ||
logger.error(`Assertion failed: ${message} ${serialize(rest)}`); | ||
} | ||
}; | ||
console.count = function count(label = 'default') { | ||
const message = String(label); | ||
let counter = counters.get(message) ?? 0; | ||
counter += 1; | ||
counters.set(message, counter); | ||
logger.log(`${message}: ${message}`); | ||
}; | ||
console.countReset = function countReset(label) { | ||
if (label === undefined) { | ||
counters.clear(); | ||
} | ||
else { | ||
counters.delete(String(label)); | ||
} | ||
}; | ||
console.debug = function debug(...args) { | ||
logger.log(serialize(args)); | ||
}; | ||
console.dir = function dir(arg, options) { | ||
// @ts-expect-error https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66626 | ||
logger.log((0, node_util_1.inspect)(arg, options)); | ||
}; | ||
console.log = function log(...args) { | ||
logger.log(serialize(args)); | ||
}; | ||
console.error = function error(...args) { | ||
logger.error(serialize(args)); | ||
}; | ||
console.trace = function trace(...args) { | ||
const stack = new Error().stack.replace(/(.+\n){2}/, ''); | ||
let message = 'Trace'; | ||
if (args.length !== 0) { | ||
message += `: ${serialize(args)}`; | ||
} | ||
logger.log(`${message}\n${stack}`); | ||
}; | ||
console.warn = function warn(...args) { | ||
logger.warn(serialize(args)); | ||
}; | ||
} |
{ | ||
"name": "vscode-languageserver", | ||
"description": "Language server implementation for node", | ||
"version": "8.2.0-next.3", | ||
"version": "9.0.0", | ||
"author": "Microsoft Corporation", | ||
@@ -27,3 +27,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"vscode-languageserver-protocol": "3.17.4-next.3" | ||
"vscode-languageserver-protocol": "3.17.4" | ||
}, | ||
@@ -30,0 +30,0 @@ "scripts": { |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
195873
61
4172
1
+ Addedvscode-jsonrpc@8.2.0(transitive)
+ Addedvscode-languageserver-protocol@3.17.4(transitive)
+ Addedvscode-languageserver-types@3.17.4(transitive)
- Removedvscode-jsonrpc@8.2.0-next.2(transitive)
- Removedvscode-languageserver-protocol@3.17.4-next.3(transitive)
- Removedvscode-languageserver-types@3.17.4-next.2(transitive)