@adecore/lsp 0.53.2 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/document.d.ts +1 -1
- package/dist/edits.js +1 -6
- package/dist/service.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/test-transport.d.ts +1 -1
- package/package.json +4 -1
- package/src/document.ts +2 -2
- package/src/edits.ts +1 -8
- package/src/service.ts +1 -1
- package/src/session.ts +2 -2
- package/src/test-transport.ts +1 -1
package/dist/document.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LspSession } from './session.ts';
|
|
2
1
|
import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, CodeAction, CodeActionContext, CodeLens, Color, ColorInformation, ColorPresentation, Command, CompletionContext, CompletionItem, CompletionResult, ContentChange, DocumentDiagnosticReport, DocumentHighlight, DocumentItem, DocumentLink, DocumentRequestOptions, DocumentSymbolResult, FoldingRange, FormattingOptions, Hover, InlayHint, InlineCompletionContext, InlineCompletionResult, InlineValue, InlineValueContext, LinkedEditingRanges, Location, Moniker, NavigationResult, Position, PrepareRenameResult, Range, SelectionRange, SemanticTokens, SemanticTokensDelta, SignatureHelp, SignatureHelpContext, TextDocumentSaveReason, TextEdit, TypeHierarchyItem, WorkspaceEdit } from './protocol.ts';
|
|
2
|
+
import type { LspSession } from './session.ts';
|
|
3
3
|
export declare class LspDocument {
|
|
4
4
|
readonly session: LspSession;
|
|
5
5
|
readonly uri: string;
|
package/dist/edits.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHighSurrogate, isLowSurrogate } from '@adecore/utils/text';
|
|
1
2
|
import { ErrorCodes, LspError } from './connection.js';
|
|
2
3
|
import { fileUriKey } from './uris.js';
|
|
3
4
|
export const CR = 13;
|
|
@@ -138,12 +139,6 @@ export function applyContentChanges(text, changes) {
|
|
|
138
139
|
}
|
|
139
140
|
return result;
|
|
140
141
|
}
|
|
141
|
-
function isHighSurrogate(code) {
|
|
142
|
-
return code >= 0xd800 && code <= 0xdbff;
|
|
143
|
-
}
|
|
144
|
-
function isLowSurrogate(code) {
|
|
145
|
-
return code >= 0xdc00 && code <= 0xdfff;
|
|
146
|
-
}
|
|
147
142
|
/*
|
|
148
143
|
* The one change that turns `before` into `after`: what is left once the shared start and end are
|
|
149
144
|
* taken off. A range never starts or ends inside a surrogate pair or a CRLF, which no position can
|
package/dist/service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, CodeAction, CodeActionContext, CodeLens, Color, ColorInformation, ColorPresentation, Command, CompletionContext, CompletionItem, CompletionResult, ContentChange, Diagnostic, Disposable, DocumentHighlight, DocumentLink, DocumentSymbolResult, FoldingRange, FormattingOptions, Hover, InlayHint, InlineCompletionContext, InlineCompletionResult, InlineValue, InlineValueContext, LinkedEditingRanges, Location, MessageType, Moniker, NavigationResult, Position, PrepareRenameResult, PreviousResultId, ProviderOptions, Range, SelectionRange, SemanticTokens, SemanticTokensDelta, ShowDocumentParams, ShowDocumentResult, SignatureHelp, SignatureHelpContext, TextDocumentSaveReason, TextEdit, TypeHierarchyItem, WorkspaceDiagnosticReport, WorkspaceEdit, WorkspaceSymbolResult } from './protocol.ts';
|
|
2
1
|
import type { CreatedFile, DeletedFile } from './file-operations.ts';
|
|
2
|
+
import type { CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, CodeAction, CodeActionContext, CodeLens, Color, ColorInformation, ColorPresentation, Command, CompletionContext, CompletionItem, CompletionResult, ContentChange, Diagnostic, Disposable, DocumentHighlight, DocumentLink, DocumentSymbolResult, FoldingRange, FormattingOptions, Hover, InlayHint, InlineCompletionContext, InlineCompletionResult, InlineValue, InlineValueContext, LinkedEditingRanges, Location, MessageType, Moniker, NavigationResult, Position, PrepareRenameResult, PreviousResultId, ProviderOptions, Range, SelectionRange, SemanticTokens, SemanticTokensDelta, ShowDocumentParams, ShowDocumentResult, SignatureHelp, SignatureHelpContext, TextDocumentSaveReason, TextEdit, TypeHierarchyItem, WorkspaceDiagnosticReport, WorkspaceEdit, WorkspaceSymbolResult } from './protocol.ts';
|
|
3
3
|
export interface LanguageDocument {
|
|
4
4
|
uri: string;
|
|
5
5
|
languageId: string;
|
package/dist/session.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JsonRpcConnection, type RequestHandler } from './connection.ts';
|
|
2
2
|
import { LspDocument } from './document.ts';
|
|
3
3
|
import { type CreatedFile, type DeletedFile, type RenamedFile } from './file-operations.ts';
|
|
4
|
-
import type { ResourceOperationKind } from './workspace-operations.ts';
|
|
5
4
|
import type { ApplyWorkspaceEditParams, ApplyWorkspaceEditResult, Command, ConfigurationItem, Disposable, DocumentItem, FileEvent, FileOperation, FileOperationFilter, FileSystemWatcher, InitializeResult, LogMessageParams, LogTraceParams, LspTransport, MessageActionItem, NotebookDocument, NotebookDocumentChangeEvent, PreviousResultId, ProgressParams, ProgressToken, ProviderOptions, PublishDiagnosticsParams, RequestOptions, ServerCapabilities, ShowDocumentParams, ShowDocumentResult, ShowMessageParams, ShowMessageRequestParams, TextDocumentContentResult, TextDocumentSyncOptions, TraceValue, WorkspaceDiagnosticReport, WorkspaceEdit, WorkspaceFolder, WorkspaceFoldersChangeEvent, WorkspaceSymbol, WorkspaceSymbolResult } from './protocol.ts';
|
|
5
|
+
import type { ResourceOperationKind } from './workspace-operations.ts';
|
|
6
6
|
export type SessionState = 'new' | 'initializing' | 'ready' | 'closing' | 'closed';
|
|
7
7
|
export interface LspSessionOptions {
|
|
8
8
|
rootUri?: string | null;
|
package/dist/test-transport.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LspSession, type LspSessionOptions } from './session.ts';
|
|
2
1
|
import type { LspTransport, RpcMessage, ServerCapabilities } from './protocol.ts';
|
|
2
|
+
import { LspSession, type LspSessionOptions } from './session.ts';
|
|
3
3
|
export declare class ScriptedTransport implements LspTransport {
|
|
4
4
|
sent: RpcMessage[];
|
|
5
5
|
messages: Set<(message: unknown) => void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/lsp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"build": "bun scripts/build.ts",
|
|
20
20
|
"test": "bun test --conditions=source"
|
|
21
21
|
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@adecore/utils": "0.54.0"
|
|
24
|
+
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@types/bun": "^1.4.4",
|
|
24
27
|
"typescript": "^7.0.2"
|
package/src/document.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ErrorCodes, LspError, StaleResultError } from './connection.ts';
|
|
2
2
|
import { minimalChange } from './edits.ts';
|
|
3
|
-
import type { LspSession } from './session.ts';
|
|
4
|
-
import { TextMirror } from './text-mirror.ts';
|
|
5
3
|
import type {
|
|
6
4
|
CallHierarchyIncomingCall,
|
|
7
5
|
CallHierarchyItem,
|
|
@@ -48,6 +46,8 @@ import type {
|
|
|
48
46
|
TypeHierarchyItem,
|
|
49
47
|
WorkspaceEdit
|
|
50
48
|
} from './protocol.ts';
|
|
49
|
+
import type { LspSession } from './session.ts';
|
|
50
|
+
import { TextMirror } from './text-mirror.ts';
|
|
51
51
|
|
|
52
52
|
/* The delay of the VS Code language client for servers with full sync. */
|
|
53
53
|
const FULL_SYNC_DELAY_MS = 200;
|
package/src/edits.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isHighSurrogate, isLowSurrogate } from '@adecore/utils/text';
|
|
1
2
|
import { ErrorCodes, LspError } from './connection.ts';
|
|
2
3
|
import type { ContentChange, CreateFile, Position, TextEdit, WorkspaceEdit } from './protocol.ts';
|
|
3
4
|
import { fileUriKey } from './uris.ts';
|
|
@@ -191,14 +192,6 @@ export function applyContentChanges(text: string, changes: readonly ContentChang
|
|
|
191
192
|
return result;
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
function isHighSurrogate(code: number): boolean {
|
|
195
|
-
return code >= 0xd800 && code <= 0xdbff;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function isLowSurrogate(code: number): boolean {
|
|
199
|
-
return code >= 0xdc00 && code <= 0xdfff;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
195
|
/*
|
|
203
196
|
* The one change that turns `before` into `after`: what is left once the shared start and end are
|
|
204
197
|
* taken off. A range never starts or ends inside a surrogate pair or a CRLF, which no position can
|
package/src/service.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CreatedFile, DeletedFile } from './file-operations.ts';
|
|
1
2
|
import type {
|
|
2
3
|
CallHierarchyIncomingCall,
|
|
3
4
|
CallHierarchyItem,
|
|
@@ -50,7 +51,6 @@ import type {
|
|
|
50
51
|
WorkspaceEdit,
|
|
51
52
|
WorkspaceSymbolResult
|
|
52
53
|
} from './protocol.ts';
|
|
53
|
-
import type { CreatedFile, DeletedFile } from './file-operations.ts';
|
|
54
54
|
|
|
55
55
|
export interface LanguageDocument {
|
|
56
56
|
/* The `file:` URI the language servers know the file by, which `pathToFileUri` makes of a path. */
|
package/src/session.ts
CHANGED
|
@@ -2,8 +2,6 @@ import { ErrorCodes, JsonRpcConnection, LspError, type RequestHandler } from './
|
|
|
2
2
|
import { LspDocument } from './document.ts';
|
|
3
3
|
import { createsTaken, deletesTaken, renamesTaken, type CreatedFile, type DeletedFile, type RenamedFile } from './file-operations.ts';
|
|
4
4
|
import { globMatch } from './glob.ts';
|
|
5
|
-
import { fileUriKey } from './uris.ts';
|
|
6
|
-
import type { ResourceOperationKind } from './workspace-operations.ts';
|
|
7
5
|
import type {
|
|
8
6
|
ApplyWorkspaceEditParams,
|
|
9
7
|
ApplyWorkspaceEditResult,
|
|
@@ -44,6 +42,8 @@ import type {
|
|
|
44
42
|
WorkspaceSymbol,
|
|
45
43
|
WorkspaceSymbolResult
|
|
46
44
|
} from './protocol.ts';
|
|
45
|
+
import { fileUriKey } from './uris.ts';
|
|
46
|
+
import type { ResourceOperationKind } from './workspace-operations.ts';
|
|
47
47
|
|
|
48
48
|
export type SessionState = 'new' | 'initializing' | 'ready' | 'closing' | 'closed';
|
|
49
49
|
|
package/src/test-transport.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LspSession, type LspSessionOptions } from './session.ts';
|
|
2
1
|
import type { LspTransport, RpcMessage, ServerCapabilities } from './protocol.ts';
|
|
2
|
+
import { LspSession, type LspSessionOptions } from './session.ts';
|
|
3
3
|
|
|
4
4
|
/* A transport that records what is sent and lets a test say what comes back, for tests that assert on the exact wire. */
|
|
5
5
|
export class ScriptedTransport implements LspTransport {
|