|
- 关于jupyter-lsp的安装配置:
- 1、安装安装JupyterLab-lsp:
- pip install jupyter-lsp
- 2、安装语言包:
- pip install python-lsp-server[all]
- 3、安装扩展服务器:
- jupyter labextension install @krassowski/jupyterlab-lsp
- 4、重启
- 5、配置参数:
- (1)Code Completion->
- {
- // Code Completion
- // @krassowski/jupyterlab-lsp:completion
- // LSP Completion settings.
- // *************************************
-
- // Case-sensitive filtering
- // Should completion filtering be case-sensitive?
- "caseSensitive": true,
-
- // Continuous hinting:代码自动悬浮
- // Whether to enable continuous hinting (Hinterland mode).
- "continuousHinting": true,
-
- // Disable:停止使用
- // Disable this feature. Requires reloading JupyterLab to apply changes.
- "disable": false,
-
- //
- // The sources from which to exclude completion from. Possible values include 'Kernel', 'LSP'.
- "disableCompletionsFrom": [],
-
- // Include perfect matches
- // Should perfect matches be included in the completion suggestions list?
- "includePerfectMatches": true,
-
- // Prioritize completions from kernel
- // In case of ties when sorting completions, should the kernel completions receive higher priority than the language server completions?
- "kernelCompletionsFirst": false,
-
- // Kernel completion response timeout
- // The time to wait for the kernel completions suggestions in milliseconds. Set to 0 to disable kernel completions, or to -1 to wait indefinitely (not recommended).
- "kernelResponseTimeout": -1,
-
- // Text to display next to completion label
- // What to display next to the completion label, one of: 'detail', 'type', 'source', 'auto'. The default 'auto' will display whichever information is available.
- "labelExtra": "auto",
-
- // Completer layout
- // Layout of the completer, one of: 'detail-below', 'side-by-side'
- "layout": "side-by-side",
-
- // Show documentation box:显示文档框
- // Whether to show documentation box next to the completion suggestions.
- "showDocumentation": true,
-
- // Suppress invoke continuous hinting in specific code fragments:禁止在特定代码片段中调用连续提示
- // An array of CodeMirror tokens for which the continuous hinting should be suppressed. The token names vary between languages (modes).
- "suppressContinuousHintingIn": [
- "comment",
- "string",
- "def"
- ],
-
- // Suppress invoke via trigger character in specific code fragments
- // An array of CodeMirror tokens for which the auto-invoke after entering a trigger (e.g. `.` in Python or `::` in R) character should be suppressed. The token names vary between languages (modes).
- "suppressTriggerCharacterIn": [
- "comment",
- "string"
- ],
-
- // Completer theme
- // The identifier of a completer theme with icons which indicate the kind of completion. Set to null to disable icons. Search for 'completer themes' in the command palette for a command displaying available themes.
- "theme": "vscode",
-
- // Mapping of custom kernel types to valid completion kind names
- // Mapping used for icon selection. The kernel types (keys) are case-insensitive. Accepted values are the names of CompletionItemKind and 'Kernel' literal. The defaults aim to provide good initial experience for Julia, Python and R kernels.
- "typesMap": {
- "<unknown>": "Kernel",
- "instance": "Value",
- "path": "File",
- "param": "Variable",
- "missing": "Constant",
- "nothing": "Constant",
- "undefinitializer": "Constant",
- "base.devnull": "Constant"
- },
-
- // Wait for kernel if busy
- // Should an attempt to get the kernel response (with timeout as specified by kernelResponseTimeout) be made if kernel is busy? If you often write code in notebook while computations are running for long time (e.g. training models), turning this off might give you faster response times.:如果内核繁忙,是否应该尝试获取内核响应(超时由kernelResponseTimeout指定)?如果你经常在计算运行很长时间(例如训练模型)的时候在笔记本上写代码,那么关闭这个功能可能会让你的响应速度更快。
- "waitForBusyKernel": false
- }
-
- (2)language server->
- // {
- // "language_servers": {
- // "pyls": {
- // "serverSettings": {
- // "pyls": {
- // "plugins": {
- // "pydocstyle": {
- // "enabled": true
- // },
- // "pyflakes": {
- // "enabled": false
- // },
- // "flake8": {
- // "enabled": true
- // }
- // }
- // }
- // }
- // }
- // }
- // }
-
- {
- "language_servers": {
- "pyls": {
- "serverSettings": {
- "pyls.plugins.pydocstyle.enabled": true,
- "pyls.plugins.pyflakes.enabled": false,
- "pyls.plugins.flake8.enabled": true
- }
- },
- "r-languageserver": {
- "serverSettings": {
- "r.lsp.debug": false,
- "r.lsp.diagnostics": false
- }
- }
- }
- }
|