Closed nasyxx closed 2 years ago
Can you elaborate on your example? (e.g., before completion, after completion, your expectation)
Does the preview indent correctly?
Can you also provide the corresponding log which starts with [INFO] Completion:
in the *copilot-log*
buffer?
| is cursor.
Before:
if self.conf.net.esm:
|
After:
if self.conf.net.esm:
esm_t = self.esm(data.esm_t)
esm_nt = self.esm(data.esm_nt)
t = torch.cat((t, esm_t), -1)
nt = torch.cat((nt, esm_nt), -1)
expectation:
if self.conf.net.esm:
esm_t = self.esm(data.esm_t)
esm_nt = self.esm(data.esm_nt)
t = torch.cat((t, esm_t), -1)
nt = torch.cat((nt, esm_nt), -1)
If the cursor is at the previous line:
if self.conf.net.esm:|
We can get the expected without extra spaces one.
Can you check the [INFO] Completion:
lines in *copilot-log*
buffer? We can find out the wrong indention is caused by Copilot or this plugin.
And one possible reason is that you use space for indention while Copilot uses tab or vice versa. Can you also check whether Copilot's completions use different indentions from yours?
I just try clean the log and complete twice
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:20.450Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:20.450Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:20.920Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 470 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:20.920Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 470 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:20.921Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2WAeCv55Adi3s40tChQKfwqKQr}] created: [{1648859780}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:20.921Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2WAeCv55Adi3s40tChQKfwqKQr}] created: [{1648859780}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:20.921Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:20.921Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:22.072Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:22.072Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:22.324Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:22.324Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:22.400Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:22.400Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:23.136Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:23.136Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:23.136Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:23.136Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . [((uuid . "a5047ade-029f-4d53-bb7b-e9615c193f17") (text . " if self.conf.net.esm:
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 153) (character . 0)) (end (line . 153) (character . 29))) (displayText . "
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 153) (character . 29)))]))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:23.253Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:23.253Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "4df4cbbe-0ac7-4fc5-88b8-29598285a50e") (text . " if self.conf.net.esm:
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 153) (character . 0)) (end (line . 153) (character . 29))) (displayText . "
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 153) (character . 29)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:26.193Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:26.193Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:27.163Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:27.163Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:27.406Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:27.406Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:27.407Z] Filtered out solution matching next line") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:27.407Z]") (extra . ["Filtered out solution matching next line"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:27.769Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:27.769Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "2cabe374-eead-4bc7-b189-17d3a842b001") (text . " if self.conf.net.esm:
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 153) (character . 0)) (end (line . 153) (character . 29))) (displayText . "
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 153) (character . 29)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:28.211Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:28.211Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "1c020e74-90d1-4409-ab5b-5d65b2b128db") (text . " if self.conf.net.esm:
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 153) (character . 0)) (end (line . 153) (character . 29))) (displayText . "
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 153) (character . 29)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:28.774Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:28.774Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "ee4e0acc-aaeb-4aa6-bf6f-dc1439fae178") (text . " t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 154) (character . 0)) (end (line . 154) (character . 12))) (displayText . "t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 154) (character . 12)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:29.997Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:29.997Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:30.107Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 110 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:30.107Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 110 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:30.108Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2gss9JATB0mDQEoimn9ivLRESU}] created: [{1648859790}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:30.108Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2gss9JATB0mDQEoimn9ivLRESU}] created: [{1648859790}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:30.108Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:30.108Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:30.650Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:30.650Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:31.134Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 484 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:31.134Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 484 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:31.134Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2gznCI9YHcTjR3WKaCKcvgVljF}] created: [{1648859790}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:31.134Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2gznCI9YHcTjR3WKaCKcvgVljF}] created: [{1648859790}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:31.134Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:31.134Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:31.962Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:31.962Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:32.061Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 99 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:32.061Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 99 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:32.061Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2hwZLo5OesunW9btklyPb78LvZ}] created: [{1648859791}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:32.061Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2hwZLo5OesunW9btklyPb78LvZ}] created: [{1648859791}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:32.061Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:32.061Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:33.352Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:33.352Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:34.055Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 703 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:34.055Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 703 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:34.055Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2jf2h1K65wCbLmFhKkntnYOaJD}] created: [{1648859793}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:34.055Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2jf2h1K65wCbLmFhKkntnYOaJD}] created: [{1648859793}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:34.055Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:34.055Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:35.349Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:35.349Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "7efcf0e7-bae1-4a5b-b22c-218103ba92c7") (text . " t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 154) (character . 0)) (end (line . 154) (character . 12))) (displayText . "t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 154) (character . 12)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:36.759Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:36.759Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "97bd25a8-16de-4de7-b746-685d098bdf49") (text . " if self.conf.net.esm:
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (range (start (line . 153) (character . 0)) (end (line . 153) (character . 29))) (displayText . "
t = torch.cat((t, self.esm(data.esm_t)), -1)
nt = torch.cat((nt, self.esm(data.esm_nt)), -1)") (position (line . 153) (character . 29)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:36.967Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:36.967Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.082Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.082Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:37.159Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:37.159Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.265Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.265Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:37.341Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:37.341Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.445Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.445Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:37.522Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:37.522Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.580Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.580Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:37.656Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:37.656Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.762Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.762Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:37.838Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:37.838Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:37.932Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:37.932Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:38.007Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:38.007Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:38.458Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 451 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:38.458Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 451 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:38.460Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2oqM9q8iKVETPMrbZWCDub5neo}] created: [{1648859798}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:38.460Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2oqM9q8iKVETPMrbZWCDub5neo}] created: [{1648859798}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:38.460Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:38.460Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "InProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:38.816Z] [fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex") (metadataStr . "[INFO] [default] [2022-04-02T00:36:38.816Z]") (extra . ["[fetchCompletions] engine https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [default] [2022-04-02T00:36:39.332Z] request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 516 ms") (metadataStr . "[INFO] [default] [2022-04-02T00:36:39.332Z]") (extra . ["request.response: [https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions] took 516 ms"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [streamChoices] [2022-04-02T00:36:39.332Z] solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2oilR3mQGUyeN7K5XzCS3u2AHF}] created: [{1648859798}]") (metadataStr . "[INFO] [streamChoices] [2022-04-02T00:36:39.332Z]") (extra . ["solution 0 returned. finish reason: [\"stop\"] finishOffset: [undefined] completionId: [{cmpl-4sM2oilR3mQGUyeN7K5XzCS3u2AHF}] created: [{1648859798}]"])))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "statusNotification") (params (status . "RemoveProgress") (message . "")))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:36:39.333Z] Breaking, no choices") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:36:39.333Z]") (extra . ["Breaking, no choices"])))
[INFO] Completion: ((error) (completions . []))
I just try clean the log and complete them manually.
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:51:23.292Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:51:23.292Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "a050aa52-7f46-434a-8833-d58ef5719c20") (text . " if self.conf.net.dph3:
t = t.view(t.shape[0], -1)
nt = nt.view(nt.shape[0], -1)") (range (start (line . 159) (character . 0)) (end (line . 159) (character . 30))) (displayText . "
t = t.view(t.shape[0], -1)
nt = nt.view(nt.shape[0], -1)") (position (line . 159) (character . 30)))]))
[INFO] Discard message without id: ((jsonrpc . "2.0") (method . "LogMessage") (params (level . 1) (message . "[INFO] [ghostText] [2022-04-02T00:51:32.787Z] Found inline suggestions locally") (metadataStr . "[INFO] [ghostText] [2022-04-02T00:51:32.787Z]") (extra . ["Found inline suggestions locally"])))
[INFO] Completion: ((error) (completions . [((uuid . "f67a8dd8-894e-452d-b341-cdf3055d33ca") (text . " t = t.view(t.shape[0], -1)
nt = nt.view(nt.shape[0], -1)") (range (start (line . 160) (character . 0)) (end (line . 160) (character . 12))) (displayText . "t = t.view(t.shape[0], -1)
nt = nt.view(nt.shape[0], -1)") (position (line . 160) (character . 12)))]))
Usually, displayText
should be a suffix of text
(precisely, text
= your code before cursor in current line + displayText
). But in your second completion, the indentions of displayText
and text
are different. So I suspect it is a bug in Copilot.
copilot.el
uses text
for completion, so does copilot.vim
.(https://github.com/github/copilot.vim/blob/release/autoload/copilot.vim#L229).
Sometimes Copilot will remove indentions, so text
is the more precise one.
Example (|
is cursor):
func main() {
fmt.Println("Hello, World!")
|
Both text
and displayText
given by Copilot are }
. And the desired result after completion is
func main() {
fmt.Println("Hello, World!")
}|
In this case, I can't simply append displayText
after the cursor.
I don't have a simple way to use displayText
instead of text
for completion. And personally, I never encountered this problem, and it may be a bug from Copilot. So I won't fix it for now.
If you feel disappointed because of these misbehaviors, you can fix it by changing (alist-get 'text completion)
to (concat (buffer-substring-no-properties (line-beginning-position) (point)) (alist-get 'displayText completion))
, but it will break the example I list above.
Interesting. It looks like it is the copilot's bug.
I tried different cursor positions (beginning of the line, fewer spaces, more spaces than the indent) to run copilot-complete.
Only if I left the cursor in the if
line does it work well.
Also, I have tried it in VSC, and it works well.
Can you try to run copilot-complete
under insert mode?
I just tested it under normal mode, and reproduced the same problem.
Sorry, I can't. I don't use modal editing.
Can you try to run
copilot-complete
under insert mode? I just tested it under normal mode, and reproduced the same problem.
For evil users: the difference between insert mode and normal mode is that the cursor position is offset by one. So Copilot will provide the wrong indention.
update: it should have no problem under normal mode.
the cursor position is offset by one.
Interesting. How can I make it default offset by one or by zero manually?
Sadly, I can't reproduce the problem with under mode. It works even with more or less spaces.
Well... I 'll try a copilot only emacs later.
the cursor position is offset by one.
Interesting. How can I make it default offset by one or by zero manually?
Sorry, the problem I produced is caused by my tab hook. It still gives the correct preview. So in my tests, Copilot gives correct indentions regardless of the number of leading spaces.
Well... I 'll try a copilot only emacs later.
Sure. And you may want to check the copilot--generate-doc
function, which prepares completion requests.
Well. Still failed.
My emacs is
GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.4.0, NS appkit-2113.40 Version 12.3 (Build 21E230)) of 2022-03-27
I find the cause after learning some vanilla Emacs keybindings!
When eval (copilot--generate-doc)
, you will find both tabSize
and indentSize
are set to 8!
All you need to do is set tab-width
to 4!
And I wonder, is there any better way to detect the indent size?
It works.
And I wonder, is there any better way to detect the indent size?
I guess no. Different languages use different indent sizes. For Python, it uses python-indent-offset
, and C uses c-basic-offset
.
editorconfig/editorconfig-emacs@
master
/editorconfig.el#L177 Is it a better way?
Yes!
Thanks for your help debugging. Can you confirm if the fix works?
Yes. It works.
In most cases, it works well. But sometimes, it may add some spaces/tabs to align the layout, which is ineffective.
Maybe we should remove them? Or can we indent them after completion?