@jupyterlab/lsp 4.0.5 → 4.0.6

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.
@@ -151,8 +151,8 @@ export declare abstract class WidgetLSPAdapter<T extends IDocumentWidget> implem
151
151
  protected abstract createVirtualDocument(): VirtualDocument;
152
152
  /**
153
153
  * Get the index of editor from the cursor position in the virtual
154
- * document. Since there is only one editor, this method always return
155
- * 0
154
+ * document.
155
+ * @deprecated This is error-prone and will be removed in JupyterLab 5.0, use `getEditorIndex()` with `virtualDocument.getEditorAtVirtualLine(position)` instead.
156
156
  *
157
157
  * @param position - the position of cursor in the virtual document.
158
158
  * @return - index of the virtual editor
package/lib/tokens.d.ts CHANGED
@@ -499,9 +499,11 @@ export declare namespace Method {
499
499
  }
500
500
  /** Client requests */
501
501
  enum ClientRequest {
502
+ CODE_ACTION = "textDocument/codeAction",
502
503
  COMPLETION = "textDocument/completion",
503
504
  COMPLETION_ITEM_RESOLVE = "completionItem/resolve",
504
505
  DEFINITION = "textDocument/definition",
506
+ DOCUMENT_COLOR = "textDocument/documentColor",
505
507
  DOCUMENT_HIGHLIGHT = "textDocument/documentHighlight",
506
508
  DOCUMENT_SYMBOL = "textDocument/documentSymbol",
507
509
  HOVER = "textDocument/hover",
@@ -510,7 +512,14 @@ export declare namespace Method {
510
512
  REFERENCES = "textDocument/references",
511
513
  RENAME = "textDocument/rename",
512
514
  SIGNATURE_HELP = "textDocument/signatureHelp",
513
- TYPE_DEFINITION = "textDocument/typeDefinition"
515
+ TYPE_DEFINITION = "textDocument/typeDefinition",
516
+ LINKED_EDITING_RANGE = "textDocument/linkedEditingRange",
517
+ INLINE_VALUE = "textDocument/inlineValue",
518
+ INLAY_HINT = "textDocument/inlayHint",
519
+ WORKSPACE_SYMBOL = "workspace/symbol",
520
+ WORKSPACE_SYMBOL_RESOLVE = "workspaceSymbol/resolve",
521
+ FORMATTING = "textDocument/formatting",
522
+ RANGE_FORMATTING = "textDocument/rangeFormatting"
514
523
  }
515
524
  }
516
525
  /**
@@ -556,9 +565,11 @@ export interface IServerResult {
556
565
  * Interface describing the request sent to the client.
557
566
  */
