File tree 2 files changed +15
-19
lines changed 2 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -561,7 +561,7 @@ export class LanguageClientManager {
561
561
} ,
562
562
errorHandler : new SourceKitLSPErrorHandler ( 5 ) ,
563
563
initializationOptions : {
564
- peekDocuments : true , // client capability to handle `PeekDocumentsRequest`
564
+ peekDocuments : true , // workaround for client capability to handle `PeekDocumentsRequest`
565
565
} ,
566
566
} ;
567
567
@@ -637,10 +637,13 @@ export class LanguageClientManager {
637
637
638
638
await vscode . commands . executeCommand (
639
639
"editor.action.peekLocations" ,
640
- params . uri ?? vscode . window . activeTextEditor ?. document . uri ,
641
- params . position ?? vscode . window . activeTextEditor ?. selection . active ,
640
+ vscode . Uri . from ( {
641
+ scheme : "file" ,
642
+ path : new URL ( params . uri ) . pathname ,
643
+ } ) ,
644
+ new vscode . Position ( params . position . line , params . position . character ) ,
642
645
locations ,
643
- params . multiple
646
+ "peek"
644
647
) ;
645
648
646
649
return { success : true } ;
Original file line number Diff line number Diff line change 14
14
15
15
import * as ls from "vscode-languageserver-protocol" ;
16
16
import * as langclient from "vscode-languageclient/node" ;
17
- import { Position , Uri } from "vscode" ;
17
+ import * as vscode from "vscode" ;
18
18
19
19
// Definitions for non-standard requests used by sourcekit-lsp
20
20
21
21
// Peek Documents
22
22
export interface PeekDocumentsParams {
23
23
/**
24
- * The `Uri` of the text document in which to show the "peeked" editor
25
- * (default: current document in the active editor)
24
+ * The `DocumentUri` of the text document in which to show the "peeked" editor
26
25
*/
27
- uri ?: Uri ;
26
+ uri : langclient . DocumentUri ;
28
27
29
28
/**
30
- * The position in the given text document in which to show the
31
- * "peeked editor" (default: current cursor position in the active editor)
29
+ * The `Position` in the given text document in which to show the "peeked editor"
32
30
*/
33
- position ?: Position ;
31
+ position : vscode . Position ;
34
32
35
33
/**
36
- * An array `Uri ` of the documents to appear inside the "peeked" editor
34
+ * An array `DocumentUri ` of the documents to appear inside the "peeked" editor
37
35
*/
38
- locations : Uri [ ] ;
39
-
40
- /**
41
- * Presentation strategy when having multiple locations (default: "peek")
42
- */
43
- multiple : string ;
36
+ locations : langclient . DocumentUri [ ] ;
44
37
}
45
38
46
39
/**
@@ -61,7 +54,7 @@ export const PeekDocumentsRequest = new langclient.RequestType<
61
54
PeekDocumentsParams ,
62
55
PeekDocumentsResult ,
63
56
unknown
64
- > ( "sourcekit-lsp /peekDocuments" ) ;
57
+ > ( "workspace /peekDocuments" ) ;
65
58
66
59
// Inlay Hints (pre Swift 5.6)
67
60
export interface LegacyInlayHintsParams {
You can’t perform that action at this time.
0 commit comments