@devbookhq/code-editor
Advanced tools
Comparing version 0.1.10 to 0.1.11
import * as react from 'react'; | ||
import { Extension } from '@codemirror/state'; | ||
import { Diagnostic } from '@codemirror/lint'; | ||
import { StateEffectType, Extension } from '@codemirror/state'; | ||
import { Session } from '@devbookhq/sdk'; | ||
@@ -7,7 +8,24 @@ import * as vscode_languageserver_protocol from 'vscode-languageserver-protocol'; | ||
import { CompletionContext, CompletionResult } from '@codemirror/autocomplete'; | ||
import { PluginValue, EditorView, ViewUpdate, Tooltip } from '@codemirror/view'; | ||
import { PluginValue, EditorView, Tooltip, ViewUpdate } from '@codemirror/view'; | ||
import { MessageConnection, Message, NotificationHandler, CancellationToken } from 'vscode-ws-jsonrpc'; | ||
declare class SignatureState implements PluginValue { | ||
private readonly view; | ||
private readonly getPlugin; | ||
private readonly setSignatureHelp; | ||
private lastSignature?; | ||
constructor(view: EditorView, getPlugin: () => LanguageServerPlugin | null, setSignatureHelp: StateEffectType<Tooltip | null>); | ||
/** | ||
* Call this after the change to the textDocument is propagated to the language server | ||
*/ | ||
handleUpdate(update: ViewUpdate): Promise<void>; | ||
private updateSignature; | ||
private getTooltip; | ||
private setTooltip; | ||
} | ||
declare class LanguageServerPlugin implements PluginValue { | ||
private view; | ||
private readonly getSignatureState; | ||
private readonly onDiagnosticsChange?; | ||
readonly client: LanguageServerClient; | ||
@@ -18,5 +36,5 @@ private readonly openPromise; | ||
private diagnostics?; | ||
constructor(view: EditorView, openFile: boolean); | ||
constructor(view: EditorView, openFile: boolean, getSignatureState: () => SignatureState, onDiagnosticsChange?: ((diagnostics: Diagnostic[]) => void) | undefined); | ||
private get nextDocumentVersion(); | ||
update({ docChanged, state }: ViewUpdate): Promise<void>; | ||
update(viewUpdate: ViewUpdate): Promise<void>; | ||
destroy(): void; | ||
@@ -216,2 +234,4 @@ requestFormatting(view: EditorView): Promise<null | undefined>; | ||
onContentChange?: (content: string) => void; | ||
handleRun?: () => void; | ||
onDiagnosticsChange?: (diagnostics: ExtendedCMDiagnostic[]) => void; | ||
supportedLanguages: LanguageSetup[]; | ||
@@ -239,4 +259,8 @@ height?: string; | ||
} | ||
interface ExtendedCMDiagnostic extends Diagnostic { | ||
filename: string; | ||
} | ||
interface Handler { | ||
focus: () => void; | ||
getDiagnostics: () => ExtendedCMDiagnostic[] | undefined; | ||
} | ||
@@ -243,0 +267,0 @@ declare const CodeEditor: react.ForwardRefExoticComponent<Props & react.RefAttributes<Handler>>; |
{ | ||
"name": "@devbookhq/code-editor", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.mjs", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
483323
5458