558
567
  export interface IClientRequestParams {
568
+ [Method.ClientRequest.CODE_ACTION]: lsp.CodeActionParams;
559
569
  [Method.ClientRequest.COMPLETION_ITEM_RESOLVE]: lsp.CompletionItem;
560
570
  [Method.ClientRequest.COMPLETION]: lsp.CompletionParams;
561
571
  [Method.ClientRequest.DEFINITION]: lsp.TextDocumentPositionParams;
572
+ [Method.ClientRequest.DOCUMENT_COLOR]: lsp.DocumentColorParams;
562
573
  [Method.ClientRequest.DOCUMENT_HIGHLIGHT]: lsp.TextDocumentPositionParams;
563
574
  [Method.ClientRequest.DOCUMENT_SYMBOL]: lsp.DocumentSymbolParams;
564
575
  [Method.ClientRequest.HOVER]: lsp.TextDocumentPositionParams;
@@ -568,14 +579,22 @@ export interface IClientRequestParams {
568
579
  [Method.ClientRequest.RENAME]: lsp.RenameParams;
569
580
  [Method.ClientRequest.SIGNATURE_HELP]: lsp.TextDocumentPositionParams;
570
581
  [Method.ClientRequest.TYPE_DEFINITION]: lsp.TextDocumentPositionParams;
582
+ [Method.ClientRequest.INLINE_VALUE]: lsp.InlineValueParams;
583
+ [Method.ClientRequest.INLAY_HINT]: lsp.InlayHintParams;
584
+ [Method.ClientRequest.WORKSPACE_SYMBOL]: lsp.WorkspaceSymbolParams;
585
+ [Method.ClientRequest.WORKSPACE_SYMBOL_RESOLVE]: lsp.WorkspaceSymbol;
586
+ [Method.ClientRequest.FORMATTING]: lsp.DocumentFormattingParams;
587
+ [Method.ClientRequest.RANGE_FORMATTING]: lsp.DocumentRangeFormattingParams;
571
588
  }
572
589
  /**
573
590
  * Interface describing the responses received from the client.
574
591
  */
575
592
  export interface IClientResult {
593
+ [Method.ClientRequest.CODE_ACTION]: (lsp.Command | lsp.CodeAction)[] | null;
576
594
  [Method.ClientRequest.COMPLETION_ITEM_RESOLVE]: lsp.CompletionItem;
577
595
  [Method.ClientRequest.COMPLETION]: AnyCompletion;
578
596
  [Method.ClientRequest.DEFINITION]: AnyLocation;
597
+ [Method.ClientRequest.DOCUMENT_COLOR]: lsp.ColorInformation[];
579
598
  [Method.ClientRequest.DOCUMENT_HIGHLIGHT]: lsp.DocumentHighlight[];
580
599
  [Method.ClientRequest.DOCUMENT_SYMBOL]: lsp.DocumentSymbol[];
581
600
  [Method.ClientRequest.HOVER]: lsp.Hover | null;
@@ -585,6 +604,12 @@ export interface IClientResult {
585
604
  [Method.ClientRequest.RENAME]: lsp.WorkspaceEdit;
586
605
  [Method.ClientRequest.SIGNATURE_HELP]: lsp.SignatureHelp;
587
606
  [Method.ClientRequest.TYPE_DEFINITION]: AnyLocation;
607
+ [Method.ClientRequest.INLINE_VALUE]: lsp.InlineValue[] | null;
608
+ [Method.ClientRequest.INLAY_HINT]: lsp.InlayHint[] | null;
609
+ [Method.ClientRequest.WORKSPACE_SYMBOL]: lsp.SymbolInformation[] | lsp.WorkspaceSymbol[] | null;
610
+ [Method.ClientRequest.WORKSPACE_SYMBOL_RESOLVE]: lsp.WorkspaceSymbol[];
611
+ [Method.ClientRequest.FORMATTING]: lsp.TextEdit[] | null;
612
+ [Method.ClientRequest.RANGE_FORMATTING]: lsp.TextEdit[] | null;
588
613
  }
589
614
  /**
590
615
  * Type of server notification handlers, it is a map between the server
package/lib/tokens.js CHANGED
@@ -69,9 +69,11 @@ export var Method;
69
69
  /** Client requests */
70
70
  let ClientRequest;
71
71
  (function (ClientRequest) {
72
+ ClientRequest["CODE_ACTION"] = "textDocument/codeAction";
72
73
  ClientRequest["COMPLETION"] = "textDocument/completion";
73
74
  ClientRequest["COMPLETION_ITEM_RESOLVE"] = "completionItem/resolve";
74
75
  ClientRequest["DEFINITION"] = "textDocument/definition";
76
+ ClientRequest["DOCUMENT_COLOR"] = "textDocument/documentColor";
75
77
  ClientRequest["DOCUMENT_HIGHLIGHT"] = "textDocument/documentHighlight";
76
78
  ClientRequest["DOCUMENT_SYMBOL"] = "textDocument/documentSymbol";
77
79
  ClientRequest["HOVER"] = "textDocument/hover";
@@ -81,6 +83,13 @@ export var Method;
81
83
  ClientRequest["RENAME"] = "textDocument/rename";
82
84
  ClientRequest["SIGNATURE_HELP"] = "textDocument/signatureHelp";
83
85
  ClientRequest["TYPE_DEFINITION"] = "textDocument/typeDefinition";
86
+ ClientRequest["LINKED_EDITING_RANGE"] = "textDocument/linkedEditingRange";
87
+ ClientRequest["INLINE_VALUE"] = "textDocument/inlineValue";
88
+ ClientRequest["INLAY_HINT"] = "textDocument/inlayHint";
89
+ ClientRequest["WORKSPACE_SYMBOL"] = "workspace/symbol";
90
+ ClientRequest["WORKSPACE_SYMBOL_RESOLVE"] = "workspaceSymbol/resolve";
91
+ ClientRequest["FORMATTING"] = "textDocument/formatting";
92
+ ClientRequest["RANGE_FORMATTING"] = "textDocument/rangeFormatting";
84
93
  })(ClientRequest = Method.ClientRequest || (Method.ClientRequest = {}));
85
94
  })(Method || (Method = {}));
86
95
  //# sourceMappingURL=tokens.js.map
