11import * as monaco from "monaco-editor" ;
22import type * as ls from "vscode-languageserver-types" ;
3- import type * as lst from "vscode-languageserver-types" ;
43
54export function asPosition ( value : undefined | null ) : undefined ;
65export function asPosition ( value : ls . Position ) : monaco . Position ;
@@ -32,7 +31,7 @@ export function asRange(
3231}
3332
3433export function asDiagnostics (
35- diagnostics : lst . Diagnostic [ ] ,
34+ diagnostics : ls . Diagnostic [ ] ,
3635) : monaco . editor . IMarkerData [ ] {
3736 return diagnostics . map ( diagnostic => {
3837 const range = asRange ( diagnostic . range ) ;
@@ -54,7 +53,7 @@ export function asDiagnostics(
5453}
5554
5655export function asCompletionList (
57- completions : lst . CompletionItem [ ] | null | undefined ,
56+ completions : ls . CompletionItem [ ] | null | undefined ,
5857 position : monaco . Position ,
5958) : monaco . languages . CompletionList {
6059 const defaultMonacoRange = monaco . Range . fromPositions ( position ) ;
@@ -67,7 +66,7 @@ export function asCompletionList(
6766}
6867
6968export function asCompletionResult (
70- result : lst . CompletionItem [ ] | null | undefined ,
69+ result : ls . CompletionItem [ ] | null | undefined ,
7170) : monaco . languages . CompletionList {
7271 if ( ! result ) {
7372 return {
@@ -85,7 +84,7 @@ export function asCompletionResult(
8584}
8685
8786export function asCompletionItem (
88- item : lst . CompletionItem ,
87+ item : ls . CompletionItem ,
8988 defaultRange : monaco . IRange | undefined ,
9089 insertTextReplaceRange ?: monaco . IRange ,
9190) : monaco . languages . CompletionItem {
@@ -132,12 +131,12 @@ export function asCompletionItem(
132131}
133132
134133export function asHover ( hover : null | undefined ) : null ;
135- export function asHover ( hover : lst . Hover ) : monaco . languages . Hover ;
134+ export function asHover ( hover : ls . Hover ) : monaco . languages . Hover ;
136135export function asHover (
137- hover : lst . Hover | null | undefined ,
136+ hover : ls . Hover | null | undefined ,
138137) : monaco . languages . Hover | null ;
139138export function asHover (
140- hover : lst . Hover | null | undefined ,
139+ hover : ls . Hover | null | undefined ,
141140) : monaco . languages . Hover | null {
142141 return hover
143142 ? {
@@ -148,7 +147,7 @@ export function asHover(
148147}
149148
150149export function asDefinitionResult (
151- definition : lst . Location | lst . Location [ ] | null | undefined ,
150+ definition : ls . Location | ls . Location [ ] | null | undefined ,
152151) : monaco . languages . Definition | null {
153152 if ( ! definition ) {
154153 return null ;
@@ -162,20 +161,20 @@ export function asDefinitionResult(
162161}
163162
164163export function asReferences (
165- references : lst . Location [ ] | null | undefined ,
164+ references : ls . Location [ ] | null | undefined ,
166165) : monaco . languages . Location [ ] {
167166 return references ?. map ( ref => asLocation ( ref ) ) ?? [ ] ;
168167}
169168
170- function asLocation ( location : lst . Location ) : monaco . languages . Location {
169+ function asLocation ( location : ls . Location ) : monaco . languages . Location {
171170 return {
172171 uri : monaco . Uri . parse ( location . uri ) ,
173172 range : asRange ( location . range ) ,
174173 } ;
175174}
176175
177176export function asWorkspaceEdit (
178- edit : lst . WorkspaceEdit | null | undefined ,
177+ edit : ls . WorkspaceEdit | null | undefined ,
179178) : monaco . languages . WorkspaceEdit | undefined {
180179 if ( ! edit ) {
181180 return undefined ;
@@ -203,7 +202,7 @@ export function asWorkspaceEdit(
203202}
204203
205204export function asCodeActionList (
206- commands : ( lst . CodeAction | lst . Command ) [ ] | null | undefined ,
205+ commands : ( ls . CodeAction | ls . Command ) [ ] | null | undefined ,
207206) : monaco . languages . CodeActionList | null {
208207 if ( ! commands ) {
209208 return null ;
@@ -215,7 +214,7 @@ export function asCodeActionList(
215214 typeof command . command === "string" &&
216215 "arguments" in command
217216 ) {
218- const cmd = command as lst . Command ;
217+ const cmd = command as ls . Command ;
219218 return {
220219 title : cmd . title ,
221220 command : {
@@ -226,7 +225,7 @@ export function asCodeActionList(
226225 } ;
227226 }
228227
229- const codeAction = command as lst . CodeAction ;
228+ const codeAction = command as ls . CodeAction ;
230229 const action : monaco . languages . CodeAction = {
231230 title : codeAction . title ,
232231 kind : codeAction . kind ,
@@ -261,7 +260,7 @@ export function asCodeActionList(
261260}
262261
263262export function asColorInformation (
264- colorInfo : lst . ColorInformation [ ] | null | undefined ,
263+ colorInfo : ls . ColorInformation [ ] | null | undefined ,
265264) : monaco . languages . IColorInformation [ ] {
266265 if ( ! colorInfo ) {
267266 return [ ] ;
@@ -274,7 +273,7 @@ export function asColorInformation(
274273}
275274
276275export function asColorPresentations (
277- presentations : lst . ColorPresentation [ ] | null | undefined ,
276+ presentations : ls . ColorPresentation [ ] | null | undefined ,
278277) : monaco . languages . IColorPresentation [ ] {
279278 if ( ! presentations ) {
280279 return [ ] ;
0 commit comments