lsp-bridge
lsp-bridge copied to clipboard
org-mode source block, manually complete not work , although auto pop up menu completion working
in org-mode python source code block, even though the auto completion popup menu has candidate, however the manual completion with lsp-bridge-popup-complete-menu
command give no completion.
manually complete not work in org-mode source block
-
auto complete popup menu
-
manually complete with command
lsp-bridge-popup-complete-menu
, has not completion -
log messages in buffer
*lsp-bridge*
buffer
--- [17:34:12.209880] Send textDocument/completion request (20525) to 'pyright' for project demo1.org
--- [17:34:12.231148] Recv textDocument/completion response (20525) from 'pyright' for project demo1.org
--- [17:34:12.232222] Got completion candidates (14) from 'pyright' for file demo1.org
--- [17:34:12.232365] Record completion candidates (14) from 'pyright' for file demo1.org
**** notice: the above log generated during auto complete *****
--- [17:34:12.362166] Recv textDocument/publishDiagnostics notification from 'pyright' for project demo1.org
--- [17:34:12.606872] Send textDocument/signatureHelp request (43466) to 'pyright' for project demo1.org
--- [17:34:12.608251] Recv textDocument/signatureHelp response (43466) from 'pyright' for project demo1.org
--- [17:34:15.565263] Send textDocument/signatureHelp request (50011) to 'pyright' for project demo1.org
--- [17:34:15.565849] Recv textDocument/signatureHelp response (50011) from 'pyright' for project demo1.org
--- [17:34:20.657486] Send textDocument/completion request (55272) to 'pyright' for project demo1.org
--- [17:34:20.658059] Recv textDocument/completion response (55272) from 'pyright' for project demo1.org
--- [17:34:20.658159] Got completion candidates (0) from 'pyright' for file demo1.org
--- [17:34:20.658204] Record completion candidates (0) from 'pyright' for file demo1.org
**** notice: the above log generated during manually complete *****
Turn on option lsp-bridge-enable-log
, https://github.com/manateelazycat/lsp-bridge/blob/0aea370da1030ca93c03ee40dc7f5e49f20ae3e6/lsp-bridge.el#L1257 will show why manually popup can't work.
detailed log with lsp-bridge-enable-log
eanbled:
1. manually complete with input: "sys.pr"
--- [13:32:55.292133] Send textDocument/completion request (37803) to 'pyright' for project demo.org
{
"id": 37803,
"method": "textDocument/completion",
"params": {
"position": {
"line": 7,
"character": 6
},
"context": {
"triggerKind": 1
},
"textDocument": {
"uri": "file:///home/sawyer/tmp/demo.org"
}
},
"message_type": "request",
"jsonrpc": "2.0"
}
--- [13:32:55.292997] Recv textDocument/completion response (37803) from 'pyright' for project demo.org
--- [13:32:55.293066] Got completion candidates (0) from 'pyright' for file demo.org
--- [13:32:55.293113] Record completion candidates (0) from 'pyright' for file demo.org
Eval in Emacs: (lsp-bridge-completion--record-items '"/home/sawyer/tmp/demo.org" '"" '() '(:line 7 :character 6) '"pyright" '("." "[") '("pyright"))
{
"jsonrpc": "2.0",
"id": 37803,
"result": {
"items": [],
"isIncomplete": true
}
}
Eval in Emacs: (lsp-bridge-search-backend--record-items '"search-file-words" '())
len(lines) = 15, line = 7, character = 6
len(lines) = 15, line = 7, character = 6
2. auto complete log with input: "sys.pr"
--- [13:40:22.211853] Send textDocument/didChange notification to 'pyright' for project demo.org
{
"method": "textDocument/didChange",
"params": {
"textDocument": {
"uri": "file:///home/sawyer/tmp/demo.org",
"version": 45
},
"contentChanges": [
{
"range": {
"start": {
"line": 2,
"character": 4
},
"end": {
"line": 2,
"character": 4
}
},
"rangeLength": 0,
"text": "p"
}
]
},
"message_type": "notification",
"jsonrpc": "2.0"
}
--- [13:40:22.312020] Send textDocument/completion request (62681) to 'pyright' for project demo.org
{
"id": 62681,
"method": "textDocument/completion",
"params": {
"position": {
"line": 2,
"character": 5
},
"context": {
"triggerKind": 1
},
"textDocument": {
"uri": "file:///home/sawyer/tmp/demo.org"
}
},
"message_type": "request",
"jsonrpc": "2.0"
}
--- [13:40:22.317043] Recv textDocument/completion response (62681) from 'pyright' for project demo.org
--- [13:40:22.317845] Got completion candidates (40) from 'pyright' for file demo.org
--- [13:40:22.317906] Record completion candidates (40) from 'pyright' for file demo.org
Eval in Emacs: (lsp-bridge-completion--record-items '"/home/sawyer/tmp/demo.org" '"" '((:key "path__" :icon "variable" :label "path" :displayLabel "path" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.path" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "prefix__" :icon "variable" :label "prefix" :displayLabel "prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "platform__" :icon "variable" :label "platform" :displayLabel "platform" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.platform" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "path_hooks__" :icon "variable" :label "path_hooks" :displayLabel "path_hooks" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.path_hooks" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "platlibdir__" :icon "variable" :label "platlibdir" :displayLabel "platlibdir" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.platlibdir" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "pycache_prefix__" :icon "variable" :label "pycache_prefix" :displayLabel "pycache_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.pycache_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "path_importer_cache__" :icon "variable" :label "path_importer_cache" :displayLabel "path_importer_cache" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.path_importer_cache" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "copyright__" :icon "variable" :label "copyright" :displayLabel "copyright" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.copyright" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "last_type__" :icon "variable" :label "last_type" :displayLabel "last_type" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.last_type" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "meta_path__" :icon "variable" :label "meta_path" :displayLabel "meta_path" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.meta_path" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_xoptions__" :icon "variable" :label "_xoptions" :displayLabel "_xoptions" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._xoptions" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "excepthook__" :icon "variable" :label "excepthook" :displayLabel "excepthook" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.excepthook" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_FlagTuple__" :icon "variable" :label "_FlagTuple" :displayLabel "_FlagTuple" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._FlagTuple" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "getprofile__" :icon "function" :label "getprofile" :displayLabel "getprofile" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.getprofile" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "setprofile__" :icon "function" :label "setprofile" :displayLabel "setprofile" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.setprofile" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_OptExcInfo__" :icon "variable" :label "_OptExcInfo" :displayLabel "_OptExcInfo" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._OptExcInfo" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "base_prefix__" :icon "variable" :label "base_prefix" :displayLabel "base_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.base_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "displayhook__" :icon "variable" :label "displayhook" :displayLabel "displayhook" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.displayhook" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "exec_prefix__" :icon "variable" :label "exec_prefix" :displayLabel "exec_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.exec_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "api_version__" :icon "variable" :label "api_version" :displayLabel "api_version" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.api_version" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "warnoptions__" :icon "variable" :label "warnoptions" :displayLabel "warnoptions" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.warnoptions" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "implementation__" :icon "variable" :label "implementation" :displayLabel "implementation" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.implementation" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "getdlopenflags__" :icon "function" :label "getdlopenflags" :displayLabel "getdlopenflags" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.getdlopenflags" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "breakpointhook__" :icon "function" :label "breakpointhook" :displayLabel "breakpointhook" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.breakpointhook" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "setdlopenflags__" :icon "function" :label "setdlopenflags" :displayLabel "setdlopenflags" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.setdlopenflags" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_MetaPathFinder__" :icon "class" :label "_MetaPathFinder" :displayLabel "_MetaPathFinder" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._MetaPathFinder" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_implementation__" :icon "class" :label "_implementation" :displayLabel "_implementation" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._implementation" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "base_exec_prefix__" :icon "variable" :label "base_exec_prefix" :displayLabel "base_exec_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.base_exec_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "float_repr_style__" :icon "variable" :label "float_repr_style" :displayLabel "float_repr_style" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.float_repr_style" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_clear_type_cache__" :icon "function" :label "_clear_type_cache" :displayLabel "_clear_type_cache" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._clear_type_cache" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "get_coroutine_origin_tracking_depth__" :icon "function" :label "get_coroutine_origin_tracking_depth" :displayLabel "get_coroutine_origin_tracking_depth" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.get_coroutine_origin_tracking_depth" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "set_coroutine_origin_tracking_depth__" :icon "function" :label "set_coroutine_origin_tracking_depth" :displayLabel "set_coroutine_origin_tracking_depth" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.set_coroutine_origin_tracking_depth" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "ps1__" :icon "variable" :label "ps1" :displayLabel "ps1" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.ps1" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "ps2__" :icon "variable" :label "ps2" :displayLabel "ps2" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.ps2" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__spec____" :icon "variable" :label "__spec__" :displayLabel "__spec__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__spec__" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__path____" :icon "variable" :label "__path__" :displayLabel "__path__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__path__" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__package____" :icon "variable" :label "__package__" :displayLabel "__package__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__package__" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__excepthook____" :icon "function" :label "__excepthook__" :displayLabel "__excepthook__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__excepthook__" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__displayhook____" :icon "function" :label "__displayhook__" :displayLabel "__displayhook__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__displayhook__" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "__breakpointhook____" :icon "variable" :label "__breakpointhook__" :displayLabel "__breakpointhook__" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "11.9999.__breakpointhook__" :server "pyright" :backend "lsp" :additionalTextEdits ())) '(:line 2 :character 5) '"pyright" '("." "[") '("pyright"))
{
"jsonrpc": "2.0",
"id": 62681,
"result": {
"items": [
{
"label": "__package__",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__package__"
},
"sortText": "11.9999.__package__"
},
{
"label": "__spec__",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__spec__"
},
"sortText": "11.9999.__spec__"
},
{
"label": "__path__",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__path__"
},
"sortText": "11.9999.__path__"
},
{
"label": "_OptExcInfo",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_OptExcInfo"
},
"sortText": "09.9999._OptExcInfo"
},
{
"label": "_MetaPathFinder",
"kind": 7,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_MetaPathFinder"
},
"sortText": "09.9999._MetaPathFinder"
},
{
"label": "base_exec_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "base_exec_prefix"
},
"sortText": "09.9999.base_exec_prefix"
},
{
"label": "base_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "base_prefix"
},
"sortText": "09.9999.base_prefix"
},
{
"label": "copyright",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "copyright"
},
"sortText": "09.9999.copyright"
},
{
"label": "displayhook",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "displayhook"
},
"sortText": "09.9999.displayhook"
},
{
"label": "excepthook",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "excepthook"
},
"sortText": "09.9999.excepthook"
},
{
"label": "exec_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "exec_prefix"
},
"sortText": "09.9999.exec_prefix"
},
{
"label": "float_repr_style",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "float_repr_style"
},
"sortText": "09.9999.float_repr_style"
},
{
"label": "last_type",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "last_type"
},
"sortText": "09.9999.last_type"
},
{
"label": "meta_path",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "meta_path"
},
"sortText": "09.9999.meta_path"
},
{
"label": "path",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "path"
},
"sortText": "09.9999.path"
},
{
"label": "path_hooks",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "path_hooks"
},
"sortText": "09.9999.path_hooks"
},
{
"label": "path_importer_cache",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "path_importer_cache"
},
"sortText": "09.9999.path_importer_cache"
},
{
"label": "platform",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "platform"
},
"sortText": "09.9999.platform"
},
{
"label": "platlibdir",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "platlibdir"
},
"sortText": "09.9999.platlibdir"
},
{
"label": "prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "prefix"
},
"sortText": "09.9999.prefix"
},
{
"label": "pycache_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "pycache_prefix"
},
"sortText": "09.9999.pycache_prefix"
},
{
"label": "ps1",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "ps1"
},
"sortText": "09.9999.ps1"
},
{
"label": "ps2",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "ps2"
},
"sortText": "09.9999.ps2"
},
{
"label": "api_version",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "api_version"
},
"sortText": "09.9999.api_version"
},
{
"label": "warnoptions",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "warnoptions"
},
"sortText": "09.9999.warnoptions"
},
{
"label": "_xoptions",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_xoptions"
},
"sortText": "09.9999._xoptions"
},
{
"label": "_FlagTuple",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_FlagTuple"
},
"sortText": "09.9999._FlagTuple"
},
{
"label": "implementation",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "implementation"
},
"sortText": "09.9999.implementation"
},
{
"label": "_implementation",
"kind": 7,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_implementation"
},
"sortText": "09.9999._implementation"
},
{
"label": "_clear_type_cache",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "_clear_type_cache"
},
"sortText": "09.9999._clear_type_cache"
},
{
"label": "__displayhook__",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__displayhook__"
},
"sortText": "11.9999.__displayhook__"
},
{
"label": "__excepthook__",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__excepthook__"
},
"sortText": "11.9999.__excepthook__"
},
{
"label": "getdlopenflags",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "getdlopenflags"
},
"sortText": "09.9999.getdlopenflags"
},
{
"label": "getprofile",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "getprofile"
},
"sortText": "09.9999.getprofile"
},
{
"label": "setprofile",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "setprofile"
},
"sortText": "09.9999.setprofile"
},
{
"label": "__breakpointhook__",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "__breakpointhook__"
},
"sortText": "11.9999.__breakpointhook__"
},
{
"label": "breakpointhook",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "breakpointhook"
},
"sortText": "09.9999.breakpointhook"
},
{
"label": "setdlopenflags",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "setdlopenflags"
},
"sortText": "09.9999.setdlopenflags"
},
{
"label": "get_coroutine_origin_tracking_depth",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "get_coroutine_origin_tracking_depth"
},
"sortText": "09.9999.get_coroutine_origin_tracking_depth"
},
{
"label": "set_coroutine_origin_tracking_depth",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 5
},
"symbolLabel": "set_coroutine_origin_tracking_depth"
},
"sortText": "09.9999.set_coroutine_origin_tracking_depth"
}
],
"isIncomplete": true
}
}
--- [13:40:22.463842] Recv textDocument/publishDiagnostics notification from 'pyright' for project demo.org
{
"jsonrpc": "2.0",
"method": "textDocument/publishDiagnostics",
"params": {
"uri": "file:///home/sawyer/tmp/demo.org",
"version": 45,
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 4
},
"end": {
"line": 2,
"character": 5
}
},
"message": "\"p\" is not a known member of module",
"severity": 1,
"code": "reportGeneralTypeIssues",
"source": "Pyright",
"codeDescription": {
"href": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md"
}
}
]
}
}
Eval in Emacs: (lsp-bridge-search-backend--record-items '"search-file-words" '())
len(lines) = 15, line = 7, character = 5
len(lines) = 15, line = 7, character = 5
--- [13:40:22.585353] Send textDocument/didChange notification to 'pyright' for project demo.org
{
"method": "textDocument/didChange",
"params": {
"textDocument": {
"uri": "file:///home/sawyer/tmp/demo.org",
"version": 46
},
"contentChanges": [
{
"range": {
"start": {
"line": 2,
"character": 5
},
"end": {
"line": 2,
"character": 5
}
},
"rangeLength": 0,
"text": "r"
}
]
},
"message_type": "notification",
"jsonrpc": "2.0"
}
--- [13:40:22.685793] Send textDocument/completion request (50331) to 'pyright' for project demo.org
{
"id": 50331,
"method": "textDocument/completion",
"params": {
"position": {
"line": 2,
"character": 6
},
"context": {
"triggerKind": 1
},
"textDocument": {
"uri": "file:///home/sawyer/tmp/demo.org"
}
},
"message_type": "request",
"jsonrpc": "2.0"
}
--- [13:40:22.690086] Recv textDocument/completion response (50331) from 'pyright' for project demo.org
--- [13:40:22.690390] Got completion candidates (14) from 'pyright' for file demo.org
--- [13:40:22.690440] Record completion candidates (14) from 'pyright' for file demo.org
Eval in Emacs: (lsp-bridge-completion--record-items '"/home/sawyer/tmp/demo.org" '"" '((:key "prefix__" :icon "variable" :label "prefix" :displayLabel "prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "platform__" :icon "variable" :label "platform" :displayLabel "platform" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.platform" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "copyright__" :icon "variable" :label "copyright" :displayLabel "copyright" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.copyright" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "platlibdir__" :icon "variable" :label "platlibdir" :displayLabel "platlibdir" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.platlibdir" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "getprofile__" :icon "function" :label "getprofile" :displayLabel "getprofile" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.getprofile" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "setprofile__" :icon "function" :label "setprofile" :displayLabel "setprofile" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.setprofile" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "base_prefix__" :icon "variable" :label "base_prefix" :displayLabel "base_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.base_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "exec_prefix__" :icon "variable" :label "exec_prefix" :displayLabel "exec_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.exec_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "api_version__" :icon "variable" :label "api_version" :displayLabel "api_version" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.api_version" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "pycache_prefix__" :icon "variable" :label "pycache_prefix" :displayLabel "pycache_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.pycache_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "_MetaPathFinder__" :icon "class" :label "_MetaPathFinder" :displayLabel "_MetaPathFinder" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999._MetaPathFinder" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "base_exec_prefix__" :icon "variable" :label "base_exec_prefix" :displayLabel "base_exec_prefix" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.base_exec_prefix" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "float_repr_style__" :icon "variable" :label "float_repr_style" :displayLabel "float_repr_style" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.float_repr_style" :server "pyright" :backend "lsp" :additionalTextEdits ()) (:key "path_importer_cache__" :icon "variable" :label "path_importer_cache" :displayLabel "path_importer_cache" :deprecated () :insertText () :insertTextFormat "" :textEdit () :score 1000 :sortText "09.9999.path_importer_cache" :server "pyright" :backend "lsp" :additionalTextEdits ())) '(:line 2 :character 6) '"pyright" '("." "[") '("pyright"))
{
"jsonrpc": "2.0",
"id": 50331,
"result": {
"items": [
{
"label": "_MetaPathFinder",
"kind": 7,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "_MetaPathFinder"
},
"sortText": "09.9999._MetaPathFinder"
},
{
"label": "base_exec_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "base_exec_prefix"
},
"sortText": "09.9999.base_exec_prefix"
},
{
"label": "base_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "base_prefix"
},
"sortText": "09.9999.base_prefix"
},
{
"label": "copyright",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "copyright"
},
"sortText": "09.9999.copyright"
},
{
"label": "exec_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "exec_prefix"
},
"sortText": "09.9999.exec_prefix"
},
{
"label": "float_repr_style",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "float_repr_style"
},
"sortText": "09.9999.float_repr_style"
},
{
"label": "path_importer_cache",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "path_importer_cache"
},
"sortText": "09.9999.path_importer_cache"
},
{
"label": "platform",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "platform"
},
"sortText": "09.9999.platform"
},
{
"label": "platlibdir",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "platlibdir"
},
"sortText": "09.9999.platlibdir"
},
{
"label": "prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "prefix"
},
"sortText": "09.9999.prefix"
},
{
"label": "pycache_prefix",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "pycache_prefix"
},
"sortText": "09.9999.pycache_prefix"
},
{
"label": "api_version",
"kind": 6,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "api_version"
},
"sortText": "09.9999.api_version"
},
{
"label": "getprofile",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "getprofile"
},
"sortText": "09.9999.getprofile"
},
{
"label": "setprofile",
"kind": 3,
"data": {
"workspacePath": "/home/sawyer/tmp/demo.org",
"filePath": "/home/sawyer/tmp/demo.org",
"position": {
"line": 2,
"character": 6
},
"symbolLabel": "setprofile"
},
"sortText": "09.9999.setprofile"
}
],
"isIncomplete": true
}
}
--- [13:40:22.837021] Recv textDocument/publishDiagnostics notification from 'pyright' for project demo.org
{
"jsonrpc": "2.0",
"method": "textDocument/publishDiagnostics",
"params": {
"uri": "file:///home/sawyer/tmp/demo.org",
"version": 46,
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 4
},
"end": {
"line": 2,
"character": 6
}
},
"message": "\"pr\" is not a known member of module",
"severity": 1,
"code": "reportGeneralTypeIssues",
"source": "Pyright",
"codeDescription": {
"href": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md"
}
}
]
}
}
Its seems no error generated during the log for manually complete. Just no candidates generated.
@kongds Can you help to fix this issue?
I found when we call lsp-bridge-popup-complete-menu
in org file, lsp server return candidates' prefix is not prefix before cursor.
I try to fix this issue, but no luck.
Ok, I will take a look.
@kongds Can you help to fix this issue?
I found when we call
lsp-bridge-popup-complete-menu
in org file, lsp server return candidates' prefix is not prefix before cursor.I try to fix this issue, but no luck.
This should fix. #875
This should fix. #875
Cool, but manually complete only work when user change code, manually complete can't work if call lsp-bridge-popup-complete-menu directly after open org file.
大佬, 合并补丁之后, 只能修改org 代码以后才能补全, 如果打开 org 文件, 直接调用 lsp-bridge-popup-complete-menu 命令, 补全菜单依然不能弹出
This might be a problem with the previous design. If the file is not modified, there might not be a need for completion. If the lsp server is initialized for completion without modifying (different servers need to be initialized, or the block content needs to be updated), it might slow down the speed of org.
这个可能是之前设计的问题,不修改文件的话应该也不需要补全,如果不修改直接初始化lsp server补全的话(不同的src block都需要初始化,或者update file),可能会让org的速度变慢。
This might be a problem with the previous design. If the file is not modified, there might not be a need for completion. If the lsp server is initialized for completion without modifying (different servers need to be initialized, or the block content needs to be updated), it might slow down the speed of org.
这个可能是之前设计的问题,不修改文件的话应该也不需要补全,如果不修改直接初始化lsp server补全的话(不同的src block都需要初始化,或者update file),可能会让org的速度变慢。
https://github.com/manateelazycat/lsp-bridge/commit/3ab0d4a6392eb9e4f15b85822c30e4f2c0c8103f
这个补丁已经修复了这个问题, 就是判断光标在 org src block 范围内, 先调用一次 update_file 函数, 这样用户即使不编辑 org src block 代码也可以直接弹出补全菜单了。
@sawyerzheng Thanks for report, I believe newest version has fixed this issue.
Yes, the problem is fixed. Thanks for your awesome work and valuable time. 谢谢两位大佬。