package/lib/tokens.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAI3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAoQ1C,MAAM,KAAW,sBAAsB,CA0CtC;AA1CD,WAAiB,sBAAsB;IACrC;;OAEG;IACU,6BAAM,GAAG,KAAK,CAAC;AAsC9B,CAAC,EA1CgB,sBAAsB,KAAtB,sBAAsB,QA0CtC;AAsPD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,IAAI,KAAK,CACP,+CAA+C,EAC/C,yEAAyE,CAC1E,CAAC;AAEJ;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,KAAK,CACzC,oCAAoC,EACpC,2GAA2G,CAC5G,CAAC;AAEF;;;;;;;GAO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AA;QACrD,oEAAmD,CAAA;IACrD,CAAC,EALW,aAAa,GAAb,oBAAa,KAAb,oBAAa,QAKxB;IAED,sBAAsB;IACtB,IAAY,aAsBX;IAtBD,WAAY,aAAa;QACvB,wDAAuC,CAAA;QACvC,uDAAsC,CAAA;QACtC,mEAAkD,CAAA;QAClD,uDAAsC,CAAA;QACtC,8DAA6C,CAAA;QAC7C,sEAAqD,CAAA;QACrD,gEAA+C,CAAA;QAC/C,6CAA4B,CAAA;QAC5B,+DAA8C,CAAA;QAC9C,0CAAyB,CAAA;QACzB,uDAAsC,CAAA;QACtC,+CAA8B,CAAA;QAC9B,8DAA6C,CAAA;QAC7C,gEAA+C,CAAA;QAC/C,yEAAwD,CAAA;QACxD,0DAAyC,CAAA;QACzC,sDAAqC,CAAA;QACrC,sDAAqC,CAAA;QACrC,qEAAoD,CAAA;QACpD,uDAAsC,CAAA;QACtC,kEAAiD,CAAA;IACnD,CAAC,EAtBW,aAAa,GAAb,oBAAa,KAAb,oBAAa,QAsBxB;AACH,CAAC,EAnDgB,MAAM,KAAN,MAAM,QAmDtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jupyterlab/lsp",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/jupyterlab/jupyterlab",
6
6
  "bugs": {
@@ -44,12 +44,12 @@
44
44
  "vscode-languageserver-protocol": "^3.17.0"
45
45
  },
46
46
  "dependencies": {
47
- "@jupyterlab/apputils": "^4.1.5",
48
- "@jupyterlab/codeeditor": "^4.0.5",
49
- "@jupyterlab/coreutils": "^6.0.5",
50
- "@jupyterlab/docregistry": "^4.0.5",
51
- "@jupyterlab/services": "^7.0.5",
52
- "@jupyterlab/translation": "^4.0.5",
47
+ "@jupyterlab/apputils": "^4.1.6",
48
+ "@jupyterlab/codeeditor": "^4.0.6",
49
+ "@jupyterlab/coreutils": "^6.0.6",
50
+ "@jupyterlab/docregistry": "^4.0.6",
51
+ "@jupyterlab/services": "^7.0.6",
52
+ "@jupyterlab/translation": "^4.0.6",
53
53
  "@lumino/coreutils": "^2.1.2",
54
54
  "@lumino/disposable": "^2.1.2",
55
55
  "@lumino/signaling": "^2.1.2",
@@ -59,7 +59,7 @@
59
59
  "vscode-ws-jsonrpc": "~1.0.2"
60
60
  },
61
61
  "devDependencies": {
62
- "@jupyterlab/testing": "^4.0.5",
62
+ "@jupyterlab/testing": "^4.0.6",
63
63
  "@types/jest": "^29.2.0",
64
64
  "@types/lodash.mergewith": "^4.6.1",
65
65
  "jest": "^29.2.0",
@@ -339,8 +339,8 @@ export abstract class WidgetLSPAdapter<T extends IDocumentWidget>
339
339
 
340
340
  /**
341
341
  * Get the index of editor from the cursor position in the virtual
342
- * document. Since there is only one editor, this method always return
343
- * 0
342
+ * document.
343
+ * @deprecated This is error-prone and will be removed in JupyterLab 5.0, use `getEditorIndex()` with `virtualDocument.getEditorAtVirtualLine(position)` instead.
344
344
  *
345
345
  * @param position - the position of cursor in the virtual document.
346
346
  * @return - index of the virtual editor
package/src/tokens.ts CHANGED
@@ -638,9 +638,11 @@ export namespace Method {
638
638
 
639
639
  /** Client requests */
640
640
  export enum ClientRequest {
641
+ CODE_ACTION = 'textDocument/codeAction',
641
642
  COMPLETION = 'textDocument/completion',
642
643
  COMPLETION_ITEM_RESOLVE = 'completionItem/resolve',
643
644
  DEFINITION = 'textDocument/definition',
645
+ DOCUMENT_COLOR = 'textDocument/documentColor',
644
646
  DOCUMENT_HIGHLIGHT = 'textDocument/documentHighlight',
645
647
  DOCUMENT_SYMBOL = 'textDocument/documentSymbol',
646
648
  HOVER = 'textDocument/hover',
@@ -649,7 +651,14 @@ export namespace Method {
649
651
  REFERENCES = 'textDocument/references',
650
652
  RENAME = 'textDocument/rename',
651
653
  SIGNATURE_HELP = 'textDocument/signatureHelp',
652
- TYPE_DEFINITION = 'textDocument/typeDefinition'
654
+ TYPE_DEFINITION = 'textDocument/typeDefinition',
655
+ LINKED_EDITING_RANGE = 'textDocument/linkedEditingRange',
656
+ INLINE_VALUE = 'textDocument/inlineValue',
657
+ INLAY_HINT = 'textDocument/inlayHint',
658
+ WORKSPACE_SYMBOL = 'workspace/symbol',
659
+ WORKSPACE_SYMBOL_RESOLVE = 'workspaceSymbol/resolve',
660
+ FORMATTING = 'textDocument/formatting',
661
+ RANGE_FORMATTING = 'textDocument/rangeFormatting'
653
662
  }
654
663
  }
655
664
 
@@ -700,9 +709,11 @@ export interface IServerResult {
700
709
  * Interface describing the request sent to the client.
701
710
  */
702
711
  export interface IClientRequestParams {
712
+ [Method.ClientRequest.CODE_ACTION]: lsp.CodeActionParams;
703
713
  [Method.ClientRequest.COMPLETION_ITEM_RESOLVE]: lsp.CompletionItem;
704
714
  [Method.ClientRequest.COMPLETION]: lsp.CompletionParams;
705
715
  [Method.ClientRequest.DEFINITION]: lsp.TextDocumentPositionParams;
716
+ [Method.ClientRequest.DOCUMENT_COLOR]: lsp.DocumentColorParams;
706
717
  [Method.ClientRequest.DOCUMENT_HIGHLIGHT]: lsp.TextDocumentPositionParams;
707
718
  [Method.ClientRequest.DOCUMENT_SYMBOL]: lsp.DocumentSymbolParams;
708
719
  [Method.ClientRequest.HOVER]: lsp.TextDocumentPositionParams;
@@ -712,15 +723,23 @@ export interface IClientRequestParams {
712
723
  [Method.ClientRequest.RENAME]: lsp.RenameParams;
713
724
  [Method.ClientRequest.SIGNATURE_HELP]: lsp.TextDocumentPositionParams;
714
725
  [Method.ClientRequest.TYPE_DEFINITION]: lsp.TextDocumentPositionParams;
726
+ [Method.ClientRequest.INLINE_VALUE]: lsp.InlineValueParams;
727
+ [Method.ClientRequest.INLAY_HINT]: lsp.InlayHintParams;
728
+ [Method.ClientRequest.WORKSPACE_SYMBOL]: lsp.WorkspaceSymbolParams;
729
+ [Method.ClientRequest.WORKSPACE_SYMBOL_RESOLVE]: lsp.WorkspaceSymbol;
730
+ [Method.ClientRequest.FORMATTING]: lsp.DocumentFormattingParams;
731
+ [Method.ClientRequest.RANGE_FORMATTING]: lsp.DocumentRangeFormattingParams;
715
732
  }
716
733
 
717
734
  /**
718
735
  * Interface describing the responses received from the client.
719
736
  */
720
737
  export interface IClientResult {
738
+ [Method.ClientRequest.CODE_ACTION]: (lsp.Command | lsp.CodeAction)[] | null;
721
739
  [Method.ClientRequest.COMPLETION_ITEM_RESOLVE]: lsp.CompletionItem;
722
740
  [Method.ClientRequest.COMPLETION]: AnyCompletion;
723
741
  [Method.ClientRequest.DEFINITION]: AnyLocation;
742
+ [Method.ClientRequest.DOCUMENT_COLOR]: lsp.ColorInformation[];
724
743
  [Method.ClientRequest.DOCUMENT_HIGHLIGHT]: lsp.DocumentHighlight[];
725
744
  [Method.ClientRequest.DOCUMENT_SYMBOL]: lsp.DocumentSymbol[];
726
745
  [Method.ClientRequest.HOVER]: lsp.Hover | null;
@@ -730,6 +749,15 @@ export interface IClientResult {
730
749
  [Method.ClientRequest.RENAME]: lsp.WorkspaceEdit;
731
750
  [Method.ClientRequest.SIGNATURE_HELP]: lsp.SignatureHelp;
732
751
  [Method.ClientRequest.TYPE_DEFINITION]: AnyLocation;
752
+ [Method.ClientRequest.INLINE_VALUE]: lsp.InlineValue[] | null;
753
+ [Method.ClientRequest.INLAY_HINT]: lsp.InlayHint[] | null;
754
+ [Method.ClientRequest.WORKSPACE_SYMBOL]:
755
+ | lsp.SymbolInformation[]
756
+ | lsp.WorkspaceSymbol[]
757
+ | null;
758
+ [Method.ClientRequest.WORKSPACE_SYMBOL_RESOLVE]: lsp.WorkspaceSymbol[];
759
+ [Method.ClientRequest.FORMATTING]: lsp.TextEdit[] | null;
760
+ [Method.ClientRequest.RANGE_FORMATTING]: lsp.TextEdit[] | null;
733
761
  }
734
762
 
735
763
  /**